Author: abelevich
Date: 2010-11-26 13:25:12 -0500 (Fri, 26 Nov 2010)
New Revision: 20189
Added:
sandbox/trunk/examples/dnd-demo/src/main/java/org/
sandbox/trunk/examples/dnd-demo/src/main/java/org/demo/
sandbox/trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java
Modified:
sandbox/trunk/examples/dnd-demo/src/main/webapp/WEB-INF/web.xml
sandbox/trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml
Log:
extend demo
Added: sandbox/trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java
===================================================================
--- sandbox/trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java
(rev 0)
+++ sandbox/trunk/examples/dnd-demo/src/main/java/org/demo/DataBean.java 2010-11-26
18:25:12 UTC (rev 20189)
@@ -0,0 +1,15 @@
+package org.demo;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+import org.richfaces.event.DropEvent;
+
+@ManagedBean
+@SessionScoped
+public class DataBean {
+
+ public void processEvent(DropEvent event) {
+ System.out.println("DataBean.processEvent()");
+ }
+}
Modified: sandbox/trunk/examples/dnd-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- sandbox/trunk/examples/dnd-demo/src/main/webapp/WEB-INF/web.xml 2010-11-26 18:16:17
UTC (rev 20188)
+++ sandbox/trunk/examples/dnd-demo/src/main/webapp/WEB-INF/web.xml 2010-11-26 18:25:12
UTC (rev 20189)
@@ -1,50 +1,103 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- version="2.5">
-
- <display-name>Sample RichFaces 4 Application</display-name>
+<?xml version='1.0' encoding='UTF-8'?>
- <!-- context-param>
- <param-name>org.richfaces.skin</param-name>
- <param-value>#{skinBean.skin}</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.enableControlSkinning</param-name>
- <param-value>#{skinBean.enableElementsSkinning}</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.enableControlSkinningClasses</param-name>
- <param-value>#{skinBean.enableClassesSkinning}</param-value>
- </context-param -->
+ <!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright
+ 1997-2007 Sun Microsystems, Inc. All rights reserved. The contents of
+ this file are subject to the terms of either the GNU General Public
+ License Version 2 only ("GPL") or the Common Development and
+ Distribution License("CDDL") (collectively, the "License"). You
may
+ not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+
https://glassfish.dev.java.net/public/CDDL+GPL.html or
+ glassfish/bootstrap/legal/LICENSE.txt. See the License for the
+ specific language governing permissions and limitations under the
+ License. When distributing the software, include this License Header
+ Notice in each file and include the License file at
+ glassfish/bootstrap/legal/LICENSE.txt. Sun designates this particular
+ file as subject to the "Classpath" exception as provided by Sun in the
+ GPL Version 2 section of the License file that accompanied this code.
+ If applicable, add the following below the License Header, with the
+ fields enclosed by brackets [] replaced by your own identifying
+ information: "Portions Copyrighted [year] [name of copyright owner]"
+ Contributor(s): If you wish your version of this file to be governed
+ by only the CDDL or only the GPL Version 2, indicate your decision by
+ adding "[Contributor] elects to include this software in this
+ distribution under the [CDDL or GPL Version 2] license." If you don't
+ indicate a single choice of license, a recipient has the option to
+ distribute your version of this file under either the CDDL, the GPL
+ Version 2 or to extend the choice of license to its licensees as
+ provided above. However, if you add GPL Version 2 code and therefore,
+ elected the GPL Version 2 license, then the option applies only if the
+ new code is made subject to such option by the copyright holder.
+ -->
- <context-param>
- <param-name>javax.faces.PROJECT_STAGE</param-name>
- <param-value>Development</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.SKIP_COMMENTS</param-name>
- <param-value>true</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>*.jsf</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
- </servlet-mapping>
- <welcome-file-list>
- <welcome-file>faces/index.xhtml</welcome-file>
- </welcome-file-list>
- <session-config>
- <session-timeout>30</session-timeout>
- </session-config>
-</web-app>
\ No newline at end of file
+<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name></display-name>
+ <description></description>
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinning</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinningClasses</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to validate the XML in your
+ faces-config.xml resources against the DTD. Default
+ value is false.
+ </description>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+
+ <!-- Faces Servlet Mapping -->
+ <!--
+
+ This mapping identifies a jsp page as having JSF content. If a request
+ comes to the server for foo.faces, the container will send the request
+ to the FacesServlet, which will expect a corresponding foo.jsp page to
+ exist containing the content.
+ -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Modified: sandbox/trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml
===================================================================
--- sandbox/trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml 2010-11-26 18:16:17
UTC (rev 20188)
+++ sandbox/trunk/examples/dnd-demo/src/main/webapp/examples/dnd.xhtml 2010-11-26 18:25:12
UTC (rev 20189)
@@ -68,11 +68,12 @@
</tr>
</table>
<a4j:outputPanel id="drp" layout="block"
styleClass="droppable">
- <dnd:dropBehavior event="mouseover" acceptType="drg1, drg2"
/>
+ <dnd:dropBehavior event="mouseover" acceptType="drg1, drg2"
dropListener="#{dataBean.processEvent}"></dnd:dropBehavior>
+ <a4j:ajax event="click"/>
</a4j:outputPanel>
+
- <h:inputText>
- <a4j:ajax/>
+ <h:inputText >
</h:inputText>
</h:form>
</h:body>