9 Replies Latest reply on Feb 19, 2007 6:38 PM by henrik lindberg

    duplicate id error using ICE data paginator - need help

    henrik lindberg Apprentice

      I have a problem with getting duplicate id error messages when trying to use an ice data paginator. I know that this is probably not caused by seam, but I am hoping that somone has come across this or something similar and can give me some hints.


      I get the following error:

      
       java.lang.IllegalStateException: Client-id : _id45last is duplicated in the faces tree. Component : _id35:_id36:_id45last, path: {Component-Path : [Class: javax
       .faces.component.UIViewRoot,ViewId: /settings.xhtml][Class: com.icesoft.faces.component.UIXhtmlComponent,Id: _id1][Class: com.icesoft.faces.component.UIXhtmlCom
       ponent,Id: _id10][Class: com.icesoft.faces.component.UIXhtmlComponent,Id: _id24][Class: javax.faces.component.html.HtmlPanelGroup,Id: _id34][Class: com.icesoft.
       faces.component.ext.HtmlForm,Id: _id35][Class: com.icesoft.faces.component.paneltabset.PanelTabSet,Id: _id36][Class: com.icesoft.faces.component.paneltabset.Pan
       elTab,Id: _id37][Class: com.icesoft.faces.component.UIXhtmlComponent,Id: _id44][Class: com.icesoft.faces.component.datapaginator.DataPaginator,Id: _id45][Class:
       com.icesoft.faces.component.ext.HtmlCommandLink,Id: _id45last]}
      


      when I try to use a dataPaginator that looks like this:
       <ice:dataPaginator for="space_list"
       paginator="true" fastStep="3" paginatorMaxPages="12">
       <f:facet name="first" >
       <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-first.gif" style="border:none;" title="First Page" />
       </f:facet>
       <f:facet name="xprevious">
       <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-previous.gif" style="border:none;" title="Previous Page" />
       </f:facet>
       <f:facet name="xnext">
       <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-next.gif" style="border:none;" title="Next Page" />
       </f:facet>
       <f:facet name="last" >
       <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-last.gif" style="border:none;" title="Last Page" />
       </f:facet>
       </ice:dataPaginator>
      
      



      Note that I called two facets with a leading "x" to exclude them. If I also exclude the "last" facet - I do not get an error and the code works.
      In fact, after trying some configurations I believe that the error occurs when adding a second facet to the dataPaginator - it does not matter in which order I add "first" "last" etc. the second facet will be reported as having a duplicate id.

      I am using seam 1.1.6 and ICEFaces 1.5.3 - if that makes a difference.

      Greatful for any hints.

      Will post the entire facelet in a separate post.


        • 1. Re: duplicate id error using ICE data paginator - need help
          henrik lindberg Apprentice

          Here is the full facelet xhtml:

          <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <ui:composition xmlns="http://www.w3.org/1999/xhtml"
           xmlns:s="http://jboss.com/products/seam/taglib"
           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:ice="http://www.icesoft.com/icefaces/component"
           template="layout/template.xhtml">
          
           <ui:define name="title">Cloudsmith - User Settings</ui:define>
           <ui:define name="bannerHeading">Settings</ui:define>
           <ui:define name="body">
           <h:panelGroup rendered="#{not identity.loggedIn}">
           <ui:include src="/layout/error_NotLoggedIn.xhtml" />
           </h:panelGroup>
           <h:panelGroup rendered="#{identity.loggedIn}">
           <f:view>
           <h:form>
           <ice:panelTabSet>
           <ice:panelTab label="Spaces">
           <ice:dataTable id="space_list" value="#{availableSpaces}" var="p"
           rendered="#{availableSpaces != null and availableSpaces.rowCount > 0}"
           rowClasses="first,second" columnClasses="col1class,col2class"
           rows="5">
           <ice:column>
           <f:facet name="header">Space Name</f:facet>
           <ice:outputText value="#{p.spaceName}" />
           </ice:column>
           <ice:column>
           <f:facet name="header">Added date</f:facet>
           <ice:outputText value="#{p.dateAdded}" />
           </ice:column>
           </ice:dataTable>
           <ice:dataPaginator for="space_list"
           paginator="true" fastStep="3" paginatorMaxPages="12">
           <f:facet name="xlast">
           <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-last.gif" style="border:none;" title="Last Page" />
           </f:facet>
           <f:facet name="xfirst">
           <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-first.gif" style="border:none;" title="First Page" />
           </f:facet>
           <f:facet name="xprevious">
           <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-previous.gif" style="border:none;" title="Previous Page" />
           </f:facet>
           <f:facet name="xnext">
           <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-next.gif" style="border:none;" title="Next Page" />
           </f:facet>
           </ice:dataPaginator>
          <ice:dataPaginator id="scroll_2"
           for="space_list"
           rowsCountVar="rowsCount"
           displayedRowsCountVar="displayedRowsCountVar"
           firstRowIndexVar="firstRowIndex"
           lastRowIndexVar="lastRowIndex"
           pageCountVar="pageCount"
           pageIndexVar="pageIndex"
           >
          
           <ice:outputFormat value="{0} spaces found, displaying {1} spaces, from {2} to {3}. Page {4} / {5}" styleClass="standard" >
           <f:param value="#{rowsCount}" />
           <f:param value="#{displayedRowsCountVar}" />
           <f:param value="#{firstRowIndex}" />
           <f:param value="#{lastRowIndex}" />
           <f:param value="#{pageIndex}" />
           <f:param value="#{pageCount}" />
           </ice:outputFormat>
          
           </ice:dataPaginator>
           <div id="pubBox">
           <h:form id="pubForm">
           <s:validateAll>
           <ice:panelGrid columns="1">
           <ice:outputLabel for="spaceInput">Wanted Space Name:</ice:outputLabel>
           <div><b>public.</b><ice:inputText id="spaceInput"
           value="#{userSpaces.spaceInput}" required="true"
           maxlength="93" style="width:350px;" /></div>
           <ice:commandButton type="submit" value="Add Space"
           action="#{userSpaces.addSpace}" />
           <ice:message for="spaceInput" />
           </ice:panelGrid>
           <ice:messages globalOnly="true" />
           </s:validateAll>
           </h:form>
           </div>
           </ice:panelTab>
           <ice:panelTab label="Account">
           <table class="formTable" border="0">
           <col class="labelCol" />
           <col class="inputCol" />
           <s:validateAll>
           <tr>
           <td><h:outputLabel for="login">Username (login):</h:outputLabel></td>
           <td><h:inputText id="login" value="#{currentUser.login}"
           required="true" /></td>
           </tr>
           <tr>
           <td><h:outputLabel for="realName">Real Name:</h:outputLabel></td>
           <td><h:inputText id="realName"
           value="#{currentUser.realName}" required="true" /></td>
           </tr>
           <tr>
           <td><h:outputLabel for="password">Password:</h:outputLabel></td>
           <td><h:inputSecret id="password"
           value="#{currentUser.password}" required="true"
           redisplay="true" /></td>
           </tr>
           <tr>
           <td><h:outputLabel for="verify">Verify Password:</h:outputLabel></td>
           <td><h:inputSecret id="verify" value="#{settings.verify}"
           required="true" redisplay="true" /></td>
           </tr>
          
           <tr>
           <td><h:outputLabel for="email">Email:</h:outputLabel></td>
           <td><h:inputText id="email" value="#{currentUser.email}"
           required="true" /></td>
           </tr>
           </s:validateAll>
           </table>
           <h:messages />
           <h:commandButton type="submit" value="Save"
           action="#{settings.updateSettings}" />
           </ice:panelTab>
          
           </ice:panelTabSet>
           </h:form>
           </f:view>
           </h:panelGroup>
           </ui:define>
          </ui:composition>
          
          


          Hope someone can point me to what I am doing wrong, and that it is some naiive beginners mistake...

          Cheers.

          • 2. Re: duplicate id error using ICE data paginator - need help
            Tony Herstell Master

            This works for my page.
            See if adding in the other parameters kicks it into life.
            Have you psoted this on the icefaces forum ( they were really helpful to us Seamies.. gone a bit quiet now as hopefully they are getting a new release out for us :) )

            <ice:dataPaginator id="organisationsTablePaginatorComponentIcons"
             for="organisationsTableComponent"
             fastStep="10"
             pageCountVar="pageCount"
             pageIndexVar="pageIndex"
             paginator="true"
             paginatorMaxPages="9">
            
             <f:facet name="first" >
             <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-first.gif" style="border:none;"/>
             </f:facet>
            
             <f:facet name="last">
             <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-last.gif" style="border:none;" />
             </f:facet>
            
             <f:facet name="previous">
             <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-previous.gif" style="border:none;" />
             </f:facet>
            
             <f:facet name="next">
             <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-next.gif" style="border:none;" />
             </f:facet>
            
             <f:facet name="fastforward">
             <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-ff.gif" style="border:none;" />
             </f:facet>
            
             <f:facet name="fastrewind">
             <ice:graphicImage url="./xmlhttp/css/xp/css-images/arrow-fr.gif" style="border:none;" />
             </f:facet>
            
             </ice:dataPaginator>
            
            


            • 3. Re: duplicate id error using ICE data paginator - need help
              henrik lindberg Apprentice

              Thanks for the tip - I will add the additional attributes on the dataPaginator that is giving me trouble and see what happens.

              And, yes - I have posted this issue on the ICEFaces forum too - (no comments so far).

              Will post here when I make some progress....

              • 4. Re: duplicate id error using ICE data paginator - need help
                henrik lindberg Apprentice

                I added the two missing variables, and I still get the same error :-(

                I also have some other issues in this form because of the nested form. Being new to this I don't quite know how to handle the subform.


                When I remove all facets except one I get behaviour that is ok - I can add things to the list displayed by typing in the box below and press "AddSpace"

                It is when I hit the "Add Space" when I get errors (using more than one facet).

                Any suggestions?

                • 5. Re: duplicate id error using ICE data paginator - need help
                  henrik lindberg Apprentice

                  I have also tried to simplify the facelet - i.e. just the dataTable and the paginator (no, tabs, no form on tab 2 etc. Still having the same problem.

                  • 6. Re: duplicate id error using ICE data paginator - need help
                    henrik lindberg Apprentice

                    I am really stuck on this issue - maybe I am doing something wrong in the bean?

                    Greatful for any feedback:

                    @Stateful
                    @Scope(CONVERSATION)
                    @Name("userSpaces")
                    @TransactionAttribute(REQUIRED)
                    public class UserSpacesAction implements UserSpacesLocal, Serializable
                    {
                    
                     private static final long serialVersionUID = -3722438832731142648L;
                    
                     @PersistenceContext
                     private EntityManager em;
                    
                     @In("currentUser")
                     private User m_currentUser;
                    
                     private String m_spaceInput;
                    
                     @SuppressWarnings("unused")
                     @DataModel("availableSpaces")
                     private List<PublishingSpace> m_availableSpaces;
                    
                     @SuppressWarnings("unused")
                     @DataModelSelection
                     @Out(required = false)
                     private PublishingSpace selectedSpace;
                    
                     @Logger
                     private Log log;
                    
                     @SuppressWarnings("unchecked")
                     @Factory("availableSpaces")
                     public void getAvailableSpaces()
                     {
                     log.debug("Get User space for user #0", m_currentUser.getLogin());
                    
                     m_availableSpaces = em.createQuery(
                     "SELECT DISTINCT s.publishingSpace FROM SpaceAccess s WHERE s.theUser = :user").setParameter("user",
                     m_currentUser).getResultList();
                    
                     log.debug("Got a List back empty=#0", Boolean.valueOf(m_availableSpaces.isEmpty()));
                     }
                    
                     public String addSpace()
                     {
                     // create the full "public.xxx" name and check that it is a
                     // valid space name
                     //
                     String tmpSpace = "public."+m_spaceInput;
                     if(!SpaceNameValidator.isSpaceNameValid(tmpSpace))
                     {
                     FacesMessages.instance().add("spaceInput", "Invalid space name");
                     return "error-space-add-invalid-name";
                     }
                     // Check if space exists
                     //
                     if(PublishingSpace.exists(em, tmpSpace))
                     {
                     FacesMessages.instance().add("spaceInput", "Space name already taken - use something else.");
                     return "error-space-add-exists";
                     }
                    
                     // Add objects
                     //
                     log.debug("Adding space for public.#0", m_spaceInput);
                     PublishingSpace p = new PublishingSpace("public."+m_spaceInput);
                     p.setDateAdded(new Date());
                     SpaceAccess sa = new SpaceAccess(m_currentUser,p, Boolean.TRUE);
                     em.persist(p);
                     em.persist(sa);
                     log.info("Added space #0 for user #1", p.getSpaceName(), m_currentUser.getLogin());
                     getAvailableSpaces();
                     // Clear this value for new input
                     m_spaceInput = "";
                     return "ok-space-saved";
                     }
                    
                     public void setSpaceInput(String space)
                     {
                     m_spaceInput = space;
                     }
                    
                     public String getSpaceInput()
                     {
                     return m_spaceInput;
                     }
                    
                     @Destroy
                     @Remove
                     public void destroy()
                     {
                     }
                    }
                    


                    • 7. Re: duplicate id error using ICE data paginator - need help
                      henrik lindberg Apprentice

                      I used to return "null" from addSpace on all outcomes, but added strings to see if that made any difference - - - it didn't.

                      • 8. Re: duplicate id error using ICE data paginator - need help
                        Gregory Nikle Apprentice

                        Hi Henry!
                        I got same error using facelets, seam and PaneltabSet...
                        When i start app, everythink works fine and after couple of minutes using app i got info about duplicate id's and my tabs fall down!

                        Seam links works still fine but all icefaces components not.
                        Previously had modal info with "User session is expired" but now instead of that i have this.

                        those f.... iceFaces is getting me more frustrate than Tomahawk:P


                        • 9. Re: duplicate id error using ICE data paginator - need help
                          henrik lindberg Apprentice

                          I have written a small sample that triggers the problem and attached them to a new issue in Jira. http://jira.jboss.org/jira/browse/JBSEAM-884?watch=true

                          for ICEFaces integration.