private void addContraintExamples ( ) { add ( new WHeading ( HeadingLevel . H2 , "Date fields with input constraints" ) ) ; WFieldLayout layout = new WFieldLayout ( ) ; layout . setLabelWidth ( 33 ) ; add ( layout ) ; /* mandatory */ WDateField constrainedDateField = new WDateField ( ) ; constrainedDateField . setMandatory ( true ) ; layout . addField ( "Mandatory date field" , constrainedDateField ) ; /* min date */ constrainedDateField = new WDateField ( ) ; constrainedDateField . setMinDate ( new Date ( ) ) ; layout . addField ( "Minimum date today" , constrainedDateField ) ; /* max date */ constrainedDateField = new WDateField ( ) ; constrainedDateField . setMaxDate ( new Date ( ) ) ; layout . addField ( "Maximum date today" , constrainedDateField ) ; /* auto complete */ constrainedDateField = new WDateField ( ) ; constrainedDateField . setBirthdayAutocomplete ( ) ; layout . addField ( "With autocomplete hint" , constrainedDateField ) ; constrainedDateField = new WDateField ( ) ; constrainedDateField . setAutocompleteOff ( ) ; layout . addField ( "With autocomplete off" , constrainedDateField ) ; }
Add constraint example .