Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
- drag and drop problems with parameters

- drag and drop problems with parameters

2007-07-11       - By leeovan

 Back
hello ive been trying to get the drag and drop working for a while now and have
run into a few problems.

I have created a bean based on the one i found in the rich faces source


 |
 | import java.util.ArrayList Source code of java.util.ArrayList;
 | import java.util.List Source code of java.util.List;
 |
 | import org.jboss.seam.annotations.Name;
 |
 | @(protected)("dndBean")
 | public class DragAndDropBean {
 |
 |
 |   private List<String> types = new ArrayList<String>();
 |  
 |   private Object dragValue;
 |  
 |   private Object testParam;
 |  
 |   private List<String> container = new ArrayList<String>();
 |  
 |   private List<String> sourceList = new ArrayList<String>();
 |  
 |  
 |  
 |   public DragAndDropBean() {
 |     super();
 |    
 |     types.add("PHP");
 |     types.add("JAVA");
 |    
 |    
 |     sourceList.add("item1");
 |     sourceList.add("item2");
 |   }
 |  
 |   public void processDrop(org.ajax4jsf.dnd.event.DropEvent event) {
 |     System.out.println("Bean.processDrop()");
 |     this.dragValue = event.getDragValue();
 |   }
 |  
 |   public void processDrag(org.ajax4jsf.dnd.event.DragEvent dragEvent) {
 |     System.out.println("Bean.processDrag()");
 |   }
 |
 |   public List getTypes() {
 |     return types;
 |   }
 |  
 |   public String dragAction() {
 |     System.out.println("Bean.dragAction()");
 |     return null;
 |   }
 |
 |   public String dropAction() {
 |     System.out.println("Bean.dropAction()");
 |     return null;
 |   }
 |  
 |   public Object getDragValue() {
 |     return dragValue;
 |   }
 |
 |   public Object getTestParam() {
 |     return testParam;
 |   }
 |  
 |   public void setTestParam(Object testParam) {
 |     this.testParam = testParam;
 |     System.out.println("Bean.setTestParam()" + testParam);
 |   }
 |
 |   public List<String> getContainer() {
 |     return container;
 |   }
 |
 |   public void setContainer(List<String> container) {
 |     this.container = container;
 |     System.out.println("Bean.setContainer()" + container);
 |   }
 |
 |   public List<String> getSourceList() {
 |     return sourceList;
 |   }
 |
 |   public void setSourceList(List<String> sourceList) {
 |     this.sourceList = sourceList;
 |     System.out.println("Bean.setSourceList()" + sourceList);
 |   }
 |    
 |   public void reset(){
 |     System.out.println("RESET");
 |   }
 | }
 |
 |

and this is the front


 |
 | <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"
 |   id="testComponent"
 |     styleClass="edit">
 |    
 |     <rich:dragIndicator id="indicator"></rich:dragIndicator>
 |
 | <h:form id="form">
 |
 |   <h:panelGrid columnClasses="panelc" columns="2" width="50%">
 |
 |     <rich:panel style="width:100px">
 |       <f:facet name="header">
 |         <h:outputText value="Source List" />
 |       </f:facet>
 |      
 |       <h:dataTable id="src" columns="1" value="#{dndBean.sourceList}"
 |         var="source" >
 |
 |         <h:column>
 |           <a:outputPanel style="border:1px solid gray;padding:2px;"
 |             layout="block">
 |            
 |            
 |             <rich:dragSupport dragType="employee"
 |                              dragValue="#{source}"
 |                              
 |                              
 |                              >  
 |                          
 |               <rich:dndParam  name="label" value="#{source}" />
 |            
 |             </rich:dragSupport>
 |            
 |          
 |            
 |             <h:outputText value="#{source}"></h:outputText>
 |           </a:outputPanel>
 |         </h:column>
 |
 |       </h:dataTable>
 |      
 |      
 |     </rich:panel>
 |
 |     <rich:panel>
 |       <f:facet name="header">
 |         <h:outputText value="Destination" />
 |       </f:facet>
 |      
 |       <rich:dropSupport id="php"
 |                        reRender="src, php, destinationtable"
 |                        acceptedTypes="employee"
 |                        dropValue="employee"
 |                      dropListener="#{dndBean.processDrop}"
 |                      >
 |       </rich:dropSupport>
 |            <h:dataTable id="destinationtable" columns="1" value="#{dndBean
.container}" var="destination">
 |         <h:column>
 |           <h:outputText value="#{destination}"></h:outputText>
 |         </h:column>
 |       </h:dataTable>
 |
 |
 |     </rich:panel>
 |  </h:panelGrid>
 |   <a:commandButton action="#{dndBean.reset}" value="Start Over"
 |     reRender="src,destinationtable" />
 | </h:form>
 |        
 |  </ui:composition>
 |
 |
 |

