Closed ren-zhijun-oracle closed 17 years ago
@javaserverfaces Commented Reported by malm@java.net
@javaserverfaces Commented youngm said: So Ryan doesn't have to search for it I believe this is a duplicate of Issue 439.
To work around this you can use a Session scoped beans for holding the data you need persisted between states or (my personal favorite all purpose fix) use a tool like Tomahawk saveState.
@javaserverfaces Commented malm@java.net said: Not sure if its really the same as issue 439. My 'gripe' is that the JSF implementation (re)evaluates the EL expression for the rendered attribute during the apply request values phase. There shouldn't be a need to do this. The EL expression in any rendered attribute should only be evaluted during the render response phase. If the JSF implementation needs to know which components were rendered when reconstructing the view it should save that information as part of the view state.
@javaserverfaces Commented jhook said: this is no different than any other mvc environment-- what if you used something like Struts or WebWork to publish a list of things to edit and then on postback, your list no longer exists or has been modified to be out of sync with the previous view? Making a case for 'rendered' is only a niche issue-- why not all of the bindings, values on the page-- what if we saved some and not others-- wouldn't this create even more confusion? Here's to having JSF go stateless in '07
http://weblogs.java.net/blog/jhook/archive/2006/01/experiment_goin_1.html
@javaserverfaces Commented adamwiner said: This is not a JSF impl issue - it's a spec issue. The implementation is behaving as designed, and the problem is in the deisgn.
@javaserverfaces Commented @rlubke said: As a follow up, I believe the workaround I've seen posted is to call setRendered() directly on the component instead of via expression and allow state saving to take care of the rest.
@javaserverfaces Commented @manfredriem said: Closing issue out
@javaserverfaces Commented Was assigned to javaserverfowner
@javaserverfaces Commented This issue was imported from java.net JIRA JAVASERVERFACES-474
@javaserverfaces Commented Marked as won't fix on Monday, May 14th 2007, 10:19:24 am
Many of my components have a rendered="..." attribute containing el expressions. I thought these expressions will be evaluated during the Render Response Phase when the actual output is rendered as that is what the attribute controls. I now noticed that these expressions are also evaluated during the Apply Request Values Phase (see stack trace fragment below). Is that expected behaviour? It causes me problems because the properties in those el expressions are coming from a request scoped bean and those properties are not correctly set at that point in time. I would have thought that the rendered state of a component would be saved in the View state and not recalculated in the early phases of the JSF life cycle.
Manuel
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192) at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:384) at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:981) at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:989) at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:989) at javax.faces.component.UIForm.processDecodes(UIForm.java:203) at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:989) at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:494) at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:101)
Environment
Operating System: All Platform: All
Affected Versions
[1.2_03]