3 Replies Latest reply on Jun 5, 2008 11:01 AM by rajesha Indurthi

    error using richfaces drag and drop support

    rajesha Indurthi Newbie

      Iam using drag and drop with my jsf application .The jsp works just fine, the drang and drop is working as expected , but when I include a menu_incl.jsp in my jsp page , code as below:



      <f:view>


      <f:subview id="menu">
      <jsp:include page="/search/incld/menu.incl.jsp" />
      </f:subview>


      <rich:dragIndicator id="indicator" />
      <h:form id="myfolder">
      <h:panelGrid columnClasses="panelc,panelc,panelc,panelc" columns="4" width="100%">
      <!-- Panel for Queries -->
      <rich:panel style="width:133px">
      <f:verbatim>

      </f:verbatim>
      <f:facet name="header">
      <h:outputText value="Queries" />
      </f:facet>
      <h:dataTable id="querytable" value="#{dndBean.queryList}"
      var="query" binding="#{workSpaceBean.queryData}" >
      <h:column>
      <a4j:outputPanel style="width:100px;border:1px solid gray;padding:2px" layout="block">
      <rich:dragSupport dragIndicator=":indicator"
      dragType="Query" dragValue="#{query}">
      <rich:dndParam name="label" value="#{query.name}" />
      </rich:dragSupport>
      <h:commandLink value="#{query.name}"
      action="#{workSpaceBean.populateQuery}">
      </h:commandLink>
      </a4j:outputPanel>
      </h:column>
      </h:dataTable>
      <f:verbatim> </f:verbatim>

      </rich:panel>
      <!-- Panel for Sets -->
      <rich:panel style="width:133px">
      <f:verbatim>

      </f:verbatim>
      <f:facet name="header">
      <h:outputText value="Sets" />
      </f:facet>
      <h:dataTable id="settable" value="#{dndBean.setsList}"
      var="set" binding="#{workSpaceBean.setData}" >
      <h:column>
      <a4j:outputPanel style="width:100px;border:1px solid gray;padding:2px" layout="block">
      <rich:dragSupport dragIndicator=":indicator"
      dragType="Set" dragValue="#{set}">
      <rich:dndParam name="label" value="#{set.name}" />
      </rich:dragSupport>
      <h:commandLink value="#{set.name}"
      action="#{workSpaceBean.viewSearchResults}">
      </h:commandLink>
      </a4j:outputPanel>
      </h:column>
      </h:dataTable>
      <f:verbatim>
      </f:verbatim>
      </rich:panel>
      <!-- Panel For Scenarios -->
      <rich:panel style="width:133px">
      <f:verbatim>

      </f:verbatim>
      <f:facet name="header">
      <h:outputText value="Scenarios" />
      </f:facet>
      <h:dataTable id="scenariotable" value="#{dndBean.scenarioList}"
      var="scenario" binding="#{workSpaceBean.scenarioData}" >
      <h:column>
      <a4j:outputPanel style="width:100px;border:1px solid gray;padding:2px" layout="block">
      <rich:dragSupport dragIndicator=":indicator"
      dragType="Scenario" dragValue="#{scenario}">
      <rich:dndParam name="label" value="#{scenario.name}" />
      </rich:dragSupport>
      <h:commandLink value="#{scenario.name}"
      action="#{workSpaceBean.viewScenario}">
      </h:commandLink>
      </a4j:outputPanel>
      </h:column>
      </h:dataTable>
      <f:verbatim>
      </f:verbatim>
      </rich:panel>


      <!-- Panel for Destination -->
      <rich:panel >
      <f:facet name="header">
      <h:outputText value="MyFolder" />
      </f:facet>
      <rich:dropSupport id="queries" acceptedTypes="Query,Set,Scenario" dropListener="#{eventBean.processDrop}" reRender="desttable, querytable,settable,scenariotable">
      </rich:dropSupport>
      <h:dataTable id="desttable" value="#{dndBean.destList}" var="fm">
      <h:column>
      <h:outputText value="#{fm.name}"></h:outputText>
      </h:column>
      </h:dataTable>
      </rich:panel>

      <a4j:commandButton action="#{dndBean.reset}" value="Start Over" reRender="querytable,settable,desttable,scenariotable"/>

      </h:panelGrid>

      </h:form>
      </f:view>
      legal   




      -When I try to get into the above page from another page on the click of a button , I get the following error :

      Error Message: Duplicate component ID 'myfolder:querytable:_id34' found in view.
      Error Code: 500
      Target Servlet: Faces Servlet
      Error Stack:
      java.lang.IllegalStateException: Duplicate component ID 'myfolder:querytable:_id34' found in view.
      at com.sun.faces.application.StateManagerImpl.removeTransientChildrenAndFacets(StateManagerImpl.java:171)
      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.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._myfolder._jspx_meth_f_view_0(_myfolder.java:1378)
      at com.ibm._jsp._myfolder._jspService(_myfolder.java:113)
      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)


      The jsp page flow works just fine when I dont includ the menu_incl.jsp.

      why is the component tree already building ??? I would appreciate if some one could explain this weird behaviour.