webtier@glassfish.java.net

Re: [webtier] Jsf 2 : partial state saving breaks conditional ui:include

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Mon, 07 Dec 2009 09:20:09 -0800

On 12/5/09 1:02 PM, webtier_at_javadesktop.org wrote:
> Hi,
>
> I found out that it's impossible to rerender conditional ui:include in case if partial state saving feature was turned on.
> Code example:
>
> <h:commandLink>
> <f:ajax render="out" listener="#{bean.changeCondition}"/>
> </h:commandLink>
>
> <h:panelGroup id="out" ...>
> <ui:include src="#{bean.condition ? 'page1.xhtml' : 'page2.xhtml'}" />
> </h:panelGroup>
>
> Actual behavior: included page is changed with 1 request delay and does not consist to actual server condition value.
> It happens because Facelets creates components tree on the first phase in case of partial state saving.
> Is it possible to apply any workaround to fire it?
>
As a workaround, add:

<context-param>
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
<param-value>false</param-value>
</context-param>
> Thanks in advance.
> [Message sent by forum member 'amarkavtsov' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=374944
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>