myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <>
Subject [jira] Commented: (MYFACES-2645) The view state is saved before encodeAll() is called on every UIViewParameter in an AJAX request
Date Wed, 07 Apr 2010 19:58:34 GMT


Leonardo Uribe commented on MYFACES-2645:

I don't believe that call encodeAll() on PartialViewContextImpl could be a good solution.
My question is does this works?

<h:commandButton value="ajax-button">
<f:ajax render="input output messages" execute="@this" />

At first view, there is something wrong with UIViewParameter. Why this method calls setSubmittedValue(getStringValue(context))?
Doesn't that supposed to be called on update model phase? If a view contains view parameter,
it should be executed the whole lifecycle, right? That code should work:

<h:commandButton value="ajax-button">
<f:ajax render="output messages" execute="input @this" />

I think the solution should be done different, so I suggest the code committed should be reverted

> The view state is saved before encodeAll() is called on every UIViewParameter in an AJAX
> ------------------------------------------------------------------------------------------------
>                 Key: MYFACES-2645
>                 URL:
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-3
>            Reporter: Jakob Korherr
>            Assignee: Jakob Korherr
>         Attachments: MYFACES-2645-spec-proposal.patch
> UIViewParameter calls setSubmittedValue() in encodeAll() to store the current value of
the view parameter in the state as the submitted value (this helps UIViewParameter to restore
its value on a postback). UIViewParameter.encodeAll() itself is called by UIViewRoot.encodeEnd()
for every UIViewParameter in the view.
> If the current request is an ajax-request, the view state is currently already generated
in UIViewRoot.encodeChildren() (before UIViewRoot.encodeEnd()). At this time the submitted
value for every UIViewParameter is null, because its encodeAll()-method was not called yet.
> Later, when UIViewRoot.encodeEnd() is called, UIViewParameter.encodeAll() is called and
it sets the submitted value correctly, but due to the fact that the state has already been
generated, these changes are dropped.
> This causes the value of every UIViewParameter to be set to null in the next request,
which will most likely end in validation problems with the required validator.
> The related thread to this issue from the mailing list can be found at:

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message