[ https://issues.apache.org/jira/browse/TOMAHAWK-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13697876#comment-13697876 ]
Leonardo Uribe commented on TOMAHAWK-1664: ------------------------------------------ I think the bean definition: @ManagedBean public class MyBean { doesn't have the scope defined. The effect is the bean is created each time a reference is done and because than the binding becomes null. Try set the bean to @RequestScope . That will do the trick. I don't see any problem here, so I think we can close it as invalid or not a problem. > t:selectBooleanCheckbox / Binding is not working after Mojarra update > --------------------------------------------------------------------- > > Key: TOMAHAWK-1664 > URL: https://issues.apache.org/jira/browse/TOMAHAWK-1664 > Project: MyFaces Tomahawk > Issue Type: Bug > Affects Versions: 1.1.13, 1.1.14 > Environment: GlassFish Server Open Source Edition 3.1.2.2 (build 5) > - Windows 7 (64 Bit) & Oracle Java jdk1.7.0_15 (64 Bit) > - Oracle Linux Server release 5.5 & OpenJDK 64-Bit Server VM (build > 1.6.0-b09, mixed mode) > - Mojarra v2.1.23 > - org.apache.myfaces.tomahawk:tomahawk20:1.1.13 > - org.apache.myfaces.tomahawk:tomahawk20:1.1.14 > - org.apache.myfaces.tomahawk:tomahawk21:1.1.14 > Reporter: Michael D. > > After updating Mojarra from v2.1.6 to v2.1.23 I'm facing the issue, that the > binding of t:selectBooleanCheckbox is not working. > JSF snippet: > --- SNIP --- > <t:selectBooleanCheckbox > id="myId" > forceId="true" > value="#{myBean.myValue}" > binding="#{myBean.myBinding}" > styleClass="myClass"/> > <h:inputText > id="anotherId" > value="#{myBean.anotherValue}" > validator="#{myBean.validate}" > requiredMessage="#{msg['required']}" > maxlength="100"/> > --- SNAP ---- > Java snippet: > --- SNIP --- > @ManagedBean > public class MyBean { > private UIInput myBinding; > private boolean myValue; > private String anotherValue; > // ... > public UIInput getMyBinding() { return myBinding; } > public void setMyBinding(UIInput myBinding) { this.myBinding = myBinding; > } > public boolean isMyValue() { return myValue; } > public void setMyValue(boolean myValue) { this.myValue = myValue; } > public String getAnotherValue() { return anotherValue; } > public void setAnotherValue(String anotherValue) { this.anotherValue = > anotherValue; } > public void validate(FacesContext ctx, UIComponent comp, Object value) > throws ValidatorException { > if ((HtmlSelectBooleanCheckbox) myBinding.isSelected()) { // > <--------------- myBinding is null > // ... > } > } > } > --- SNAP --- > > I did debug: > 1. Opening page > a) getMyBinding is called > b) setMyBinding is called with valid instance > 2. Submit form > a) No call of getMyBinding/setMyBinding > b) validate is called ---> myBinding is null!!!! > If I replace "t:selectBooleanCheckbox" by "h:selectBooleanCheckbox": > 1. Opening page > a) getMyBinding is called > b) setMyBinding is called with valid instance > 2. Submit form > a) setMyBinding is called with valid instance > b) validate is called ---> myBinding is valid > 3. Next page is displayed -- 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