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

Martin Marinschek mmarinschek at apache.org
Wed May 5 09:08:52 EDT 2010


Hi Werner,

I agree with you - a new view-state should lead to an update of this
state in all forms - not only the submitting one. The view-state
covers the state for the full _view_ and not the one of one _form_ -
everything needs to be updated - or submits from other forms will not
be possible anymore!

best regards,

Martin

On 5/5/10, Werner Punz <werner.punz at gmail.com> wrote:
> 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
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces




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