You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (JIRA)" <ji...@apache.org> on 2013/06/10 13:28:19 UTC

[jira] [Commented] (ISIS-431) A boolean atribute should never be mandatory

    [ https://issues.apache.org/jira/browse/ISIS-431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13679442#comment-13679442 ] 

Dan Haywood commented on ISIS-431:
----------------------------------

The workaround is to declare the type as Boolean, annotate @Optional, and use (val != null && val.booleanValue()) to determine if true:

void foo(@Optional Boolean flag) {
    setFoo(flag !=null && flag.booleanValue());
}
                
> A boolean atribute should never be mandatory
> --------------------------------------------
>
>                 Key: ISIS-431
>                 URL: https://issues.apache.org/jira/browse/ISIS-431
>             Project: Isis
>          Issue Type: Bug
>          Components: Viewer: Wicket
>    Affects Versions: viewer-wicket-2.0.0
>            Reporter: Jeroen van der Wal
>            Assignee: Dan Haywood
>            Priority: Minor
>
> A boolean attribute only has two states and when the @Optional annotation is omitted and the boolean is set to false, eg the checkbox is empty, it's impossible to save the object.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira