From: Anthony E. <me...@an...> - 2002-06-03 15:21:50
|
> -----Original Message----- > From: for...@li... > [mailto:for...@li...]On Behalf Of Ken > Keller > Sent: Sunday, June 02, 2002 7:17 PM > To: Anthony Eden; FormProc Developer List > Subject: [FormProc-developer] optional fields > > > > 1.) If field empty, return true as valid > > 2.) If field not empty, validate using assigned validators > > > > If that is the case, then you would have to put that logic in the > > validator (i.e. in a regular expression validator you would have to > > account for empty values). Perhaps it would be useful to be able to tag > > a field as optional? > > I think so. I don't want the converter to run on an empty field either. I have checked in changes to the CVS which implement an "optional" flag on a FormElement. If the element is optional then validation, conversion and storing will be skipped. Check out the example application to see examples of the optional flag. > > I also think it would be nice to have these ValidationResultMap methods: > > String getOriginalValue(name): Should only return null if name doesn't > exist. > Object getConvertedValue(name): Can return null. > Object getConvertedOrOriginalValue(name): Return the original value if > invalid--otherwise the converted one. > String [] getGroupErrorMessages() > String getErrorOrMessage(name): Return the message if valid--otherwise the > error msg. > > Instead of having to deal with two ValidationResultMaps, it would be nice to > have a wrapper object. Right. I will look into adding these methods. -Anthony |