Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/24/11 17:35:29 (13 years ago)
Author:
cfleisch
Message:

#1499 added test to validate StringComparisonFilter in view Filters

Location:
branches/WebApplication/MVC2/HLWebOKBQueryPlugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/ViewModels/FilterModel.cs

    r6247 r6268  
    66using HLWebOKBQueryPlugin.Helpers;
    77using HLWebOKBQueryPlugin.ViewModels;
     8using System.ComponentModel.DataAnnotations;
    89
    910namespace HLWebOKBQueryPlugin.Models
     
    2526        public static string ComparisonDropDownList { get { return "comparisonDropDownList"; } }
    2627
     28        [Required(ErrorMessage = "Field is required!")]
     29        [StringLength(50, ErrorMessage = "Maximum 50 characters allowed!")]
     30        public string IntValue { get; set; }
     31
    2732        /// <summary>
    2833        /// Constructor
     
    200205                                {
    201206                                    ((StringComparisonFilter)f).Value = kvp.Value;
     207                                    IntValue = kvp.Value;
    202208                                }
    203209                                else if (kvp.Key.Equals(FilterModel.ComparisonDropDownList))
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Filter/Filters.ascx

    r6247 r6268  
    33<%@ Import Namespace="HLWebOKBQueryPlugin.OKBQueryService" %>
    44<%@ Import Namespace="HLWebOKBQueryPlugin.ViewModels" %>
     5
     6
     7<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
     8<script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
     9
     10<% Html.EnableClientValidation(); %>
    511
    612<!-- Put all into a form that calls the "AddFilter" Action-->
     
    4652    <%: Html.DropDownList(f.Id + "." + FilterModel.ComparisonDropDownList, new SelectList(FilterModel.StringComparisons, "Value", "Text",(int)filter.Comparison))%>   
    4753    <%: Html.TextBox(f.Id + "." + FilterModel.ValueTextbox, (filter.Value))%>
     54    <%: Html.TextBoxFor(model => ((FilterModel)Model).IntValue, (filter.Value)) %>
     55    <%: Html.ValidationMessageFor(model => ((FilterModel)Model).IntValue) %>
    4856    <% }
    4957else if ("NameStringComparisonFilter".Equals(f.GetType().Name))
Note: See TracChangeset for help on using the changeset viewer.