[jsr-314-open-mirror] [jsr-314-open] javax.faces.ViewState + ppr case

Werner Punz werner.punz at gmail.com
Wed May 5 09:02:03 EDT 2010


Hello I am asking this because this because I user ran into this issue by
using a dom modifying javascript widget and tried to press it through
jsf.ajax.request.
(aka a typical dialog widget)


The issue is that there is a usecase where you try to execute a ppr within
one form
and then try to render another form.

aka:

<h:form id="form1">

... jsf.ajax.request(this, event, {execute:"form1 form2", render:"form2"});
</h:form>


<h:form id="form2">
</form2>

The main issue here is that after the request a javax.faces.ViewState
element is issued in the ppr cycle. Now the spec says:

If an update element is found in the response with the identifier
javax.faces.ViewState:

<update id="javax.faces.ViewState">
   <![CDATA[...]]>
</update>

locate and update the submitting form's javax.faces.ViewState value with the
CDATA contents from the response.

Now this works coherently with a single form usecase because the viewstate
is issued on the submitting element.
The main problem is, both implementations in this special case have another
behavior.

if the form2 is rendered there is no viewstate element in the udate
id="form2" but after that the viewState element is issued,
now however myfaces swallows it entirely for form2 because of this spec
entry, mojarra updates it only if render:"form2"
but if for instance
<h:panelGroup id="outerFormGroup">
<h:form id="form2">
</form2>
</h:panelGroup>

and render:"outerFormGroup" then it is swallowed as well.

I assume now following, since the viewState is viewRoot related, should´t we
simply update all form elements over the entire page with the new viewState
content and simply add this field for form elements where the viewState
control is not present?
The other solution would be to update all forms where an execute and rendere
happend or at least a rendere happend inside (or as parent node of the form)

Werner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20100505/bdfc49e4/attachment-0002.html 


More information about the jsr-314-open-mirror mailing list