We should still look at this a bit
So nullValid sort of means will i generate a string with "null" key and the
default: "CHOOSE_ONE"
if not then an empty one is generated, but that can only be generated if the
modelObject == null
or when it is not Required?

Because what you said: the first available choice is selected is very wrong
Because that is not the case and it that shouldn't happen..
Because else the webpage views information that is not the same that is in
the model...

johan


On 4/10/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:

On 4/9/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:
> All form components now have a method 'setRequired'. This tells
> whether the component must have a value != null (or empty string) or
> not. The DDC has a set of methods that deal with the same stuff:
>  - isNullValid() / setNullValid(boolean nullValid)
>
> This can be replaced with 'isRequired/setRequired'. Any objections to
> deprecating them, replacing the contents with "return !isRequired();"
> and "setRequired(!nullValid)", and making them final?

I just rolled back the change and improved the javadocs a bit.

Though at first sight it looks like the nullValid and required
booleans are about the same things, they aren't really. The required
boolean says whether setting a null value on the model is permitted,
whereas nullValid says whether the null option (typically displayed as
'choose one') is displayed or whether the first available choice is
displayed in case there is no current selection.

The name can be improved though. I think is/setNullValid doesn't
communicate very clearly what it does.

Eelco

Reply via email to