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

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

From: Edward Burns <edward.burns_at_oracle.com>
Date: Tue, 7 Feb 2012 06:31:29 -0800

>>>>> On Tue, 7 Feb 2012 00:10:01 +0100, Imre Oßwald <ioss_at_pmx.jevelopers.com> said:

IO> I just copied the revised proposal for reference, see the previous
IO> post for context.

Now it's starting to look suspiciously like viewState should be
encoded/decoded just like a component. I wonder why we didn't do it
that way eight years ago?

EB> * Change the contract for the Ajax XML response to require that the
EB> <partial-response> element now have an "id" attribute whose value is
EB> the return from UIViewRoot.getContainerClientId()

IO> The problem with this proposal, is that we would have the same id
IO> again for multiple forms on one page.

Quatsch. You're right.

It seems we have two problems here, really.

1. XML correctness of the ViewState hidden field

2. Use of the ViewState hidden field in multi-form and portlet
scenarios.

Ted's proposal, currently implemented, solves 2. Here is my addition to
it that does solve 1. I'll reword it in the context of the spec, but
this rendering of the idea is just for email.

Let "ViewState Markup" refer to any markup that renders the ViewState.
Currently there are two ocurrences of this: the hidden field, and the
<update> element in the Ajax XML response with the ViewState.

For any part of the spec that defines the rendering requirements of the
ViewState Markup, make it so the "id" attribute of that markup conforms
to this contract.

UIViewRoot.getContainerClientId() +
UINamingContainer.getSeparatorChar() +
"javax.faces.ViewState" +
UIViewRoot.createUniqueId()

I'll have to further update some of the spec and impl for jsf.js
accordingly.

How's that?

Ed

-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/