Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/26/11 23:53:57 (14 years ago)
Author:
mjesner
Message:

#1499 result page, styling, functionality (add/remove) for post actions

Location:
branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx

    r6268 r6303  
    88<script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
    99
     10<script type="text/javascript">
     11    function setAction(action, id) {
     12        document.getElementById('selectedFilter').value = id;
     13        document.getElementById('action').value = action;
     14        document.filterForm.submit();
     15    }
     16</script>
     17
     18
    1019<% Html.EnableClientValidation(); %>
     20 <% using (Html.BeginForm("AddFilter", "Filter", FormMethod.Post, new { Name = "filterForm" })) %>
     21    <% {  %> 
     22<!-- Put all into a form that calls the "AddFilter" Action-->
    1123
    12 <!-- Put all into a form that calls the "AddFilter" Action-->
    13 <div><table>
     24    <%
     25     CombinedFilter topFilter = ((FilterModel)Model).Content;
     26    %>
     27    <div><table>
    1428<tr><td>A<br />N<br />D</td><td>
    15 <p>
    16     <%
    17         CombinedFilter topFilter = ((FilterModel)Model).Content;
     29
     30
     31   
     32           <%
     33     foreach (Filter fNode in topFilter.Filters)
     34     {
     35
     36         CombinedFilter currentFilter = (CombinedFilter)fNode;
     37         string comboboxName = FilterModel.ComboboxName + "." + currentFilter.Id;
     38         string hiddenName = FilterModel.ParentIdName + "." + currentFilter.Id;
    1839    %>
    19     <% using (Html.BeginForm("AddFilterAnd", "Filter", FormMethod.Post, new { id = topFilter.Id, name = topFilter.Id })) %>
    20     <% {   
    21            
    22             foreach (Filter fNode in topFilter.Filters)
    23             {
    24 
    25                 CombinedFilter currentFilter = (CombinedFilter)fNode;
    26                 string comboboxName = FilterModel.ComboboxName + "." + currentFilter.Id;
    27                 string hiddenName = FilterModel.ParentIdName + "." + currentFilter.Id;
    28     %>
    29     <%: Html.Hidden(hiddenName,currentFilter.Id.ToString()) %>
    30     <%: Html.DropDownList( comboboxName, new SelectList(((FilterModel)Model).AvailableFilterForCombobox, "FilterTypeName", "Label"))%>
    31     <input type="submit" name="submitButton" value="+.<%:currentFilter.Id%>" />
    32 </p>
     40    <table border="0"><tr><td>
     41    <%: Html.Hidden(hiddenName, currentFilter.Id.ToString())%>
     42      <%: Html.Hidden("selectedFilter",null, new { Id = "selectedFilter" })%>
     43       <%: Html.Hidden("action", null, new { Id = "action" })%>
     44    <%: Html.DropDownList(comboboxName, new SelectList(((FilterModel)Model).AvailableFilterForCombobox, "FilterTypeName", "Label"))%>
     45   
     46   
     47    <input type="button" name="submitButton" value="+" class="hl-button-text-plus"   onClick="setAction('add','<%: currentFilter.Id%>');" />
     48   <!-- <input type="submit" name="submitButton" value="+.<%:currentFilter.Id%>"  />-->
     49</td></tr><tr><td>
    3350<!-- Build the selected filters. The filtesr will be stored in the session and the
    3451Controller puts the current filters from the session into the model. Selected Filters
     
    4259           {  %>
    4360
    44            <table border="0"><tr><td>
     61           <tr><td>
    4562    <%
    4663           
    4764
    48 if ("StringComparisonFilter".Equals(f.GetType().Name))
    49 {  %>
     65     if ("StringComparisonFilter".Equals(f.GetType().Name))
     66     {  %>
    5067    <% StringComparisonFilter filter = ((StringComparisonFilter)f); %>
    5168    <%: Html.Label(filter.Label)%>
    52     <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text",(int)filter.Comparison))%>   
     69    <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%>   
    5370    <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, (filter.Value))%>
    54     <%: Html.TextBoxFor(model => ((FilterModel)Model).IntValue, (filter.Value)) %>
    55     <%: Html.ValidationMessageFor(model => ((FilterModel)Model).IntValue) %>
     71    <%: Html.TextBoxFor(model => ((FilterModel)Model).IntValue, (filter.Value))%>
     72    <%: Html.ValidationMessageFor(model => ((FilterModel)Model).IntValue)%>
    5673    <% }
    57 else if ("NameStringComparisonFilter".Equals(f.GetType().Name))
    58 { %>
     74     else if ("NameStringComparisonFilter".Equals(f.GetType().Name))
     75     { %>
    5976    <% NameStringComparisonFilter filter = ((NameStringComparisonFilter)f); %>
    6077    <%: Html.Label(filter.Label)%>
    61     <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text",(int)filter.Comparison))%>   
     78    <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%>   
    6279    <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%>
    6380    <% }
    64 else if ("StringComparisonAvailableValuesFilter".Equals(f.GetType().Name))
    65 { %>
     81     else if ("StringComparisonAvailableValuesFilter".Equals(f.GetType().Name))
     82     { %>
    6683    <% StringComparisonAvailableValuesFilter filter = ((StringComparisonAvailableValuesFilter)f); %>
    6784    <%: Html.Label(filter.Label)%>
    68     <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text",(int)filter.Comparison))%>   
     85    <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%>   
    6986    <%: Html.DropDownList(f.Id + "." + FilterModel.ValueTextbox, new SelectList(filter.AvailableValues, filter.Value))%>
    7087    <% }
    71 else if ("NameEqualityComparisonByteArrayFilter".Equals(f.GetType().Name))
    72 { %>
     88     else if ("NameEqualityComparisonByteArrayFilter".Equals(f.GetType().Name))
     89     { %>
    7390    <% NameEqualityComparisonByteArrayFilter filter = ((NameEqualityComparisonByteArrayFilter)f); %>
    7491    <%: Html.Label(filter.Label)%>
    7592    <%: Html.Label("not supported")%>
    7693    <% }
    77 else if ("NameEqualityComparisonBoolFilter".Equals(f.GetType().Name))
    78 { %>
     94     else if ("NameEqualityComparisonBoolFilter".Equals(f.GetType().Name))
     95     { %>
    7996    <% NameEqualityComparisonBoolFilter filter = ((NameEqualityComparisonBoolFilter)f);   %>
    8097    <%: Html.Label(filter.Label)%>
    81     <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.BoolComparisons, "Value", "Text",(int)filter.Comparison))%>     
     98    <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.BoolComparisons, "Value", "Text", (int)filter.Comparison))%>     
    8299    <%: Html.DropDownList(f.Id + "." + FilterModel.ValueDropDownList, new SelectList(((FilterModel)Model).BoolStates, filter.Value))%>
    83100    <% }
    84 else if ("NameOrdinalComparisonIntFilter".Equals(f.GetType().Name))
    85 { %>
     101     else if ("NameOrdinalComparisonIntFilter".Equals(f.GetType().Name))
     102     { %>
    86103    <% NameOrdinalComparisonIntFilter filter = ((NameOrdinalComparisonIntFilter)f);   %>
    87104    <%: Html.Label(filter.Label)%>
     
    89106    <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%>
    90107    <% }
    91 else if ("NameStringComparisonAvailableValuesFilter".Equals(f.GetType().Name))
    92 { %>
     108     else if ("NameStringComparisonAvailableValuesFilter".Equals(f.GetType().Name))
     109     { %>
    93110    <% NameStringComparisonAvailableValuesFilter filter = ((NameStringComparisonAvailableValuesFilter)f);   %>
    94111    <%: Html.Label(filter.Label)%>
    95     <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text",(int)filter.Comparison))%>   
     112    <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text", (int)filter.Comparison))%>   
    96113    <%: Html.DropDownList(f.Id + "." + FilterModel.ValueDropDownList, new SelectList(filter.AvailableValues, filter.Value))%>
    97114    <% }
    98 else if ("NameOrdinalComparisonDoubleFilter".Equals(f.GetType().Name))
    99 { %>
     115     else if ("NameOrdinalComparisonDoubleFilter".Equals(f.GetType().Name))
     116     { %>
    100117    <% NameOrdinalComparisonDoubleFilter filter = ((NameOrdinalComparisonDoubleFilter)f);   %>
    101118    <%: Html.Label(filter.Label)%>
     
    103120    <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%>
    104121    <% }
    105 else if ("NameOrdinalComparisonFloatFilter".Equals(f.GetType().Name))
    106 { %>
     122     else if ("NameOrdinalComparisonFloatFilter".Equals(f.GetType().Name))
     123     { %>
    107124    <% NameOrdinalComparisonFloatFilter filter = ((NameOrdinalComparisonFloatFilter)f);   %>
    108125    <%: Html.Label(filter.Label)%>
     
    110127    <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%>
    111128    <% }
    112 else if ("NameOrdinalComparisonLongFilter".Equals(f.GetType().Name))
    113 { %>
     129     else if ("NameOrdinalComparisonLongFilter".Equals(f.GetType().Name))
     130     { %>
    114131    <% NameOrdinalComparisonLongFilter filter = ((NameOrdinalComparisonLongFilter)f);   %>
    115132    <%: Html.Label(filter.Label)%>
     
    117134    <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%>
    118135    <% }
    119 else if ("OrdinalComparisonDateTimeFilter".Equals(f.GetType().Name))
    120 { %>
     136     else if ("OrdinalComparisonDateTimeFilter".Equals(f.GetType().Name))
     137     { %>
    121138    <% OrdinalComparisonDateTimeFilter filter = ((OrdinalComparisonDateTimeFilter)f);   %>
    122139    <%: Html.Label(filter.Label)%>
     
    126143                 
    127144    %>
    128 
    129     <input type="submit" name="submitButton" value="-.<%:f.Id%>"    />
     145       <!-- <input type="submit" name="submitButton" value="-.<%:f.Id%>"  class="hl-icon-delete"  style="text-indent:-999em;"  />
     146       -->
     147    <input type="button" name="submitButton" value="-"  class="hl-icon-delete"  onClick="setAction('delete','<%: f.Id%>');" />
    130148   
    131149<% }%>
    132     </td></tr></table>
     150    </td></tr>
    133151    <% } %>
     152     </table></td></tr>
    134153 <%  }%>
    135154   <% }%>
    136  <input type="submit" name="submitButton"  value="or" />
     155
     156
     157
     158 
     159  </table> <input type="button" name="submitButton"  value="or"  onClick="setAction('or','');"  />
    137160 </br>
    138  <input type="submit" name="submitButton" value="runs" />
    139 
    140  
    141 
    142 <% }
    143      
    144 %> </td></tr>
    145 </table></div>
     161 <input type="button" name="submitButton" value="runs"  onClick="setAction('runs','');" />
     162 
     163 
     164<% }   
     165%>
     166 </div>
Note: See TracChangeset for help on using the changeset viewer.