click-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Highway" <chhigh...@gmail.com>
Subject Re: [clickclick] new BooleanSelect field
Date Sun, 19 Oct 2008 20:24:45 GMT
Hi, I'll answer your previous message in a minute... :-)

2008/10/19 Bob Schellink <sabob1@gmail.com>:
> I've noticed you left a comment about Select accessing value directly
> instead of using setValue. Are you referring to Select#bindRequestValue?
>
> I think this should be changed to invoke setValue.
>

Yes, as a form.post can be faked, I thought it best to check the value
again on getting and not only on setting.

If the overridden setValue() method is used, the check on getValue()
would not be needed as no illegal value could be entered.

The only advantage of the way it is done now is that no exception is
thrown on illegal value through bindRequestValue, only logged as these
are not normally to be expected, and only will happen runtime.
Exceptions are only thrown on the setters which will mostly happen
during developtime because the developer passed an illegal value.
(well I think so)

Cheers
Christopher.

PS: the underlying (super) method does use setValue();

PPS: IntegerField does not override setValue / getValue, it only makes
certain get/setInteger are valid (and returns null on illegal value).
 -- Maybe I'm being too paranoid...
maybe I should also leave the set/get value alone. If you want
certainty about the content you can use get/setBoolean -
get/setInteger.

Mime
View raw message