Changeset 6303 for branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views
- Timestamp:
- 05/26/11 23:53:57 (14 years ago)
- 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 8 8 <script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script> 9 9 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 10 19 <% 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--> 11 23 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> 14 28 <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; 18 39 %> 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> 33 50 <!-- Build the selected filters. The filtesr will be stored in the session and the 34 51 Controller puts the current filters from the session into the model. Selected Filters … … 42 59 { %> 43 60 44 <t able border="0"><tr><td>61 <tr><td> 45 62 <% 46 63 47 64 48 if ("StringComparisonFilter".Equals(f.GetType().Name))49 { %>65 if ("StringComparisonFilter".Equals(f.GetType().Name)) 66 { %> 50 67 <% StringComparisonFilter filter = ((StringComparisonFilter)f); %> 51 68 <%: 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))%> 53 70 <%: 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)%> 56 73 <% } 57 else if ("NameStringComparisonFilter".Equals(f.GetType().Name))58 { %>74 else if ("NameStringComparisonFilter".Equals(f.GetType().Name)) 75 { %> 59 76 <% NameStringComparisonFilter filter = ((NameStringComparisonFilter)f); %> 60 77 <%: 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))%> 62 79 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 63 80 <% } 64 else if ("StringComparisonAvailableValuesFilter".Equals(f.GetType().Name))65 { %>81 else if ("StringComparisonAvailableValuesFilter".Equals(f.GetType().Name)) 82 { %> 66 83 <% StringComparisonAvailableValuesFilter filter = ((StringComparisonAvailableValuesFilter)f); %> 67 84 <%: 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))%> 69 86 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueTextbox, new SelectList(filter.AvailableValues, filter.Value))%> 70 87 <% } 71 else if ("NameEqualityComparisonByteArrayFilter".Equals(f.GetType().Name))72 { %>88 else if ("NameEqualityComparisonByteArrayFilter".Equals(f.GetType().Name)) 89 { %> 73 90 <% NameEqualityComparisonByteArrayFilter filter = ((NameEqualityComparisonByteArrayFilter)f); %> 74 91 <%: Html.Label(filter.Label)%> 75 92 <%: Html.Label("not supported")%> 76 93 <% } 77 else if ("NameEqualityComparisonBoolFilter".Equals(f.GetType().Name))78 { %>94 else if ("NameEqualityComparisonBoolFilter".Equals(f.GetType().Name)) 95 { %> 79 96 <% NameEqualityComparisonBoolFilter filter = ((NameEqualityComparisonBoolFilter)f); %> 80 97 <%: 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))%> 82 99 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueDropDownList, new SelectList(((FilterModel)Model).BoolStates, filter.Value))%> 83 100 <% } 84 else if ("NameOrdinalComparisonIntFilter".Equals(f.GetType().Name))85 { %>101 else if ("NameOrdinalComparisonIntFilter".Equals(f.GetType().Name)) 102 { %> 86 103 <% NameOrdinalComparisonIntFilter filter = ((NameOrdinalComparisonIntFilter)f); %> 87 104 <%: Html.Label(filter.Label)%> … … 89 106 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 90 107 <% } 91 else if ("NameStringComparisonAvailableValuesFilter".Equals(f.GetType().Name))92 { %>108 else if ("NameStringComparisonAvailableValuesFilter".Equals(f.GetType().Name)) 109 { %> 93 110 <% NameStringComparisonAvailableValuesFilter filter = ((NameStringComparisonAvailableValuesFilter)f); %> 94 111 <%: 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))%> 96 113 <%: Html.DropDownList(f.Id + "." + FilterModel.ValueDropDownList, new SelectList(filter.AvailableValues, filter.Value))%> 97 114 <% } 98 else if ("NameOrdinalComparisonDoubleFilter".Equals(f.GetType().Name))99 { %>115 else if ("NameOrdinalComparisonDoubleFilter".Equals(f.GetType().Name)) 116 { %> 100 117 <% NameOrdinalComparisonDoubleFilter filter = ((NameOrdinalComparisonDoubleFilter)f); %> 101 118 <%: Html.Label(filter.Label)%> … … 103 120 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 104 121 <% } 105 else if ("NameOrdinalComparisonFloatFilter".Equals(f.GetType().Name))106 { %>122 else if ("NameOrdinalComparisonFloatFilter".Equals(f.GetType().Name)) 123 { %> 107 124 <% NameOrdinalComparisonFloatFilter filter = ((NameOrdinalComparisonFloatFilter)f); %> 108 125 <%: Html.Label(filter.Label)%> … … 110 127 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 111 128 <% } 112 else if ("NameOrdinalComparisonLongFilter".Equals(f.GetType().Name))113 { %>129 else if ("NameOrdinalComparisonLongFilter".Equals(f.GetType().Name)) 130 { %> 114 131 <% NameOrdinalComparisonLongFilter filter = ((NameOrdinalComparisonLongFilter)f); %> 115 132 <%: Html.Label(filter.Label)%> … … 117 134 <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, filter.Value)%> 118 135 <% } 119 else if ("OrdinalComparisonDateTimeFilter".Equals(f.GetType().Name))120 { %>136 else if ("OrdinalComparisonDateTimeFilter".Equals(f.GetType().Name)) 137 { %> 121 138 <% OrdinalComparisonDateTimeFilter filter = ((OrdinalComparisonDateTimeFilter)f); %> 122 139 <%: Html.Label(filter.Label)%> … … 126 143 127 144 %> 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%>');" /> 130 148 131 149 <% }%> 132 </td></tr> </table>150 </td></tr> 133 151 <% } %> 152 </table></td></tr> 134 153 <% }%> 135 154 <% }%> 136 <input type="submit" name="submitButton" value="or" /> 155 156 157 158 159 </table> <input type="button" name="submitButton" value="or" onClick="setAction('or','');" /> 137 160 </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.