This content has been marked as final.
Show 1 reply
-
1. Re: using Rendered and Rerender together
sergeysmirnov Mar 20, 2009 2:49 PM (in response to aish)Aish, it is not about a good or a bad practice, but about the specific of the JSF framework and its hidden limitations.
Actually, it seems for me that you mismatched two different aspects
1. golder rule that say do not point with re-rendered to the component that has rendered attribute
2. rules about using rendered attribute for the jsf command component (ajax or standard one - it does not mater)<a4j:commandLink value="first << " id="cButton2" action="#{process.first}" rendered="#{process.chkRecords}" />
This is a known JSF trap. To make the link visible, it is enough to have #{process.chkRecords} evaluated to true at the beginning of the 6th JSF lifecycle phase. However, to have the command component workable (i.e. when action listener and action method are invoked), you have to have the #{process.chkRecords} evaluated to true at the beginning of the 2nd next JSF lifecycle phase.
I.e. you might have a situation when the link is visible, but unworkable.
Actually, this problem has nothing to to with RichFaces. It comes from the core JSF.
BTW, you will face tht same problem even 'rendered located outside. Like:<h:panelGrid rendered="#{foo.bar}"> .... <h:commandLink /> ... </h:panelGrid>
If #{foo} is a request scope bean and #{foo.bar} is initiated with false, the link will not work even you set #{foo.bar} to true in your action method (on the 5th phase) in order to have it visible.