Issue Details (XML | Word | Printable)

Key: JAVASERVERFACES_SPEC_PUBLIC-795
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Jakob Korherr
Votes: 6
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
javaserverfaces-spec-public

UIViewParameter state saving algorithm

Created: 12/May/10 09:05 AM   Updated: 08/Nov/13 09:15 PM
Component/s: Components/Renderers
Affects Version/s: 2.0
Fix Version/s: 2.3

Time Tracking:
Not Specified

Environment:

Operating System: All
Platform: All


Issuezilla Id: 795
Status Whiteboard:

size_small importance_medium

Tags:
Participants: Ed Burns, Jakob Korherr, kithouna, nullone and rogerk


 Description  « Hide

From the mail "State saving of UIViewParameter" on jsr-314-open:

UIViewParameter uses the submittedValue to store its value in the state for the
next postback, because obviously the view parameter won't be in the request
parameter map of the next request (which is the postback). But because its
submittedValue is null after the conversions and validations, it has to be set
again before the state is generated. To accomplish that, the spec currently
states to override encodeAll() and make the call to setSubmittedValue() there.
In addition, encodeAll() has to be called in UIViewRoot.encodeEnd() for every
UIViewParameter in the view. This works perfectly for normal requests, but when
you are using an AJAX request the state is generated before
UIViewRoot.encodeEnd() is called an thus the submittedValue for every
UIViewParameter is null in the state. This means that the value of every
UIViewParameter will be null in the following request.

Now the easiest solution to this problem, which I also already committed to
MyFaces trunk (again see [1] for details), is to do mostly the same as in
UIViewRoot.encodeEnd() just also in PartialViewContext.
processPartial() when the PhaseId is RENDER_RESPONSE before the state is
generated to make it work for AJAX-requests.

However I don't really like this solution, because we have to think of handling
UIViewParameters in a special way every time we change something on any render
mechanism. Why don't we just override saveState() on UIViewParameter and set the
submittedValue there before the state is saved. This will have the same result,
but without the code in UIViewRoot, PartialViewContext and
UIViewParameter.encodeAll() and without future headaches. I also already
uploaded a patch for this to the MyFaces issue at [1].

Answer to this from Martin Marinschek: "This is just a so much better solution
. We should spec this one."

[1] https://issues.apache.org/jira/browse/MYFACES-2645



Ed Burns added a comment - 17/May/10 06:42 AM

Move to 2.1.

I agree with this approach.


Ed Burns added a comment - 08/Jun/10 01:16 PM

triage


Ed Burns added a comment - 22/Jun/10 09:04 PM

rogerk


rogerk added a comment - 27/Oct/10 02:17 PM

triage


rogerk added a comment - 16/Nov/10 12:55 PM

triage


kithouna added a comment - 28/Feb/13 09:48 AM

Was anything ever done for this one?


nullone added a comment - 28/Feb/13 08:18 PM

Myfaces team took 3 days to review and accept the fix, and Mojarra team could not do the same thing for more than 33 months, and still saw no light.

Is that really amazing or the team is sleeping on its way?