9 Replies Latest reply on Jun 15, 2007 12:54 PM by Alberto Moreno

    Seam and Richfaces : Drag and Drop Problem

    Davide Taibi Newbie

      I use sem-gem to generate a new eclipse project (seam setup, seam new-project), then I added a new action testdnd to perform drag and drop operation.
      This is the code

      import java.util.ArrayList;
      import java.util.List;
      
      import javax.ejb.Stateless;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.log.Log;
      import org.jboss.seam.core.FacesMessages;
      import org.ajax4jsf.dnd.event.DropEvent;
      
      @Stateless
      @Name("testdnd")
      public class TestdndBean implements Testdnd {
      
       @Logger private Log log;
      
       @In FacesMessages facesMessages;
      
       public void testdnd()
       {
       //implement your business logic here
       log.info("testdnd.testdnd() action called");
       facesMessages.add("testdnd");
       }
      
       public void processDrop(DropEvent dropEvent) {
       System.out.println("PROCESSDROP CALLED");
       }
      
       public List getValori(){
       ArrayList al=new ArrayList();
       al.add("a");
       al.add("b");
       al.add("c");
       return al;
       }
       //add additional action methods
      
      }


      here the local interface

      import java.util.List;
      import org.ajax4jsf.dnd.event.DropEvent;
      import javax.ejb.Local;
      
      @Local
      public interface Testdnd {
      
       //seam-gen method
       public void testdnd();
      
       public void processDrop(DropEvent dropEvent);
      
       public List getValori();
      }


      and here the page that use the bean

      <!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:rich="http://richfaces.ajax4jsf.org/rich"
       xmlns:a="https://ajax4jsf.dev.java.net/ajax"
       template="layout/template.xhtml">
      
      <ui:define name="body">
      
       <h:messages globalOnly="true" styleClass="message"/>
      
       <rich:dragIndicator id="indicator" />
       <h:form id="mapping">
       <div style="float: left; width: 60%;">
       <rich:panel id="feedColumns">
       <f:facet name="header">Your Columns</f:facet>
       <rich:dataTable value="#{testdnd.valori}" var="fm"
       styleClass="datatable" rowClasses="rowOdd,rowEven" style="width: 100%;">
       <h:column>
       <f:facet name="header">Your Column</f:facet>
       </h:column>
       <h:column>
       <f:facet name="header">Example Data(Drag me!)</f:facet>
       <a:outputPanel style="border:1px solid grey;padding:2px;"
       layout="block">
       <rich:dragSupport dragIndicator=":indicator" dragType="column"
       dragValue="#{fm}">
       <rich:dndParam name="label" value="#{fm}" />
       </rich:dragSupport>
       <span style="float: right"><strong>#{fm}</strong></span> <em>#{fm}</em>
       </a:outputPanel>
       </h:column>
       </rich:dataTable>
       </rich:panel>
       </div>
       <div>
       <rich:panel id="cdmFields">
       <f:facet name="header">
       <h:outputText value="CDM Fields" />
       </f:facet>
      
       <rich:dataGrid value="#{testdnd.valori}"
       var="fm" columns="2">
       <h:column>
       <a:outputPanel style="border:1px solid red;padding:2px;" layout="block">
       <rich:dropSupport acceptedTypes="column" dropValue="#{fm}"
       dropListener="#{testdnd.processDrop}" reRender="cdmFields,messages,mappedColumns,feedColumns">
       </rich:dropSupport>
       #{fm}
       </a:outputPanel>
       </h:column>
       </rich:dataGrid>
       </rich:panel>
       </div>
       </h:form>
      
      </ui:define>
      
      </ui:composition>


      If I use the method processDrop without the DropEvent parameter all works well, but using the previous code I obtain this error :

      javax.servlet.ServletException: /testdnd.xhtml @63,104 dropListener="#{testdnd.processDrop}": Method not found: TestdndBean.processDrop(org.ajax4jsf.dnd.event.DropEvent)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       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.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      17:46:50,968 ERROR [ExceptionFilter] exception root cause
      javax.faces.el.MethodNotFoundException: /testdnd.xhtml @63,104 dropListener="#{testdnd.processDrop}": Method not found: TestdndBean.processDrop(org.ajax4jsf.dnd.event.DropEvent)
       at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:71)
       at org.richfaces.component.UIDropSupport.broadcast(UIDropSupport.java:79)
       at org.ajax4jsf.ajax.repeat.UIDataAdaptor.broadcast(UIDataAdaptor.java:1056)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:156)
       at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:62)
       at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnRegionOrRoot(AjaxContext.java:176)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.processDecodes(AjaxViewRoot.java:267)
       at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.java:219)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:71)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       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.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      17:46:51,078 ERROR [DebugPageHandler] redirecting to debug page
      javax.faces.el.MethodNotFoundException: /testdnd.xhtml @63,104 dropListener="#{testdnd.processDrop}": Method not found: TestdndBean.processDrop(org.ajax4jsf.dnd.event.DropEvent)
       at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:71)
       at org.richfaces.component.UIDropSupport.broadcast(UIDropSupport.java:79)
       at org.ajax4jsf.ajax.repeat.UIDataAdaptor.broadcast(UIDataAdaptor.java:1056)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:156)
       at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:62)
       at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnRegionOrRoot(AjaxContext.java:176)
       at org.ajax4jsf.framework.ajax.AjaxViewRoot.processDecodes(AjaxViewRoot.java:267)
       at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.java:219)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:71)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       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.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      


      Even if in this simple example the method processDrop don't use the DropEvent parameter I am interested to use it for some check operation.

      I have used the latest version of seam from cvs (downloaded today).

      Please help me!!


        • 1. Re: Seam and Richfaces : Drag and Drop Problem
          Stuart Robertson Novice

          I'm also using DnD from Richfaces, and just like you started with a simple example to explore it. It's working fine for me (also latest Seam from CVS) so I'll post what I have in case it helps you out.

          Here's the 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:a="https://ajax4jsf.dev.java.net/ajax"
           xmlns:rich="http://richfaces.ajax4jsf.org/rich"
           template="/themes/#{globalPrefs.themeName}/template.xhtml">
          
           <ui:define name="content">
           <h1>Drag and Drop exploration</h1>
          
          <a:outputPanel id="messages">
           <h:messages styleClass="message" />
          </a:outputPanel>
           <rich:dragIndicator id="indicator" />
           <h:form id="dand">
          
           <h:panelGrid columnClasses="panelc" columns="4" width="100%">
          
           <rich:panel>
           <f:facet name="header">
           <h:outputText value="Source List!" />
           </f:facet>
           <h:dataTable id="src" columns="1" value="#{dand.genders}" var="fm">
           <h:column>
           <a:outputPanel style="border:1px solid gray;padding:2px;"
           layout="block">
           <rich:dragSupport dragIndicator=":indicator"
           dragType="gender" dragValue="#{fm}">
           <rich:dndParam name="label" value="#{fm}" />
           </rich:dragSupport>
           #{fm}
           </a:outputPanel>
           </h:column>
           </h:dataTable>
           </rich:panel>
          
           <rich:panel>
           <f:facet name="header">
           <h:outputText value="CDM Fields" />
           </f:facet>
          
           <h:dataTable id="cdmtable" columns="1"
           value="#{dand.fields}" var="fm">
           <h:column>
           <a:outputPanel style="border:1px solid gray;padding:2px;"
           layout="block">
           <rich:dropSupport acceptedTypes="gender" dropValue="#{fm}"
           dropListener="#{dand.dragged}" reRender="messages">
           </rich:dropSupport>
           #{fm}
           </a:outputPanel>
           </h:column>
           </h:dataTable>
           </rich:panel>
          
          </h:panelGrid>
           </h:form>
          
           </ui:define>
          </ui:composition>
          


          Here's the SLSB:

          package com.fb.core.action;
          
          import java.util.ArrayList;
          import java.util.EnumSet;
          import java.util.List;
          
          import javax.ejb.Stateless;
          
          import org.ajax4jsf.dnd.Dropzone;
          import org.ajax4jsf.dnd.event.DropEvent;
          import org.jboss.seam.annotations.Name;
          import org.jboss.seam.annotations.datamodel.DataModel;
          import org.jboss.seam.framework.EntityController;
          
          import com.fb.core.model.cdm.CdmField;
          import com.fb.core.model.cdm.Gender;
          
          @Stateless
          @Name("dand")
          public class DandDAction extends EntityController implements DanD {
          
           private static final long serialVersionUID = -5492165330283497323L;
          
           @DataModel
           private final List<CdmField> fields;
           @DataModel
           private final List<Gender> genders;
          
           public DandDAction() {
           fields = new ArrayList<CdmField>();
           fields.addAll(EnumSet.allOf(CdmField.class));
           genders = new ArrayList<Gender>();
           genders.addAll(EnumSet.allOf(Gender.class));
           }
          
           public void dragged(DropEvent dropEvent) {
           Dropzone dropzone = (Dropzone) dropEvent.getComponent();
           addFacesMessage("Dragged #0 with dragType #1 onto dropValue #2",
           dropEvent.getDragValue(), dropEvent.getDragType(), dropzone.getDropValue());
           }
          
           public List<CdmField> getFields() {
           return fields;
           }
          
           public List<Gender> getGenders() {
           return genders;
           }
          
          }
          


          There wasn't really much else to it. The two lists in the SLSB just contain enums.

          • 2. Re: Seam and Richfaces : Drag and Drop Problem
            Davide Taibi Newbie

            Thank you for your post but I try your example (I create the two enumerations too) and I have the same error:

            javax.servlet.ServletException: /test2.xhtml @52,58 dropListener="#{dand.dragged}": Method not found: DandDAction.dragged(org.ajax4jsf.dnd.event.DropEvent)


            I'm using this web.xml file:

            <?xml version="1.0" ?>
            <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
             version="2.4">
            
             <!-- Ajax4jsf (must come first!) -->
            
             <filter>
             <display-name>Ajax4jsf Filter</display-name>
             <filter-name>ajax4jsf</filter-name>
             <filter-class>org.ajax4jsf.Filter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>ajax4jsf</filter-name>
             <url-pattern>*.seam</url-pattern>
             </filter-mapping>
            
             <context-param>
             <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
             <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>
             </context-param>
            
             <context-param>
             <param-name>org.ajax4jsf.SKIN</param-name>
             <param-value>blueSky</param-value>
             </context-param>
            
             <!-- Seam -->
            
             <listener>
             <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
             </listener>
            
             <filter>
             <filter-name>Seam Filter</filter-name>
             <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>Seam Filter</filter-name>
             <url-pattern>/*</url-pattern>
             </filter-mapping>
            
             <servlet>
             <servlet-name>Seam Resource Servlet</servlet-name>
             <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
             </servlet>
            
             <servlet-mapping>
             <servlet-name>Seam Resource Servlet</servlet-name>
             <url-pattern>/seam/resource/*</url-pattern>
             </servlet-mapping>
            
             <!-- MyFaces -->
            
             <listener>
             <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
             </listener>
            
             <!-- Facelets development mode (disable in production) -->
            
             <context-param>
             <param-name>facelets.DEVELOPMENT</param-name>
             <param-value>true</param-value>
             </context-param>
            
             <!-- JSF -->
            
             <context-param>
             <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
             <param-value>client</param-value>
             </context-param>
            
             <context-param>
             <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
             <param-value>.xhtml</param-value>
             </context-param>
            
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
             </servlet>
            
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.seam</url-pattern>
             </servlet-mapping>
            
             <security-constraint>
             <display-name>Restrict raw XHTML Documents</display-name>
             <web-resource-collection>
             <web-resource-name>XHTML</web-resource-name>
             <url-pattern>*.xhtml</url-pattern>
             </web-resource-collection>
             <auth-constraint>
             <role-name>NONE</role-name>
             </auth-constraint>
             </security-constraint>
            
            </web-app>


            that is automatically generated by seam-gen, and:

            ajax4jsf-1.1.1-SNAPSHOT.jar
            richfaces-3.0.1-SNAPSHOT.jar
            myfaces-1.1.4

            I don't have any idea about the problem, if you can send me your simple example also by email I appreciate very much.



            • 3. Re: Seam and Richfaces : Drag and Drop Problem
              Andreas Franke Apprentice

              Hi,

              have the same problem.

              javax.faces.el.MethodNotFoundException: /specialreleaseeditor.xhtml @107,140 dropListener="#{requestlist.processDrop}": Method not found: RequestListBean:5c4o1y-w4tnnw-f0o94j20-1-f0opgfby-1s.processDrop(org.ajax4jsf.dnd.event.DropEvent)
              


              @stu2
              What your DanD inferface looks like?



              @Stateful
              @Scope(ScopeType.CONVERSATION)
              @Name("requestlist")
              @SuppressWarnings("unchecked")
              public class RequestListBean extends AbstractChildListBean<Request, SpecialRelease> implements
               RequestList {
               public void processDrop(DropEvent dropEvent) {
               Dropzone dropzone = (Dropzone) dropEvent.getComponent();
              
               }
              
              }
              


              package de.bosch.ecp.business;
              
              import java.util.List;
              
              import javax.ejb.Local;
              
              import org.ajax4jsf.dnd.event.DropEvent;
              import org.ajax4jsf.dnd.event.DropListener;
              
              import de.bosch.ecp.abstracts.AbstractChildList;
              import de.bosch.ecp.model.Request;
              import de.bosch.ecp.model.SpecialRelease;
              
              @Local
              public interface RequestList extends AbstractChildList<Request, SpecialRelease>{
               public void processDrop(DropEvent dropEvent);
              }
              
              


              If I implement DropListener in RequestlistBean problem is the same as well.

              Use jboss-seam-1.2.1.GA seam-gen,
              ajax4jsf-1.1.1-SNAPSHOT.jar
              richfaces-3.0.1-20070414.000828-14.jar
              tomahawk-1.1.5-SNAPSHOT.jar

              in WEB-INF\lib folder

              • 4. Re: Seam and Richfaces : Drag and Drop Problem
                Andreas Franke Apprentice

                Hi davidetaibi

                Look in deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml

                set UseJBossWebLoader=true


                Now it works

                • 5. Re: Seam and Richfaces : Drag and Drop Problem
                  ghiormar Newbie

                  this also happened to me.
                  but when i set UseJBossWebLoader=true

                  but now my backing bean dosen't find the ajax4jsf.jar and richfaces.jar in my WEB-INF\lib folder, and fails to deploy.
                  It fails when it has to to call processDrop with org.ajax4jsf.dnd.event.DropEvent argument.
                  I tried to put the jars in the server/deploy/lib but now it gets

                  2007-04-23 16:04:21,090 WARN [org.apache.myfaces.config.FacesConfigurator] More than one managed
                  bean w/ the name of 'a4j' - only keeping the last
                  2007-04-23 16:04:21,090 WARN [org.apache.myfaces.config.FacesConfigurator] More than one managed
                  bean w/ the name of 'a4jSkin' - only keeping the last
                  2007-04-23 16:04:21,090 WARN [org.apache.myfaces.config.FacesConfigurator] More than one managed
                  bean w/ the name of 'ajaxContext' - only keeping the last
                  

                  when i deploy the first time it works fine. but when i redeploy the time stamp on the jar in WEB-INF/lib change and if i don't copy them againg to server/deploy/lib i get:
                  javax.servlet.ServletException: loader constraints violated when linking org/ajax4jsf/dnd/Draggable class
                  


                  my question is how can i get around this?

                  • 6. Re: Seam and Richfaces : Drag and Drop Problem
                    Davide Taibi Newbie

                    Setting UseJBossWebLoader=true I solved my problem thank you very much!

                    • 7. Re: Seam and Richfaces : Drag and Drop Problem
                      Davide Taibi Newbie

                      I've another problem now. When I try to use this code

                      public void processDrop(DropEvent dropEvent) {
                       Dropzone dropzone = (Dropzone) dropEvent.getComponent();
                       moveItem(dropEvent.getDragValue(), dropzone.getDropValue());
                      
                       }
                      
                      private void moveItem(Object dragValue, Object dropValue) {
                       System.out.println("DROP VALUE:"+dropValue.toString());
                      
                       System.out.println("DRAG VALUE:"+dragValue.toString());
                       }
                      


                      If I use only the second system.out all work fine, but when I use also the first I obtain the following exception:

                      javax.servlet.ServletException: loader constraints violated when linking org/ajax4jsf/dnd/Draggable class
                       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
                       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
                       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)


                      I cannot access the dropValue object, this is very important for me because I have to compare the drag object with the drop object in the drop zone.

                      • 8. Re: Seam and Richfaces : Drag and Drop Problem
                        ghiormar Newbie

                        Is you're drop zone the same as the drag zone?
                        I was getting the same error when i didn't set the types right. you should drop then to a diffrent container in this case.


                        • 9. Re: Seam and Richfaces : Drag and Drop Problem
                          Alberto Moreno Newbie

                          Hi all,

                          I had the same loader constraints violated when linking org/ajax4jsf/dnd/Draggable after setting the JBoss Loader. It seems to me that there was some kind of mix-up between my library jars in the war WEB-INF/lib and the ones in the server lib directory (I know, I shouldn't do such things).

                          Everything was solved for me when I moved all jars to the EAR directory, and added the modules/java entries to the application.xml file.

                          btw, richfaces rocks!!! :)