incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: Possible bug in tr:table sorting
Date Thu, 24 Aug 2006 06:34:11 GMT
OK, I'll file it in JIRA. Is the bug that transient components aren't  
being managed correctly by tr:table, or that Trinidad should be  
handling the situation better (e.g. by not running off the end of the  
array ;-)?

L.

On 23-Aug-06, at 6:14 PM, Adam Winer wrote:

> It's really a Trinidad bug, and it'd be great if a JIRA issue was  
> logged.
> Facelets is doing the right thing, and the table shouldn't be choking!
>
> The workaround, as Noah says, is using h:outputText or tr:outputText.
>
> -- Adam
>
>
> On 8/23/06, Sloan, Noah M <Noah_Sloan@baylor.edu> wrote:
>> I think that one is actually Facelets.  By just inlining the text,  
>> it is marked transient (according to Facelets) so on restore view  
>> (I think that's the phase, but I'm probably wrong) your panel  
>> group doesn't have as many elements in it, or something like  
>> that.  By using outputText, it sticks around.
>>
>> I had a similar problem using t:tree2 because one of my facets was  
>> just inline text and EL. Changing it to h:outputText fixed it.
>>
>> ________________________________
>>
>> From: Laurie Harper [mailto:laurie@holoweb.net]
>> Sent: Wed 23-Aug-06 1:09 AM
>> To: adffaces-user@incubator.apache.org
>> Subject: Possible bug in tr:table sorting
>>
>>
>>
>> I just tracked down the cause of an exception raised during sorting
>> of a tr:table component in my application, and it seems to be a
>> Trinidad bug. Here's the problem markup:
>>
>>              <tr:column noWrap="true">
>>                  <tr:panelGroupLayout><!-- FIXME: why do we need this
>> here? -->
>>                      <tr:commandLink action="edit" text="edit"
>> rendered="${not empty row.id}"/>
>>                      &#160;
>>                      <tr:commandLink action="edit" text="delete"
>> rendered="${not empty row.id}"/>
>>                      &#160;
>>                      <tr:commandLink action="edit" text="split"
>> rendered="${not empty row.id}"/>
>>                  </tr:panelGroupLayout>
>>              </tr:column>
>>
>> The tr:panelGroupLayout is there because otherwise each link is
>> wrapped in a <div> element (even if I set separateRows="false"; is
>> that correct??); the &#160; (non-breakig space) entities are there
>> because otherwise the links run into each other -- that may be a
>> function of Facelets' stripping of element-only whitespace.
>>
>> When I sort any column in the table, I get a nasty IndexOutOfBounds
>> exception. It turns out to be the non-breaking space entities; if I
>> change those to
>>
>>                      <tr:outputText value="&#160;"/>
>>
>> the exception goes away. Since (I think) Facelets turns template text
>> into UIText components, I'm not sure why the raw character entity is
>> a problem? Here's the root stack trace, in case it helps at all ;-)
>>
>> java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
>>          at java.util.ArrayList.RangeCheck(ArrayList.java:547)
>>          at java.util.ArrayList.get(ArrayList.java:322)
>>          at
>> org.apache.myfaces.trinidad.component.UIXCollection.restoreStampState
>> (UIXCollection.java:820)
>>          at
>> org.apache.myfaces.trinidad.component.UIXTable.restoreStampState
>> (UIXTable.java:320)
>>          at
>> org.apache.myfaces.trinidad.component.StampState.restoreChildStampSta 
>> te(
>> StampState.java:152)
>>          at
>> org.apache.myfaces.trinidad.component.UIXTable.restoreStampState
>> (UIXTable.java:317)
>>          at
>> org.apache.myfaces.trinidad.component.UIXCollection._restoreStampStat 
>> e
>> (UIXCollection.java:1094)
>>          at
>> org.apache.myfaces.trinidad.component.UIXCollection.postRowDataChange
>> (UIXCollection.java:712)
>>          at
>> org.apache.myfaces.trinidad.component.UIXCollection.setRowIndex
>> (UIXCollection.java:405)
>>          at
>> org.apache.myfaces.trinidad.component.UIXTable._processStamps
>> (UIXTable.java:391)
>>          at
>> org.apache.myfaces.trinidad.component.UIXTable.processFacetsAndChildr 
>> en(
>> UIXTable.java:265)
>>          at
>> org.apache.myfaces.trinidad.component.UIXCollection.decodeChildrenImp 
>> l
>> (UIXCollection.java:155)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren
>> (UIXComponentBase.java:874)
>>          at
>> org.apache.myfaces.trinidad.component.UIXCollection.processDecodes
>> (UIXCollection.java:149)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren 
>> Imp
>> l(UIXComponentBase.java:890)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren
>> (UIXComponentBase.java:874)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes
>> (UIXComponentBase.java:725)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren 
>> Imp
>> l(UIXComponentBase.java:890)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren
>> (UIXComponentBase.java:874)
>>          at
>> org.apache.myfaces.trinidad.component.UIXForm.processDecodes
>> (UIXForm.java:60)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren 
>> Imp
>> l(UIXComponentBase.java:890)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren
>> (UIXComponentBase.java:874)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes
>> (UIXComponentBase.java:725)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren 
>> Imp
>> l(UIXComponentBase.java:890)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.decodeChildren
>> (UIXComponentBase.java:874)
>>          at
>> org.apache.myfaces.trinidad.component.UIXComponentBase.processDecodes
>> (UIXComponentBase.java:725)
>>          at javax.faces.component.UIComponentBase.processDecodes
>> (UIComponentBase.java:397)
>>          at javax.faces.component.UIViewRoot.processDecodes
>> (UIViewRoot.java:131)
>>          at
>> org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues
>> (LifecycleImpl.java:200)
>>          at org.apache.myfaces.lifecycle.LifecycleImpl.execute
>> (LifecycleImpl.java:71)
>>          at javax.faces.webapp.FacesServlet.service 
>> (FacesServlet.java:
>> 106)
>>          at org.mortbay.jetty.servlet.ServletHolder.handle
>> (ServletHolder.java:442)
>>          at org.mortbay.jetty.servlet.ServletHandler
>> $CachedChain.doFilter(ServletHandler.java:1051)
>>          at
>> com.foo.projility.web.auth.UserAuthenticationFilter.doFilter
>> (UserAuthenticationFilter.java:80)
>>          at org.mortbay.jetty.servlet.ServletHandler
>> $CachedChain.doFilter(ServletHandler.java:1042)
>>          at
>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.do 
>> Fil
>> terInternal(OpenSessionInViewFilter.java:174)
>>          at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter
>> (OncePerRequestFilter.java:76)
>>          at org.mortbay.jetty.servlet.ServletHandler
>> $CachedChain.doFilter(ServletHandler.java:1042)
>>          at org.apache.shale.faces.ShaleApplicationFilter.doFilter
>> (ShaleApplicationFilter.java:271)
>>          at org.mortbay.jetty.servlet.ServletHandler
>> $CachedChain.doFilter(ServletHandler.java:1042)
>>          at
>> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invoke 
>> DoF
>> ilter(TrinidadFilterImpl.java:327)
>>          at
>> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilt 
>> erI
>> mpl(TrinidadFilterImpl.java:291)
>>          at
>> org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilte 
>> r
>> (TrinidadFilterImpl.java:214)
>>          at  
>> org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter
>> (TrinidadFilter.java:90)
>>          at org.mortbay.jetty.servlet.ServletHandler
>> $CachedChain.doFilter(ServletHandler.java:1042)
>>          at org.mortbay.jetty.servlet.ServletHandler.handle
>> (ServletHandler.java:355)
>>          at org.mortbay.jetty.servlet.SessionHandler.handle
>> (SessionHandler.java:226)
>>          at org.mortbay.jetty.handler.ContextHandler.handle
>> (ContextHandler.java:615)
>>          at org.mortbay.jetty.handler.ContextHandlerCollection.handle
>> (ContextHandlerCollection.java:150)
>>          at org.mortbay.jetty.handler.HandlerCollection.handle
>> (HandlerCollection.java:123)
>>          at org.mortbay.jetty.handler.HandlerWrapper.handle
>> (HandlerWrapper.java:141)
>>          at org.mortbay.jetty.Server.handle(Server.java:272)
>>          at org.mortbay.jetty.HttpConnection.handlerRequest
>> (HttpConnection.java:396)
>>          at org.mortbay.jetty.HttpConnection$RequestHandler.content
>> (HttpConnection.java:666)
>>          at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java: 
>> 613)
>>          at org.mortbay.jetty.HttpParser.parseAvailable
>> (HttpParser.java:198)
>>          at org.mortbay.jetty.HttpConnection.handle
>> (HttpConnection.java:311)
>>          at org.mortbay.jetty.nio.HttpChannelEndPoint.run
>> (HttpChannelEndPoint.java:270)
>>          at org.mortbay.thread.BoundedThreadPool$PoolThread.run
>> (BoundedThreadPool.java:475)
>>
>> --
>> Laurie Harper
>> Open Source advocate, Java geek: http://www.holoweb.net/laurie
>> Founder, Zotech Software: http://www.zotechsoftware.com/
>>
>>
>>
>>
>>
>>
>>

--
Laurie Harper
Open Source advocate, Java geek: http://www.holoweb.net/laurie
Founder, Zotech Software: http://www.zotechsoftware.com/




Mime
View raw message