From: Anthony E. <me...@an...> - 2002-05-20 17:24:21
|
I am currently working on how FormProc handles empty fields. I have defined empty fields as either being null or being an empty String. Currently FormProc handles empty fields in the following manner: If there is a default value specified in the Form configuration, use that If there is no default value then the FormData.getValue() returns either null or an empty String If validation succeeds and the value is the empty String it is converted and stored If validation succeeds and the value is null, then conversion and storage are skipped The issue at hand is that a null value may actually be a valid argument. For example it might be important for a null value to be stored into the target object (i.e. a field which originally had a value is now empty and thus the target object should be updated to reflect that). However, if null values are passed to converters, then each converter must be able to handle null values. In addition, converters may also want to handle empty Strings as well. So, as I see it we have two options: - Leave things the way they are now. - Allow null values to be passed to converters and storers and expect them to handle null values. Comments and suggestions are welcome. Sincerely, Anthony Eden |