now here comes the problem.  i cant seem to find the method i call on the
dropListener="#{dndBean.processDrop} section..  if i change this to
dropListener="#{dndBean.dropAction} i get the correct output.. here is the
actual stack trace.  looks like its a problem with passing parameters..


 |
 | 21:36:45,421 ERROR [ExceptionFilter] uncaught exception
 | javax.servlet.ServletException Source code of javax.servlet.ServletException: /DragAndDropComponent.xhtml @(protected),20
dropListener="#{dndBean.processDrop}": Method not found: uk.co.anotion.entity
.jobs.DragAndDropBean@(protected)(org.ajax4jsf.dnd.event.DropEvent)
 |   at javax.faces.webapp.FacesServlet Source code of javax.faces.webapp.FacesServlet(FacesServlet.java:152)
 |   at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:252)
 |   at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:173)
 |   at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java
:63)
 |   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.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.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 Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:202)
 |   at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(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 Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:202)
 |   at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:173)
 |   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
(ReplyHeaderFilter.java:96)
 |   at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:202)
 |   at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:173)
 |   at org.apache.catalina.core.StandardWrapperValve Source code of org.apache.catalina.core.StandardWrapperValve
(StandardWrapperValve.java:213)
 |   at org.apache.catalina.core.StandardContextValve Source code of org.apache.catalina.core.StandardContextValve
(StandardContextValve.java:178)
 |   at org.jboss.web.tomcat.security.SecurityAssociationValve Source code of org.jboss.web.tomcat.security.SecurityAssociationValve
(SecurityAssociationValve.java:175)
 |   at org.apache.catalina.authenticator.AuthenticatorBase Source code of org.apache.catalina.authenticator.AuthenticatorBase
(AuthenticatorBase.java:432)
 |   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve
.java:74)
 |   at org.apache.catalina.core.StandardHostValve Source code of org.apache.catalina.core.StandardHostValve(StandardHostValve
.java:126)
 |   at org.apache.catalina.valves.ErrorReportValve Source code of org.apache.catalina.valves.ErrorReportValve(ErrorReportValve
.java:105)
 |   at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke
(CachedConnectionValve.java:156)
 |   at org.apache.catalina.core.StandardEngineValve Source code of org.apache.catalina.core.StandardEngineValve(StandardEngineValve
.java:107)
 |   at org.apache.catalina.connector.CoyoteAdapter Source code of org.apache.catalina.connector.CoyoteAdapter(CoyoteAdapter.java
:148)
 |   at org.apache.coyote.http11.Http11Processor Source code of org.apache.coyote.http11.Http11Processor(Http11Processor.java
:869)
 |   at org.apache.coyote.http11.Http11BaseProtocol Source code of org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler
.processConnection(Http11BaseProtocol.java:664)
 |   at org.apache.tomcat.util.net.PoolTcpEndpoint Source code of org.apache.tomcat.util.net.PoolTcpEndpoint
(PoolTcpEndpoint.java:527)
 |   at org.apache.tomcat.util.net.MasterSlaveWorkerThread Source code of org.apache.tomcat.util.net.MasterSlaveWorkerThread
(MasterSlaveWorkerThread.java:112)
 |   at java.lang.Thread Source code of java.lang.Thread(Unknown Source)
 | 21:36:45,421 ERROR [ExceptionFilter] exception root cause
 | javax.faces.el.MethodNotFoundException Source code of javax.faces.el.MethodNotFoundException: /DragAndDropComponent.xhtml @(protected),20
dropListener="#{dndBean.processDrop}": Method not found: uk.co.anotion.entity
.jobs.DragAndDropBean@(protected)(org.ajax4jsf.dnd.event.DropEvent)
 |   at com.sun.facelets.el.LegacyMethodBinding Source code of com.sun.facelets.el.LegacyMethodBinding(LegacyMethodBinding.java
:71)
 |   at org.richfaces.component.UIDropSupport.broadcast(UIDropSupport.java:79)
 |   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 Source code of org.apache.myfaces.lifecycle.LifecycleImpl
(LifecycleImpl.java:219)
 |   at org.apache.myfaces.lifecycle.LifecycleImpl Source code of org.apache.myfaces.lifecycle.LifecycleImpl(LifecycleImpl.java
:71)
 |   at javax.faces.webapp.FacesServlet Source code of javax.faces.webapp.FacesServlet(FacesServlet.java:137)
 |   at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:252)
 |   at org.apache.catalina.core.ApplicationFilterChain Source code of org.apache.catalina.core.ApplicationFilterChain
(ApplicationFilterChain.java:173)
 |   at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java
:63)
 |   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.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java
:60)
 |   at org.jboss.seam.web.SeamFilter$FilterChai
 |

cheers

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic
&p=4063222#4063222

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4063222
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.