myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvanma...@comcast.net (Gary VanMatre)
Subject Re: [Trinidad] PPR duplicating transient components
Date Fri, 06 Jul 2007 23:53:23 GMT

>From: noah <iamnoah@gmail.com> 
>
> On 7/6/07, Gary VanMatre wrote: 
> > 
> > 
> > >From: noah 
> > > 
> > > 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. 
> 

I've not tried this but I was poking around in the RI source and saw a handy utility class.
You might try something like the following from a callback event or from a bound component's
getter?
String buff = com.sun.faces.util.DebugUtil.printTree(FacesContext.getCurrentInstance().getViewRoot());
Maybe a phase listener would work for debuging but the best place to hack into this would
be in the ViewHandler's "restoreView" method.
I'd also ask on the Facelets mailing list.  They might have a debug option to view the tree.

> > What happens if you switch state saving modes? 
> 
> No copies. 
> 
> But, the rest of my application blows up for some reason :) 
> 
> > 
> > 
> > 
> > 
> > > > 
> > > > 
> > > > 
> > > > That would simulate a "verbatim" component that facelets should be using

> > for 
> > > > inline markup. 
> > > > 
> > > > 
> > > > > 
> > > > > Environment: Facelets 1.1.12 + RI 1.2_04-p02 
> > > > 
> > > > 
> > > > 
> > > > Gary 
Mime
View raw message