myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Winer" <awi...@gmail.com>
Subject Re: [Trinidad] PPR duplicating transient components
Date Fri, 06 Jul 2007 23:17:58 GMT
On 7/6/07, noah <iamnoah@gmail.com> wrote:
> On 7/6/07, Gary VanMatre <gvanmatre@comcast.net> wrote:
> >
> >
> > >From: noah <iamnoah@gmail.com>
> > >
> > > On 7/6/07, Gary VanMatre wrote:
> > > >
> > > > >From: noah
> > > > >
> > > > > Thought I'd post this before creating a JIRA issue, in case I've
> > > > > overlooked something. I just now produced this with 1.2.1 but I think
> > > > > I've seen it in 1.0.x before.
> > > > >
> > > > > In the following page, clicking the link correctly updates 'Foo='
to
> > > > > 'Foo=1' but it renders the paragraph twice. Clicking again updates
> > > > > -both- paragraphs to 'Foo=2' and adds a third. Click again for a
4th,
> > > > > and Foo=3, and so on.
> > > > >
> > > > > Using an h:outputText instead of inline EL keeps the text from being
> > > > > repeated, but additional paragraph elements are added with each click.
> > > > >
> > > > >
> > > >
> > >> ><tr:document xmlns="http://www.w3.org/1999/xhtml"
> > >> >   xmlns:ui="http://java.sun.com/jsf/facelets"
> > >> >   xmlns:f="http://java.sun.com/jsf/core"
> > >> >   xmlns:h="http://java.sun.com/jsf/html"
> > >> >   xmlns:tr="http://myfaces.apache.org/trinidad">
> > >> >  <tr:form>
> > >> >      <tr:panelHeader partialTriggers="foo">
> > >> >         <p>Foo=#{pageFlowScope.foo}</p>
> > &gt ;> >      </tr:panelHeader>
> > >> > & nbsp;& nbsp;   <tr:commandLink id="foo" partialSubmit="true"
text="Do
> > >> it!">
> > >> >         <f:setPropertyActionListener value="#{pageFlowScope.foo
+ 1}"
> > >> >target="#{pageFlowScope.foo}" />
> > >> >      </tr:commandLink>
> > >> >   </tr:form>
> > >> ></tr:document>
> > > >
> > > >
> > > >
> > > >
> > > > What happens if you use the output text with the transient attribute?
> > >
> > > No change, same behavior as transient="false". The paragraph tags
> > > still get repeated of course. I suppose I shouldn't say 'transient'
> > > but all HTML, inline text, and EL.
> > >
> >
> >
> >
> > Are you using client or server side state saving?
>
> Client.
>
> >
> > I'm not familiar with the specifics of Facelets but I believe that it is
> > creating its own jspid to simulate a "JspIdConsumer" and adds it to the
> > component's attributes.  This is how Clay currently works after a few tips
> > from Jacob.  When the component tree is restored, the components that are
> > marked transient fall out.  Transient components have to be recreated and
> > inserted into the component tree.  The "jspid" marker is used to map
> > existing components to the meta-data used to build the tree.
> >
> > It sounds like the markup nodes are not being set as transient by facelets
> > or maybe something in the state saving is not discarding the transient
> > components.
> >
> > Can you tell if the outputText components that contain the markup "<p>..."
> > are "transient=true"?
>
> I don't know how to do that.  I don't think Facelets uses actual
> h:outputText components though.
>
> > What happens if you switch state saving modes?
>
> No copies.
>
> But, the rest of my application blows up for some reason :)

So, which mode has the problem with copies getting
created?  If it's client-side state saving, what happens
if you set org.apache.myfaces.trinidad.CACHE_VIEW_ROOT
to false in web.xml?

And, does:

<h:outputText transient="true" escape="false"
   value="&lt;p&gt;#{pageFlowScope.foo}&lt;/p&gt;"/>

... dodge the issue?

-- Adam

Mime
View raw message