0 Replies Latest reply on Jul 22, 2008 3:14 PM by Anikanchan Raut

    Drag & Drop with Ordering List

    Anikanchan Raut Newbie

      I am trying to implement drag and drop functionality between a data table and an ordering list where in I drag from the table and drop in the ordering list. When I drag and drop for the first time, it works fine. But wheen I drag and drop the next time, it fails saying:

      value of context variable is not an instance of the component bound to the context variable: footnote



      Stacktrace:

      java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: footnote
      at org.jboss.seam.Component.getInstance(Component.java:1885)
      at org.jboss.seam.Component.getInstance(Component.java:1840)
      at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
      at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
      at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
      at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
      at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
      at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)
      at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
      at org.jboss.el.parser.AstValue.getValue(AstValue.java:63)
      at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
      at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
      at javax.faces.component.UIOutput.getValue(UIOutput.java:184)
      at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:850)
      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:286)
      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
      at org.richfaces.renderkit.OrderingListRendererBase.encodeOneRow(OrderingListRendererBase.java:187)
      at org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:86)
      at org.ajax4jsf.model.SequenceDataModel.walk(SequenceDataModel.java:101)
      at org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:1127)
      at org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:106)
      at org.richfaces.renderkit.OrderingListRendererBase.encodeRows(OrderingListRendererBase.java:111)
      at org.richfaces.renderkit.AbstractRowsRenderer.encodeChildren(AbstractRowsRenderer.java:138)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:826)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:234)
      at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:178)
      at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:126)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:826)
      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:284)
      at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
      at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:826)
      at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:125)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:68)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:116)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:68)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:116)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:68)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:116)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:68)
      at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:116)
      at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:123)
      at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:673)
      at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:544)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
      at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:189)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3243)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)





      Here is the code that I am using:
      <h:form id="footnoteDisplayForm">
       <rich:dragIndicator id="indicator"/>
       <a4j:outputPanel id="footnoteDisplayPanel" ajaxRendered="true">
       <s:div style="overflow: auto; height: 180px;" rendered="#{fundsList.size>0}">
       <h:panelGrid id="footnoteFundDisplayGrid"
       columns="2" style="overflow: scroll; width: 100%;">
       <rich:dataTable
       value="#{footnoteList}"
       var="footnote"
       id="footnoteList"
      
       onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       rendered="#{! empty footnoteList}"
       rowClasses="cur"
       width="97%">
       <rich:column width="25" sortBy="#{footnote.id}">
       <f:facet name="header">Id</f:facet>
       <a4j:outputPanel>
       <rich:dragSupport
       dragIndicator=":indicator"
       dragType="text"
       dragValue="#{footnote}"
       value="#{footnote}">
       </rich:dragSupport>
       <h:outputText value="#{footnote.id}" />
       </a4j:outputPanel>
       </rich:column>
       <rich:column width="35" sortBy="#{footnote.footnoteCode}">
       <f:facet name="header">Code</f:facet>
       <a4j:outputPanel>
       <rich:dragSupport
       dragIndicator=":indicator"
       dragType="text"
       dragValue="#{footnote}"
       value="#{footnote}">
       </rich:dragSupport>
       <h:outputText value="#{footnote.footnoteCode}" />
       </a4j:outputPanel>
       </rich:column>
       <rich:column sortBy="#{footnote.name}">
       <f:facet name="header">Name</f:facet>
       <a4j:outputPanel>
       <rich:dragSupport
       dragIndicator=":indicator"
       dragType="text"
       dragValue="#{footnote}"
       value="#{footnote}">
       </rich:dragSupport>
       <h:outputText value="#{footnote.name}" />
       </a4j:outputPanel>
       </rich:column>
       </rich:dataTable>
       </h:panelGrid>
       </s:div>
      
       <rich:spacer height="30" />
       <s:div style="overflow: auto; height: 180px;" rendered="#{footnoteFund != null}">
       <h:panelGrid id="selectedFootnotesPanel"
       style="overflow: scroll; width: 100%;">
       <rich:dropSupport acceptedTypes="text"
       ondrop="if(!confirm('Click OK to expire the news. Click cancel to return back to the screen')) {return false;}"
       reRender="selectedFootnotesPanel, footnoteDisplayPanel"
       dropListener="#{footnoteEditAction.processDrop}"/>
      
       <rich:orderingList
       value="#{footnoteFund.fundFootnotes}"
       var="footnote"
       id="selectedFootnotes"
       converter="#{footnoteConverter}"
       onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       rowClasses="cur"
       width="97%">
      
       <rich:column width="180">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Delete" /></f:facet>
       <a4j:commandButton
       styleClass="rsButton"
       id="footnoteDeleteButton"
       action="#{footnoteEditAction.removeFootnote(footnote.id)}"
       reRender="selectedFootnotesPanel"
       value=" X " />
       </rich:column>
       <rich:column id="id" width="25">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Id" /></f:facet>
       <h:outputText value="#{footnote.id}" />
       </rich:column>
       <rich:column id="code" width="35">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Code" /></f:facet>
       <h:outputText value="#{footnote.footnoteCode}" />
       </rich:column>
       <rich:column id="name">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Name" /></f:facet>
       <h:outputText value="#{footnote.name}" />
       </rich:column>
       </rich:orderingList>
       </h:panelGrid>
       </s:div>
       <a4j:commandButton styleClass="rsButton"
       id="footnoteSaveButton"
       action="#{footnoteEditAction.save}"
       value="Save"/>
      
       </a4j:outputPanel>
       </h:form>
      




      Can someone please provide me some assistance in resolving this issue?

      Thanks in advance!

      Nik