1 Reply Latest reply on Jul 29, 2008 4:11 PM by bek816

    Duplicate Component Id Exception while trying to implement t

      - My Environment.
      JSF 1.1 on WAS 6.x

      Iam trying to implement tree component in my jsf application , when I use the tree in different jsp . it is working fine :
      JSP snippet:

      <body>
      <div id="wrap">
      <f:view>
      <h:form id="mytree">
      <rich:tree id="library" style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
      <rich:treeNode id="myfolder" type="myfolder">
      <h:outputText value="#{item.name}" />
      </rich:treeNode>
      <rich:treeNode id="artefacttype" type="artefacttype">
      <h:outputText value="#{item.title}" />
      </rich:treeNode>
      <rich:treeNode id="artefact" type="artefact">
      <h:outputText value="#{item.title}" />
      </rich:treeNode>
      </rich:tree>
      </h:form>

      </f:view>
      <div id="footer"><span class="footer"> <a
      href="/workbench/global/legal.html" target="_blank" class="footerlink">legal</a>
      </span></div>
      </div>
      </body>


      However when I try to embed the tree component in another jsp :
      JSP snippet:
      <body>
      <div id="wrap"><f:view>
      <f:subview id="menu">
      <jsp:include page="/search/incld/menu.incl.jsp" />
      </f:subview>

      <a4j:form ajaxSubmit="true" id="mytree">
      <rich:tree id="library" style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}" immediate="true">
      <rich:treeNode id="myfolder" type="myfolder">
      <h:outputText value="#{item.name}" />
      </rich:treeNode>
      <rich:treeNode id="artefacttype" type="artefacttype">
      <h:outputText value="#{item.title}" />
      </rich:treeNode>
      <rich:treeNode id="artefact" type="artefact">
      <h:outputText value="#{item.title}" />
      </rich:treeNode>
      </rich:tree>
      </a4j:form>


      <h:messages layout="table" infoClass="okStatusText" errorClass="errorMsgText"/>
      <h:form id="workspace">

      <h:panelGrid id="workspacegrid" border="0" columns="3"
      columnClasses="queryColumn,setColumn,scenarioColumn" rules="all"
      style="border:1px dotted grey;">

      <h:panelGroup>
      <f:verbatim>
      <div style="overflow-x: scroll; overflow-y: scroll; height: 400px;">
      </f:verbatim>
      <h:dataTable value="#{workSpaceBean.queryList}" var="searchquery"
      id="workspacequery" binding="#{workSpaceBean.queryData}"
      border="0" headerClass="columnHeader" width="100%">
      <f:facet name="header">
      <h:outputText value="Queries (#{workSpaceBean.queryListSize})"/>
      </f:facet>
      <h:column>
      <h:commandLink value="#{searchquery.name}"
      action="#{workSpaceBean.populateQuery}" styleClass="ulink"
      rendered="#{searchquery.userId == userid }">
      </h:commandLink>
      <h:commandLink value="#{searchquery.name}"
      action="#{workSpaceBean.populateQuery}" styleClass="olink"
      rendered="#{searchquery.userId != userid}">
      </h:commandLink>
      </h:column>
      </h:dataTable>
      <f:verbatim></div>
      </f:verbatim>
      </h:panelGroup>
      <h:panelGroup>
      <f:verbatim>
      <div style="overflow-x: scroll; overflow-y: scroll; height: 400px;">
      </f:verbatim>
      <h:dataTable value="#{workSpaceBean.setList}" var="set"
      id="workspacesets" binding="#{workSpaceBean.setData}" border="0" headerClass="columnHeader" width="100%">
      <f:facet name="header">
      <h:outputText value="Sets (#{workSpaceBean.setListSize})"/>
      </f:facet>
      <h:column>
      <h:commandLink value="#{set.name}"
      action="#{workSpaceBean.viewSearchResults}" styleClass="ulink"
      rendered="#{set.userId == userid}">
      </h:commandLink>
      <h:commandLink value="#{set.name}"
      action="#{workSpaceBean.viewSearchResults}" styleClass="olink"
      rendered="#{set.userId != userid}">
      </h:commandLink>
      </h:column>
      </h:dataTable>
      <f:verbatim>
      </div>
      </f:verbatim>
      </h:panelGroup>
      <h:panelGroup>
      <f:verbatim>
      <div style="overflow-x: scroll; overflow-y: scroll; height: 400px;">
      </f:verbatim>
      <h:dataTable value="#{workSpaceBean.scenarioList}" var="scenario"
      id="workspacescenarios" binding="#{workSpaceBean.scenarioData}"
      border="0" headerClass="columnHeader" width="100%">
      <f:facet name="header">
      <h:outputText value="Scenarios (#{workSpaceBean.scenarioListSize})"/>
      </f:facet>
      <h:column>
      <h:commandLink value="#{scenario.name}"
      action="#{workSpaceBean.viewScenario}" styleClass="ulink"
      rendered="#{scenario.userId == userid}">
      </h:commandLink>
      <h:commandLink value="#{scenario.name}"
      action="#{workSpaceBean.viewScenario}" styleClass="olink"
      rendered="#{scenario.userId != userid}">
      </h:commandLink>
      </h:column>
      </h:dataTable>
      <f:verbatim>
      </div>
      </f:verbatim>
      </h:panelGroup>

      </h:panelGrid>
      <h:commandButton action="#{workSpaceBean.viewMyFolder}" value="Create MyFolder"></h:commandButton>
      <h:commandButton action="#{library.viewMyTree}" value="View Myfolders"></h:commandButton>
      </h:form>


      I get the following error :


      java.lang.IllegalStateException: Duplicate component ID 'workspace:workspacequery:_id28' found in view.
      at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:189)
      at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:179)
      at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:179)
      at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:179)
      at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:179)
      at com.sun.faces.application.StateManagerImpl.saveSerializedView(StateManagerImpl.java:86)
      at org.ajax4jsf.framework.ajax.AjaxStateManager.saveSerializedView(AjaxStateManager.java:90)
      at com.sun.faces.taglib.jsf_core.ViewTag.doAfterBody(ViewTag.java:170)
      at com.ibm._jsp._workspace._jspx_meth_f_view_0(_workspace.java:1346)
      at com.ibm._jsp._workspace._jspService(_workspace.java:115)
      at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
      at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:205)
      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:321)
      at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:325)
      at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:255)
      at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)


      Iam getting this when I try to access the folder structure of the tree component. I think the rest of the page is also getting rendered, for an ajax call from my tree. you can see from the jsp I have unique id's for each of the jsf and rich faces components.

      Any help will be appreciated.


        • 1. Re: Duplicate Component Id Exception while trying to impleme
          bek816

          Wow, we just posted the same issue a few minutes apart. We use JSP includes to insert fragments into other jsps and have encountered all sorts of duplicate id exceptions. As I mentioned in my post, we only encountered these problems when we started using RichFaces. It seems to me that this is a major flaw in the 3.1.x branch of RichFaces.