[
https://issues.apache.org/jira/browse/TOMAHAWK-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13697903#comment-13697903
]
Leonardo Uribe commented on TOMAHAWK-1664:
------------------------------------------
I think if there is a problem, the one who blame is Mojarra. Tomahawk
implementation of t:selectBooleanCheckbox is just a normal component. There are
no special TagHandler implementations or anything strange that could cause a
problem.
The first thing to do is verify if the instance of MyBean does not change at
each request with a debugger (just look the instance number, it should be the
same for the entire request). When there is a submit, a new request is created,
but it is responsibility of facelets algorithm to restore the bindings
properly, using PostRestoreStateEvent. t:selectBooleanCheckbox don't override
processEvent() method so the call will be processed in the parent class (
UIComponent ).
Anyway, if there is a problem in Mojarra, there is no possible hack to do in
Tomahawk to make it work.
> 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