[ 
https://issues.apache.org/jira/browse/WICKET-1221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556469#action_12556469
 ] 

Kent Tong commented on WICKET-1221:
-----------------------------------

I think "required" means that a value must be provided. For a check box, if it 
is checked, it has a value of true. if it is unchecked, it has a value of 
false. Treating "required" as "having a value of true" doesn't sound correct to 
me.

If you consider the error message that should be used, for the case of 
forcing the user to check the box, it should say "you must check xxx", which
is quite different from the error message for "required": "you must provide
xxx".

For the former use case, I think an IsChecked validator should be used, which
can provide a much better default error message.

> setRequired(true) will force a Checkbox to be checked
> -----------------------------------------------------
>
>                 Key: WICKET-1221
>                 URL: https://issues.apache.org/jira/browse/WICKET-1221
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.3.0-beta4
>            Reporter: Kent Tong
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.3.1
>
>
> If you call setRequired(true) on a Checkbox, then if the user clear the 
> checkbox, it will be treated as an error. Suggest overriding checkRequired() 
> in the Checkbox class to always return true.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to