I vote for 2, checkbox needs always to satisfy the required requirement. As
pointed, there are no parameter in the HTTP request reader for false inputs,
we can't distinguish 'false' from 'null', so we can't consider that user
isn't meeting the required condition.

On Fri, Apr 1, 2011 at 2:34 PM, James Carman <ja...@carmanconsulting.com>wrote:

> This has been discussed before
> (https://issues.apache.org/jira/browse/WICKET-1221), but I can't find
> the old vote thread to see what folks think.  The problem is that a
> checkbox is a weird bird when it comes to HTTP.  If it's unchecked, it
> doesn't send a value which makes Wicket think you haven't provided a
> value for that input field.  Right now, if you call setRequired(true)
> on a CheckBox, it's going to require the user to actually check the
> box.  What do folks think the desired behavior should be?
>
> 1.  The current approach is correct, requiring a checkbox means
> requiring that it be checked.
>
> 2.  A checkbox shouldn't be able to be required.  You can't *not*
> provide a value (it's binary) for a checkbox, so therefore it always
> should satisfy the required requirement.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

Reply via email to