[forge-issues] [JBoss JIRA] (FORGE-2054) UIInput<Boolean> is always defaulted (making requiring it as an input impossible)

Daniel Cunha (JIRA) issues at jboss.org
Sat Nov 1 08:40:35 EDT 2014


    [ https://issues.jboss.org/browse/FORGE-2054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13016562#comment-13016562 ] 

Daniel Cunha commented on FORGE-2054:
-------------------------------------

That change can to break some addons.
If I remove the default value for Boolean, some addons will need to change the implementation.

We could have some NPEs when field not required. e.g: 
https://github.com/forge/core/blob/master/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/cdi/ui/NewBeanCommand.java#L95-L98

The change is simple, we need remove:
https://github.com/forge/core/blob/master/ui/impl/src/main/java/org/jboss/forge/addon/ui/impl/input/InputComponentProducer.java#L206-L207

Can I create a @Specializes class and change it? 
If Yes, maybe you can create a @Specializes and fixed your problem, but you can have problem with others addons in your Forge. I don't know if windup is a addon or Forge wrapper. I need learn more about it. I would like to test on windup, but I still not fix the build here.

I can't see other solution for now.

> UIInput<Boolean> is always defaulted (making requiring it as an input impossible)
> ---------------------------------------------------------------------------------
>
>                 Key: FORGE-2054
>                 URL: https://issues.jboss.org/browse/FORGE-2054
>             Project: Forge
>          Issue Type: Bug
>          Components: UI - Shell
>    Affects Versions: 2.10.1.Final
>            Reporter: Jess Sightler
>
> If you set a UIInput<Boolean> as follows:
> @WithAttributes(label = "fake", required = true, description = "just put something")
> It will never require the user to enter a value. This is because the default is "false" even though no default was specified and the field is labelled as required. This should support tri-state booleans, and it should be possible to have a required boolean.



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the forge-issues mailing list