jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] Re: [220-ViewStateParamNameOnly] PROPOSAL

From: Neil Griffin <neil.griffin_at_portletfaces.org>
Date: Mon, 13 Feb 2012 13:21:04 -0500

Hi Ed,

Just wanted to follow-up on your question below. Correct, if you have multiple ViewRoots on a portal page, then the UIViewRoot for each of them will actually be an instance of PortletNamingContainerUIViewRoot, and therefore it is safe to ask it for getContainerClientId(). It is the portlet bridge's responsibility to make sure that the call to PortletNamingContainerUIViewRoot#getContainerClientId() returns a unique value for each portlet on the page.

Neil

On Feb 6, 2012, at 5:07 PM, Edward Burns wrote:

> NG> Agreed, all forms that are under the same ViewRoot will have the
> NG> same ViewState. But a portal page will contain a ViewRoot for each
> NG> JSF portlet, and so the value of the "javax.faces.ViewState" hidden
> NG> field will be different for each ViewRoot.
>
> I see. Thanks for clarifying so I can understand. But how can we
> ensure that all the ViewRoots are unique?
>
> Looking into the Portlet Bridge API, I see
> PortletNamingContainerUIViewRoot, which overrides
> getContainerClientId(). Neil, can you please confirm that if I have
> multiple ViewRoots in my portlet page, the UIViewRoot for each of them
> will actually be an instance of your PortletNamingContainerUIViewRoot,
> and therefore is safe to ask it for getContainerClientId()?