[
https://issues.apache.org/jira/browse/WICKET-6449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16126072#comment-16126072
]
Kamil edited comment on WICKET-6449 at 8/14/17 6:01 PM:
--------------------------------------------------------
[~svenmeier], [~mgrigorov]
When you have dropdown with setRequired(true) and you select empty value - you
say that calling onError [is
fine|https://issues.apache.org/jira/browse/WICKET-6403?focusedCommentId=16055931&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16055931]
I understood this, I'm fine with this and I found this reasonable. But now with
exactly same situation:
Having checkbox with setRequired(true) and you uncheck it -> you say that
onError [is wrong|https://issues.apache.org/jira/browse/WICKET-1221]
how is this consistent?!
Why would someone call setRequired(true) on checkbox if it has no effect?
Currently:
* I want chceckbox to be not required -> It is now whether you
setRequired(true) or setRequired(false)
* I want chceckbox to be required -> It can't be
But if we make it consistent with "onError" behavior we can have win-win:
* I want chceckbox to be not required -> I setRequired(false) and I have
behavior I desire - exactly like today
* I want chceckbox to be required -> I setRequired(true) and listen to "onError"
was (Author: eximius):
[~svenmeier], [~mgrigorov]
When you have dropdown with setRequired(true) and you select empty value - you
say that calling onError [is
fine|https://issues.apache.org/jira/browse/WICKET-6403?focusedCommentId=16056113&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16056113]
I understood this, I'm fine with this and I found this reasonable. But now with
exactly same situation:
Having checkbox with setRequired(true) and you uncheck it -> you say that
onError [is wrong|https://issues.apache.org/jira/browse/WICKET-1221]
how is this consistent?!
Why would someone call setRequired(true) on checkbox if it has no effect?
Currently:
* I want chceckbox to be not required -> It is now
* I want chceckbox to be required -> It can't be
But if we make it consistent with "onError" behavior we can have win-win:
* I want chceckbox to be not required -> I setRequired(false) and I have
behavior I desire - exactly like today
* I want chceckbox to be required -> I setRequired(true) and listen to "onError"
> Form should raise validation error when required checkbox is not set
> --------------------------------------------------------------------
>
> Key: WICKET-6449
> URL: https://issues.apache.org/jira/browse/WICKET-6449
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 8.0.0-M6
> Reporter: Kamil
> Assignee: Sven Meier
> Attachments: showcase-requiredCheckbox.zip
>
>
> Every user before he registers must agree to terms&conditions, thus proper
> checkbox is required to check and validation error should be raised when
> required checkbox is not checked.
> This test case shows incorrect behavior
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)