1 Reply Latest reply on Feb 28, 2008 4:53 AM by Ilya Shaikovsky

    Drag and Drop Exception and problem

    Pascal Paoli Newbie

      Hi at all, I use richFaces 3.1.4 and I try to develop an easy dnd example but it does not work well.

      JSP code :

      ...
      
      <a4j:form ajaxSubmit="true">
       <rich:panel style=" border : 0;" rendered="true">
       <rich:dragIndicator id="indicator" />
      
       <a4j:outputPanel
       style="width:100px;border:1px solid gray;padding:2px"
       layout="block">
      
       <rich:dragSupport dragType="text" dragValue="#{EventBean.drag}"
       dragIndicator="indicator" />
       <h:outputText value="#{EventBean.drag}" />
      
       </a4j:outputPanel>
      
       <rich:panel id="drop">
       <rich:dropSupport acceptedTypes="text"
       dropListener="#{EventBean.processDrop}" reRender="drop, drag" />
       <h:outputText value="#{EventBean.drop}" />
       </rich:panel>
      
       </rich:panel>
      
      </a4j:form>
      
      ...
      

      EventBean :
      package it.iwbank.opv.client.managedbean;
      
      import it.iwbank.lib.refactoring.managedbean.ManagedBean;
      
      import org.richfaces.component.Dropzone;
      import org.richfaces.event.DropEvent;
      import org.richfaces.event.DropListener;
      
      @SuppressWarnings("serial")
      public class EventBean extends AbstractManagedBean implements DropListener, ManagedBean {
      
       private String drag;
       private String drop;
      
       public EventBean() {
       this.drag = "Drag";
       this.drop = null;
       }
      
       public void processDrop(DropEvent dropEvent) {
       System.out.println("+-+ EventBean.processDrop");
       Dropzone dropzone = (Dropzone) dropEvent.getComponent();
       this.moveSwitchString(dropEvent.getDragValue(), dropzone.getDropValue());
      
       }
      
       public void moveSwitchString(Object fm, Object family) {
      
       System.out.println("+-+ DndBean.moveFramework");
      
       if ("text".equalsIgnoreCase((String) family)) {
       this.drag = "";
       this.drop = "Drop";
       }
       }
      
       public String getDrag() {
       return drag;
       }
      
       public String getDrop() {
       return drop;
       }
      }
      

      When I move the dragSupport into dropSupport the Framwork arise to me thi exception

      javax.faces.el.MethodNotFoundException: javax.el.MethodNotFoundException: Method not found: it.iwbank.opv.client.managedbean.EventBean@69757a.processDrop(org.richfaces.event.DropEvent)
      at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:81)
      at org.richfaces.component.UIDropSupport.broadcast(UIDropSupport.java:63)
      at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
      at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
      at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:87)
      at org.jboss.web.tomcat.service.session.JvmRouteValve.invoke(JvmRouteValve.java:84)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.el.MethodNotFoundException: Method not found: it.iwbank.opv.client.managedbean.EventBean@69757a.processDrop(org.richfaces.event.DropEvent)
      at org.apache.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:138)
      at org.apache.el.parser.AstValue.invoke(AstValue.java:128)
      at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
      ... 32 more


      Any suggestion ? Why the frameworks does not found processDrop method but it found getDrag method ? Must I set something ?

      Thanks in Advance