[
https://issues.apache.org/jira/browse/MYFACES-3983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14936107#comment-14936107
]
Mike Kienenberger commented on MYFACES-3983:
--------------------------------------------
Sorry I didn't notice this issue earlier, but there's actually a much similar
solution that works for all versions of JSF with no changes to the JSF
implementation.
When binding a jsf component to a bean (rather than creating a component from a
bean), have the getter return null. I've used this solution for JSF 1.1
through JSF 2.1.
ie,
<h:inputHidden binding="#{bean.inputHidden}" />
public class Bean {
private UIInput inputHidden;
private AItem item;
public UIInput getInputHidden() { return null; }
public setInputHidden(UIInput inputHidden){
this.inputHidden = inputHidden;
if(item != null){
this.inputHidden.setValue(item);
}
}
}
> ViewScopeBinding does not work, results in an exception when using a datatable
> ------------------------------------------------------------------------------
>
> Key: MYFACES-3983
> URL: https://issues.apache.org/jira/browse/MYFACES-3983
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-344
> Affects Versions: 2.2.7
> Reporter: Anup
> Assignee: Leonardo Uribe
> Priority: Minor
> Fix For: 2.2.9
>
> Attachments: ViewScopeTest.war
>
>
> Install the ViewScopeTest which was created from the following stack over
> flow posting:
> http://stackoverflow.com/questions/2797231/why-does-postconstruct-callback-fire-every-time-even-though-bean-is-viewscoped
> Drive a request to /ViewScopeTest/ViewScopeBinding.jsf
> and click on one of the buttons.
> The following error occurs:
> Exception thrown by application class
> 'javax.faces.webapp.FacesServlet.service:230'
> javax.servlet.ServletException:
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:230)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285)
> at [internal classes]
>
> Caused by: java.lang.NullPointerException:
> at
> org.apache.myfaces.view.facelets.compiler.CheckDuplicateIdFaceletUtils.createAndQueueException(CheckDuplicateIdFaceletUtils.java:139)
> ... 1 more
> This works fine on server with Mojarra
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)