myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott O'Bryan <>
Subject Re: [trinidad] Why <input type="hidden" name="javax.faces.ViewState" ... does not render its id?
Date Fri, 13 Jun 2008 18:16:26 GMT
Yeah, this is a complex issue.  And trinidad doesn't do it right 
either.  Here is what I was going to do for Trinidad (in my copious 
amounts of spare time).  :)

Each Portlet would have a root element.  When a form is submitted via 
ppr, the view state for each "javax.faces.ViewState" under that root 
element would be changed.  As for servlet environments, if no root dom 
element is set up (ie. when used in a non-portlet environment), then it 
would just replace all the ViewStates under the document element.


Leonardo Uribe wrote:
> Hi
> myfaces portlet bridge + myfaces 1.2.3 using jetty and pluto (using 
> the portlet archetype) render this as ViewState param:
> <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="ImubpcgkK/otI292kHnd8m............
> I ignore what happens when use multiple jsf portlets in the same page, 
> or when the page is using multiple forms on the same page (normal 
> submits should work on both environmets, but ajaxified components?).
> I will take a look in deep about this, at this point the idea of use a 
> getElementsByName to send the view state in ajax calls is the most 
> compatible to apply in tomahawk.
> regards
> Leonardo Uribe
> On Thu, Jun 12, 2008 at 10:20 AM, Mario Ivankovits < 
> <>> wrote:
>     Hi!
>             And also ensure that every ViewState will be replaced and
>             not only the
>             first [0] one.
>             When you do have multiple JSF forms (which is valid) each
>             ViewState
>             needs to be replaced.
>         Yes, but only when they came from the same view!
>         I don't know much about JSF "portal bridge" stuff. Can this
>         result in a
>         page contains a form that was rendered via JSF from host A, and a
>         different form that was rendered via JSF from host B?
>     I'd say yes. You might be right.
>     Don't know much about protlets either, but, I guess one solution
>     can be to replace only those ViewState fields with the same value
>     as the one associated with the form the component is embedded in.
>     Lets speak code:
>     var enclosingForm = findEnclosingForm(theComponent);
>     var oldViewState = enclosingForm["ViewState"].value;
>     for (form : forms)
>     {
>           if (form["ViewState"].value == oldViewState)
>           {
>                form["ViewState"].value = newViewState;
>           }
>     }
>     Or do any portlet have its own namespace reflected into the
>     element id?
>     Then this could be checked too, though, this will be a portlet
>     specific solution then.
>     Ciao,
>     Mario

View raw message