ill just change the values, tkz so much for the replys.
Togabo is nice.

On 1/23/07, Volker Weber <[EMAIL PROTECTED]> wrote:

the function Tobago.replaceJsfState() is defined in

http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?view=markup

in tobago the hidden fields jsf_tree and jsf_viewid are inside a div
with a defined id and the content is just replaced. You may need to
parse the generated jsfState and just replace the values.

Regards,
  Volker


2007/1/23, Paulo Cesar Silva Reis <[EMAIL PROTECTED]>:
> I saw the code, now i hav more questions:
>
> 1) U dont change the field jsf_sequence in client? Because in next
request,
> myfaces will restore the previous view.
> 2) Why do u need this?
>  contentWriter.startElement
> (HtmlConstants.SCRIPT, null);
>  contentWriter.writeAttribute(HtmlAttributes.TYPE, "text/javascript",
null
> );
>  contentWriter.write("Tobago.replaceJsfState(\"");
> contentWriter.write(StringUtils.replace(StringUtils.replace(
jsfState.toString(),
> "\"", "\\\""), "\n", ""));
>
>  contentWriter.write("\");");
>  contentWriter.endElement(HtmlConstants.SCRIPT);
>
>
> I cant understand what this script do.
>
> Tkz in advance.
>
>
> On 1/23/07, Volker Weber <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > to save the state you can do:
> >
> > StateManager stateManager
> >      = facesContext.getApplication().getStateManager();
> > StateManager.SerializedView serializedView
> >     =  stateManager.saveSerializedView(facesContext);
> > stateManager.writeState(facesContext, serializedView);
> >
> > but this may not be enough, you need also to update the state in the
> > hidden fileds on the client. You may take a look into the sources of
> > tobagos AjaxPhaseListener [1] how to do this.
> >
> > Regards,
> >    Volker
> >
> > [1]
>
http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java?view=markup
> >
> >
> >
> >
> >
> >
> >
> > 2007/1/23, Paulo Cesar Silva Reis <[EMAIL PROTECTED]>:
> > > Hi my name is Paul, im new on this list.
> > > I have a problem. When i finish the lifecycle in phse BEFORE Render
> Response
> > > (using context.responseComplete()), its seem myfaces dont save the
> modified
> > > view, so in the next request myfaces restore the old view.
> > > What i can do to save the view before exiting?!
> > >
> > > Tkz in advance.
> > >
> > > --
> > > Paulo Cesar Silva Reis
> > > -------------------------------
> > > Powered by GMAIL
> >
>
>
>
> --
>
> Paulo Cesar Silva Reis
> -------------------------------
> Powered by GMAIL




--
Paulo Cesar Silva Reis
-------------------------------
Powered by GMAIL

Reply via email to