Hi @ all,

I'm currently working on the JBoss Portal where i have one portlet in which i want to use the dataScroller from tomahawk. I have real looks great sometimes, but the most time I'm getting one exception (duplicated ids in the faces tree - original part of the exception is at the end of the mail). I have already tried to declare fix ids, but it doesn't matter.

my environment:
JBoss AS 4.0.4.GA
JBoss Portal 2.4
JDK 1.5.0_08
MyFaces 1.1.5-SNAPSHOT
Tomahawk 1.1.5-SNAPSHOT

Any advice would be helpful ...

Thanks,
Stefan

//ManagedBean
public class DummyBean {

   public Collection<String> getDummyEntries(){
       return generateDummyEntries("dummy", 50);
   }
public Collection<String> getOtherDummyEntries(){
       return generateDummyEntries("other", 100);
   }
private Collection<String> generateDummyEntries(String prefix, int amount){
       Collection<String> col = new Vector<String>();
for(int i=0; i<amount; i++){
           col.add(prefix+"_"+i);
       }
return col;
   }
}

//JSF Page
<%@ page contentType="text/html" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t"%>

<f:view>
   <h:form>
       <h:panelGrid columns="2">
           <t:dataTable id="dummy" rows="10"
               value="#{dummyBean.dummyEntries}" var="dummyEntry"
               preserveDataModel="true">
               <t:column>
                   <f:facet name="header">
                       <t:commandSortHeader columnName="name">
                           <h:outputText value="Dummy" />
                       </t:commandSortHeader>
                   </f:facet>
                   <h:outputText value="#{dummyEntry}"/>
               </t:column>
           </t:dataTable>
           <t:dataTable id="otherDummy" rows="10"
               value="#{dummyBean.otherDummyEntries}" var="oDummyEntry"
               preserveDataModel="true">
               <t:column>
                   <f:facet name="header">
                       <h:outputText
                           value="Other Dummies" />
                   </f:facet>
                   <h:outputText value="#{oDummyEntry}"/>
               </t:column>
           </t:dataTable>
           <t:dataScroller for="dummy" fastStep="10"
               pageCountVar="pageCount" pageIndexVar="pageIndex"
               styleClass="scroller" paginator="true" paginatorMaxPages="9"
               paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;" immediate="true">
               <f:facet name="first">
                   <t:graphicImage url="/images/arrow-first.gif" border="1"
                       alt="first" />
               </f:facet>
               <f:facet name="last">
<t:graphicImage url="/images/arrow-last.gif" border="1" alt="last" />
               </f:facet>
               <f:facet name="previous">
<t:graphicImage url="/images/arrow-previous.gif" border="1"
                       alt="prev" />
               </f:facet>
               <f:facet name="next">
<t:graphicImage url="/images/arrow-next.gif" border="1" alt="next" />
               </f:facet>
               <f:facet name="fastforward">
                   <t:graphicImage url="/images/arrow-ff.gif" border="1"
                       alt="fastforward" />
               </f:facet>
               <f:facet name="fastrewind">
                   <t:graphicImage url="/images/arrow-fr.gif" border="1"
                       alt="fastrewind" />
               </f:facet>
           </t:dataScroller>
           <t:dataScroller for="otherDummy" fastStep="10"
               pageCountVar="pageCount" pageIndexVar="pageIndex"
               styleClass="scroller" paginator="true" paginatorMaxPages="9"
               paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;" immediate="true">
               <f:facet name="first">
                   <t:graphicImage url="/images/arrow-first.gif" border="1"
                       alt="first" />
               </f:facet>
               <f:facet name="last">
<t:graphicImage url="/images/arrow-last.gif" border="1" alt="last" />
               </f:facet>
               <f:facet name="previous">
<t:graphicImage url="/images/arrow-previous.gif" border="1"
                       alt="prev" />
               </f:facet>
               <f:facet name="next">
<t:graphicImage url="/images/arrow-next.gif" border="1" alt="next" />
               </f:facet>
               <f:facet name="fastforward">
                   <t:graphicImage url="/images/arrow-ff.gif" border="1"
                       alt="fastforward" />
               </f:facet>
               <f:facet name="fastrewind">
                   <t:graphicImage url="/images/arrow-fr.gif" border="1"
                       alt="fastrewind" />
               </f:facet>
           </t:dataScroller>
       </h:panelGrid>
   </h:form>
</f:view>


//Exception
org.apache.jasper.JasperException: Client-id : _idJsp9jbp4fc96645first is duplicated in the faces tree. Component : _idJsp0jbp4fc96645:_idJsp9jbp4fc96645first, path: {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /WEB-INF/jsp/dataScrollerTest.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp0jbp4fc96645][Class: javax.faces.component.html.HtmlPanelGrid,Id: _idJsp1jbp4fc96645][Class: org.apache.myfaces.custom.datascroller.HtmlDataScroller,Id: _idJsp9jbp4fc96645][Class: javax.faces.component.html.HtmlCommandLink,Id: _idJsp9jbp4fc96645first]} at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.portal.portlet.impl.jsr168.PortletRequestDispatcherImpl.execute(PortletRequestDispatcherImpl.java:87)
   at sun.reflect.GeneratedMethodAccessor345.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.portal.server.servlet.CommandFilter.doFilter(CommandFilter.java:65) 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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)

Reply via email to