incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From noah <iamn...@gmail.com>
Subject Re: tr:table detailStamp containing HTML before UIData - PPR error showing details
Date Thu, 22 Mar 2007 20:53:25 GMT
The patch below *seems* to fix the problem.  I don't fully understand
what is going on there, but it makes my example and the page where I
originally had the problem work as I would expect, so it *might* be
right :)

I created ADFFACES-424 and attached the patch:
https://issues.apache.org/jira/browse/ADFFACES-424

Patch:

Index: trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
===================================================================
--- trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
(revision 521031)
+++ trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
(working copy)
@@ -862,7 +862,7 @@
     List<UIComponent> children = stamp.getChildren();
     Object[] childStateArray = (Object[]) state[2];
     int childIndex = 0;
-    for(int i=0; i<childStateArray.length; i++)
+    for(int i=0; i<childStateArray.length && childIndex < children.size();
i++)
     {
       Object childState = childStateArray[i];
       // Skip over any saved state that corresponds to transient


On 3/21/07, noah <iamnoah@gmail.com> wrote:
> I'm trying to use a UIData inside the detailStamp of a tr:table.  The
> detail stamp also contains HTML (using Facelets).  When I click on
> 'Show', nothing changes and catalina.out show a PPR error (trace
> below). I get the error with ui:repeat, t:dataList and tr:iterator.
>
> Example page:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <tr:document xmlns:ui="http://java.sun.com/jsf/facelets"
>    xmlns:f="http://java.sun.com/jsf/core"
>    xmlns:t="http://myfaces.apache.org/tomahawk"
>    xmlns:c="http://java.sun.com/jstl/core"
>    xmlns:h="http://java.sun.com/jsf/html"
>    xmlns:tr="http://myfaces.apache.org/trinidad">
>       <h:form>
>          <tr:table value="#{fooBean.foo}" var="foo">
>
>            <tr:column headerText="value">
>              <h:outputText value="#{foo}"/>
>            </tr:column>
>
>            <f:facet name="detailStamp">
>               <h:panelGroup>
>                   <div>
>                      <t:dataList var="bar" value="#{fooBean.foo}">
>                         <h:outputText value="#{bar}"/><br/>
>                      </t:dataList>
>                   </div>
>               </h:panelGroup>
>            </f:facet>
>          </tr:table>
>       </h:form>
> </tr:document>
>
> If I remove the UIData, no problem. If I remove the surrounding div
> (or other markup), no problem. Markup after the UIData is fine.  It
> only seems to occur when I have a UIData following HTML.  Non-UIData
> components also seem to work just fine.
>
> fooBean.foo is an ArrayList<String>
>
> Stack Trace from logs:
>
> Mar 21, 2007 3:56:48 PM
> org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer
> encodeAll
> SEVERE: Error during partial-page rendering
> java.lang.IndexOutOfBoundsException: Index: 0
>         at java.util.Collections$EmptyList.get(Collections.java:2970)
>         at org.apache.myfaces.trinidad.component.UIXCollection.restoreStampState(UIXCollection.java:873)
>         at org.apache.myfaces.trinidad.component.UIXTable.restoreStampState(UIXTable.java:338)
>         at org.apache.myfaces.trinidad.component.UIXCollection.restoreStampState(UIXCollection.java:873)
>         at org.apache.myfaces.trinidad.component.UIXTable.restoreStampState(UIXTable.java:338)
>         at org.apache.myfaces.trinidad.component.UIXCollection._restoreStampState(UIXCollection.java:1188)
>         at org.apache.myfaces.trinidad.component.UIXCollection.postRowDataChange(UIXCollection.java:741)
>         at org.apache.myfaces.trinidad.component.UIXCollection.setRowIndex(UIXCollection.java:439)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.table.TableUtils$RowLoop.loop(TableUtils.java:103)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.table.TableUtils$RowLoop.run(TableUtils.java:76)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.desktop.DesktopTableRenderer._renderTableRows(DesktopTableRenderer.java:903)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.desktop.DesktopTableRenderer.renderTableRows(DesktopTableRenderer.java:637)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.desktop.DesktopTableRenderer.renderTableContent(DesktopTableRenderer.java:363)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.TableRenderer.encodeAll(TableRenderer.java:282)
>         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:184)
>         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:704)
>         at org.apache.myfaces.trinidad.component.UIXCollection.encodeEnd(UIXCollection.java:525)
>         at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:417)
>         at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:398)
>         at org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:78)
>         at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
>         at org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChild(RendererUtils.java:417)
>         at org.apache.myfaces.custom.tabbedpane.HtmlTabbedPaneRenderer.writeTabsContents(HtmlTabbedPaneRenderer.java:550)
>         at org.apache.myfaces.custom.tabbedpane.HtmlTabbedPaneRenderer.encodeEnd(HtmlTabbedPaneRenderer.java:232)
>         at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
>         at org.apache.myfaces.trinidad.render.RenderUtils.encodeRecursive(RenderUtils.java:70)
>         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:258)
>         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:280)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:73)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:137)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:108)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:79)
>         at org.apache.myfaces.trinidad.render.CoreRenderer.delegateRenderer(CoreRenderer.java:297)
>         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.DocumentRenderer.encodeAll(DocumentRenderer.java:81)
>         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:184)
>         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:704)
>         at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
>         at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
>         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
>         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:182)
>         at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
>         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
>         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
>         at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:210)
>         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:167)
>         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:140)
>         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:93)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
>         at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
>         at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
>         at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:216)
>         at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:195)
>         at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>         at java.lang.Thread.run(Thread.java:619)
>

Mime
View raw message