JBoss Rich Faces SVN: r9008 - in trunk/sandbox/samples: hotKey-sample and 13 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2008-06-11 13:49:45 -0400 (Wed, 11 Jun 2008)
New Revision: 9008
Added:
trunk/sandbox/samples/hotKey-sample/
trunk/sandbox/samples/hotKey-sample/pom.xml
trunk/sandbox/samples/hotKey-sample/src/
trunk/sandbox/samples/hotKey-sample/src/main/
trunk/sandbox/samples/hotKey-sample/src/main/java/
trunk/sandbox/samples/hotKey-sample/src/main/java/org/
trunk/sandbox/samples/hotKey-sample/src/main/java/org/richfaces/
trunk/sandbox/samples/hotKey-sample/src/main/java/org/richfaces/Bean.java
trunk/sandbox/samples/hotKey-sample/src/main/resources/
trunk/sandbox/samples/hotKey-sample/src/main/webapp/
trunk/sandbox/samples/hotKey-sample/src/main/webapp/META-INF/
trunk/sandbox/samples/hotKey-sample/src/main/webapp/META-INF/MANIFEST.MF
trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/
trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/lib/
trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/hotKey-sample/src/main/webapp/index.jsp
trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/
trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp
trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.xhtml
trunk/sandbox/samples/hotKey-sample/src/test/
trunk/sandbox/samples/hotKey-sample/src/test/java/
trunk/sandbox/samples/hotKey-sample/src/test/java/org/
trunk/sandbox/samples/hotKey-sample/src/test/java/org/richfaces/
trunk/sandbox/samples/hotKey-sample/src/test/java/org/richfaces/BeanTest.java
Log:
hot key init
Added: trunk/sandbox/samples/hotKey-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/hotKey-sample/pom.xml (rev 0)
+++ trunk/sandbox/samples/hotKey-sample/pom.xml 2008-06-11 17:49:45 UTC (rev 9008)
@@ -0,0 +1,48 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.2.2-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>hotKey-sample</artifactId>
+ <packaging>war</packaging>
+ <name>hotKey-sample Maven Webapp</name>
+ <version>3.2.2-SNAPSHOT</version>
+ <build>
+ <finalName>hotKey-sample</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui</artifactId>
+ <version>3.2.2-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>hotKey</artifactId>
+ <version>3.2.2-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>functions</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/samples/hotKey-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/java/org/richfaces/Bean.java (rev 0)
+++ trunk/sandbox/samples/hotKey-sample/src/main/java/org/richfaces/Bean.java 2008-06-11 17:49:45 UTC (rev 9008)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+}
\ No newline at end of file
Added: trunk/sandbox/samples/hotKey-sample/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ trunk/sandbox/samples/hotKey-sample/src/main/webapp/META-INF/MANIFEST.MF 2008-06-11 17:49:45 UTC (rev 9008)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-06-11 17:49:45 UTC (rev 9008)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-class>org.richfaces.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Added: trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/sandbox/samples/hotKey-sample/src/main/webapp/WEB-INF/web.xml 2008-06-11 17:49:45 UTC (rev 9008)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" 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">
+ <display-name>Archetype Created Web Application</display-name>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <!--
+ -->
+ <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>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ <dispatcher>ERROR</dispatcher>
+ </filter-mapping>
+ <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>/faces/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Added: trunk/sandbox/samples/hotKey-sample/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/webapp/index.jsp (rev 0)
+++ trunk/sandbox/samples/hotKey-sample/src/main/webapp/index.jsp 2008-06-11 17:49:45 UTC (rev 9008)
@@ -0,0 +1,11 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+
+<head></head>
+
+ <body>
+ <jsp:forward page="/pages/index.jsf" />
+ </body>
+
+</html>
\ No newline at end of file
Added: trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp (rev 0)
+++ trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.jsp 2008-06-11 17:49:45 UTC (rev 9008)
@@ -0,0 +1,22 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/ui/hotKey" prefix="sb"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/functions" prefix="rich" %>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ Alt-A is turned off and Alt-L is turned on just after whole page load (refresh)<br/>
+ <sb:hotKey id="me" key="alt+a" timing="immediate" handler="alert('alt+A is pressed')" />
+ <sb:hotKey operation="remove" key="alt+a" timing="onload" />
+ <sb:hotKey id="you" key="alt+l" timing="immediate" handler="alert('alt+L is pressed')" />
+
+
+ <button onclick="${rich:component('me')}.invoke()">Turn Alt-A On</button>
+ <button onclick="${rich:component('you')}.remove()">Turn Alt-L Off</button>
+
+ </f:view>
+ </body>
+</html>
Added: trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.xhtml
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.xhtml (rev 0)
+++ trunk/sandbox/samples/hotKey-sample/src/main/webapp/pages/index.xhtml 2008-06-11 17:49:45 UTC (rev 9008)
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:sb="http://labs.jboss.com/jbossrichfaces/ui/ui/hotKey"
+
+ >
+ <f:view>
+ Test:
+ <sb:hotKey />
+ </f:view>
+</html>
Added: trunk/sandbox/samples/hotKey-sample/src/test/java/org/richfaces/BeanTest.java
===================================================================
--- trunk/sandbox/samples/hotKey-sample/src/test/java/org/richfaces/BeanTest.java (rev 0)
+++ trunk/sandbox/samples/hotKey-sample/src/test/java/org/richfaces/BeanTest.java 2008-06-11 17:49:45 UTC (rev 9008)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+*/
+public class BeanTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public BeanTest( String testName )
+ {
+ super( testName );
+ }
+
+ public void testStub() throws Exception {
+
+ }
+}
16 years
JBoss Rich Faces SVN: r9007 - trunk/sandbox/samples.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2008-06-11 13:47:58 -0400 (Wed, 11 Jun 2008)
New Revision: 9007
Modified:
trunk/sandbox/samples/pom.xml
Log:
hot key init
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2008-06-11 17:47:45 UTC (rev 9006)
+++ trunk/sandbox/samples/pom.xml 2008-06-11 17:47:58 UTC (rev 9007)
@@ -18,5 +18,6 @@
<!--module>contextMenuDemo</module-->
<module>fileUploadPOC</module>
<module>darkX</module>
+ <module>hotKey-sample</module>
</modules>
</project>
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r9006 - in trunk/sandbox/ui: hotKey and 23 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2008-06-11 13:47:45 -0400 (Wed, 11 Jun 2008)
New Revision: 9006
Added:
trunk/sandbox/ui/hotKey/
trunk/sandbox/ui/hotKey/pom.xml
trunk/sandbox/ui/hotKey/src/
trunk/sandbox/ui/hotKey/src/main/
trunk/sandbox/ui/hotKey/src/main/config/
trunk/sandbox/ui/hotKey/src/main/config/component/
trunk/sandbox/ui/hotKey/src/main/config/component/README
trunk/sandbox/ui/hotKey/src/main/config/component/hotKey.xml
trunk/sandbox/ui/hotKey/src/main/java/
trunk/sandbox/ui/hotKey/src/main/java/META-INF/
trunk/sandbox/ui/hotKey/src/main/java/META-INF/MANIFEST.MF
trunk/sandbox/ui/hotKey/src/main/java/org/
trunk/sandbox/ui/hotKey/src/main/java/org/richfaces/
trunk/sandbox/ui/hotKey/src/main/java/org/richfaces/component/
trunk/sandbox/ui/hotKey/src/main/java/org/richfaces/component/README
trunk/sandbox/ui/hotKey/src/main/java/org/richfaces/component/UIHotKey.java
trunk/sandbox/ui/hotKey/src/main/resources/
trunk/sandbox/ui/hotKey/src/main/resources/org/
trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/
trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/
trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/
trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/
trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/hotKey.js
trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.hotkeys.js
trunk/sandbox/ui/hotKey/src/main/templates/
trunk/sandbox/ui/hotKey/src/main/templates/README
trunk/sandbox/ui/hotKey/src/main/templates/org/
trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/
trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx
trunk/sandbox/ui/hotKey/src/test/
trunk/sandbox/ui/hotKey/src/test/java/
trunk/sandbox/ui/hotKey/src/test/java/org/
trunk/sandbox/ui/hotKey/src/test/java/org/richfaces/
trunk/sandbox/ui/hotKey/src/test/java/org/richfaces/component/
trunk/sandbox/ui/hotKey/src/test/java/org/richfaces/component/JSFComponentTest.java
Log:
hot key init
Added: trunk/sandbox/ui/hotKey/pom.xml
===================================================================
--- trunk/sandbox/ui/hotKey/pom.xml (rev 0)
+++ trunk/sandbox/ui/hotKey/pom.xml 2008-06-11 17:47:45 UTC (rev 9006)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.2.2-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>hotKey</artifactId>
+ <name>hotKey</name>
+ <version>3.2.2-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>3.2.2-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>hotKey</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.2.2-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/ui/hotKey/src/main/config/component/README
===================================================================
Added: trunk/sandbox/ui/hotKey/src/main/config/component/hotKey.xml
===================================================================
--- trunk/sandbox/ui/hotKey/src/main/config/component/hotKey.xml (rev 0)
+++ trunk/sandbox/ui/hotKey/src/main/config/component/hotKey.xml 2008-06-11 17:47:45 UTC (rev 9006)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd">
+
+<components>
+ <component>
+ <name>org.richfaces.HotKey</name>
+ <family>org.richfaces.HotKey</family>
+ <classname>org.richfaces.component.html.HtmlHotKey</classname>
+ <superclass>org.richfaces.component.UIHotKey</superclass>
+ <description>
+ <![CDATA[
+ ]]>
+ </description>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.HotKeyRenderer</name>
+ <template>org/richfaces/htmlHotKey.jspx</template>
+ </renderer>
+ <tag>
+ <name>hotKey</name>
+ <classname>org.richfaces.taglib.HotKeyTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+ </tag>
+ <!--
+ <taghandler>
+ <classname>org.ajax4jsf.tag.TestHandler</classname>
+ </taghandler>
+ -->
+ &ui_component_attributes;
+ <property>
+ <name>key</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>operation</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"add"</defaultvalue>
+ </property>
+ <property>
+ <name>timing</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"immediate"</defaultvalue>
+ </property>
+ <property>
+ <name>target</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>type</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>propagete</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>disableInInput</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>checkParent</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ <property>
+ <name>handler</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>""</defaultvalue>
+ </property>
+ </component>
+</components>
Added: trunk/sandbox/ui/hotKey/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- trunk/sandbox/ui/hotKey/src/main/java/META-INF/MANIFEST.MF (rev 0)
+++ trunk/sandbox/ui/hotKey/src/main/java/META-INF/MANIFEST.MF 2008-06-11 17:47:45 UTC (rev 9006)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/sandbox/ui/hotKey/src/main/java/org/richfaces/component/README
===================================================================
Added: trunk/sandbox/ui/hotKey/src/main/java/org/richfaces/component/UIHotKey.java
===================================================================
--- trunk/sandbox/ui/hotKey/src/main/java/org/richfaces/component/UIHotKey.java (rev 0)
+++ trunk/sandbox/ui/hotKey/src/main/java/org/richfaces/component/UIHotKey.java 2008-06-11 17:47:45 UTC (rev 9006)
@@ -0,0 +1,19 @@
+/**
+ *
+ */
+
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+/**
+ * JSF component class
+ *
+ */
+public abstract class UIHotKey extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.HotKey";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.HotKey";
+
+}
Added: trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/hotKey.js
===================================================================
--- trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/hotKey.js (rev 0)
+++ trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/hotKey.js 2008-06-11 17:47:45 UTC (rev 9006)
@@ -0,0 +1,41 @@
+if (!window.Richfaces) window.Richfaces = {};
+
+Richfaces.hotKey = function(id, key, options, handler) {
+ this.id = id;
+ this.key = key;
+ this.options = options;
+ this.handler = handler;
+ this["rich:destructor"] = "destroy";
+ document.getElementById(id).component = this;
+
+ this.invoke = function() {
+ if ("add" == this.options.operation)
+ this.add(this.key, this.options, this.handler);
+ else if ("remove" == this.options.operation)
+ this.remove(this.key, this.options);
+ }
+ this.destroy = function() {
+ this.element.component = null;
+ this.element = null;
+ this.hotKey = null;
+ }
+ this.add = function (key, options, handler) {
+ jQuery.hotkeys.add(key, options, function(){ eval(handler) });
+ }
+
+ this.remove = function () {
+ jQuery.hotkeys.remove(this.key, this.options);
+ }
+
+ if ("immediate" == options.timing) {
+ this.invoke();
+ } else if ("onload" == options.timing) {
+ jQuery(document).ready(function() {
+ if ("add" == options.operation)
+ jQuery.hotkeys.add(key, options, function(){ eval(handler) });
+ else if ("remove" == options.operation)
+ jQuery.hotkeys.remove(key, options);
+ });
+ }
+
+};
\ No newline at end of file
Added: trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.hotkeys.js
===================================================================
--- trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.hotkeys.js (rev 0)
+++ trunk/sandbox/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.hotkeys.js 2008-06-11 17:47:45 UTC (rev 9006)
@@ -0,0 +1,127 @@
+/******************************************************************************************************************************
+
+ * @ Original idea by by Binny V A, Original version: 2.00.A
+ * @ http://www.openjs.com/scripts/events/keyboard_shortcuts/
+ * @ Original License : BSD
+
+ * @ jQuery Plugin by Tzury Bar Yochay
+ mail: tzury.by(a)gmail.com
+ blog: evalinux.wordpress.com
+ face: facebook.com/profile.php?id=513676303
+
+ (c) Copyrights 2007
+
+ * @ jQuery Plugin version Beta (0.0.2)
+ * @ License: jQuery-License.
+
+TODO:
+ add queue support (as in gmail) e.g. 'x' then 'y', etc.
+ add mouse + mouse wheel events.
+
+USAGE:
+ $.hotkeys.add('Ctrl+c', function(){ alert('copy anyone?');});
+ $.hotkeys.add('Ctrl+c', {target:'div#editor', type:'keyup', propagate: true},function(){ alert('copy anyone?');});>
+ $.hotkeys.remove('Ctrl+c');
+ $.hotkeys.remove('Ctrl+c', {target:'div#editor', type:'keypress'});
+
+******************************************************************************************************************************/
+(function (jQuery){
+ this.version = '(beta)(0.0.3)';
+ this.all = {};
+ this.special_keys = {
+ 27: 'esc', 9: 'tab', 32:'space', 13: 'return', 8:'backspace', 145: 'scroll', 20: 'capslock',
+ 144: 'numlock', 19:'pause', 45:'insert', 36:'home', 46:'del',35:'end', 33: 'pageup',
+ 34:'pagedown', 37:'left', 38:'up', 39:'right',40:'down', 112:'f1',113:'f2', 114:'f3',
+ 115:'f4', 116:'f5', 117:'f6', 118:'f7', 119:'f8', 120:'f9', 121:'f10', 122:'f11', 123:'f12'};
+
+ this.shift_nums = { "`":"~", "1":"!", "2":"@", "3":"#", "4":"$", "5":"%", "6":"^", "7":"&",
+ "8":"*", "9":"(", "0":")", "-":"_", "=":"+", ";":":", "'":"\"", ",":"<",
+ ".":">", "/":"?", "\\":"|" };
+
+ this.add = function(combi, options, callback) {
+ if (jQuery.isFunction(options)){
+ callback = options;
+ options = {};
+ }
+ var opt = {},
+ defaults = {type: 'keydown', propagate: false, disableInInput: false, target: jQuery('html')[0], checkParent: true},
+ that = this;
+ opt = jQuery.extend( opt , defaults, options || {} );
+ combi = combi.toLowerCase();
+
+ // inspect if keystroke matches
+ var inspector = function(event) {
+ event = jQuery.event.fix(event); // jQuery event normalization.
+ var element = event.target;
+ // @ TextNode -> nodeType == 3
+ element = (element.nodeType==3) ? element.parentNode : element;
+
+ if(opt['disableInInput']) { // Disable shortcut keys in Input, Textarea fields
+ var target = jQuery(element);
+ if( target.is("input") || target.is("textarea")){
+ return;
+ }
+ }
+ var code = event.which,
+ type = event.type,
+ character = String.fromCharCode(code).toLowerCase(),
+ special = that.special_keys[code],
+ shift = event.shiftKey,
+ ctrl = event.ctrlKey,
+ alt= event.altKey,
+ propagate = true, // default behaivour
+ mapPoint = null;
+
+ // in opera + safari, the event.target is unpredictable.
+ // for example: 'keydown' might be associated with HtmlBodyElement
+ // or the element where you last clicked with your mouse.
+ if (jQuery.browser.opera || jQuery.browser.safari || opt.checkParent){
+ while (!that.all[element] && element.parentNode){
+ element = element.parentNode;
+ }
+ }
+
+ var cbMap = that.all[element].events[type].callbackMap;
+ if(!shift && !ctrl && !alt) { // No Modifiers
+ mapPoint = cbMap[special] || cbMap[character]
+ }
+ // deals with combinaitons (alt|ctrl|shift+anything)
+ else{
+ var modif = '';
+ if(alt) modif +='alt+';
+ if(ctrl) modif+= 'ctrl+';
+ if(shift) modif += 'shift+';
+ // modifiers + special keys or modifiers + characters or modifiers + shift characters
+ mapPoint = cbMap[modif+special] || cbMap[modif+character] || cbMap[modif+that.shift_nums[character]]
+ }
+ if (mapPoint){
+ mapPoint.cb(event);
+ if(!mapPoint.propagate) {
+ event.stopPropagation();
+ event.preventDefault();
+ return false;
+ }
+ }
+ };
+ // first hook for this element
+ if (!this.all[opt.target]){
+ this.all[opt.target] = {events:{}};
+ }
+ if (!this.all[opt.target].events[opt.type]){
+ this.all[opt.target].events[opt.type] = {callbackMap: {}}
+ jQuery.event.add(opt.target, opt.type, inspector);
+ }
+ this.all[opt.target].events[opt.type].callbackMap[combi] = {cb: callback, propagate:opt.propagate};
+ return jQuery;
+ };
+ this.remove = function(exp, opt) {
+ opt = opt || {};
+ target = opt.target || jQuery('html')[0];
+ type = opt.type || 'keydown';
+ exp = exp.toLowerCase();
+ delete this.all[target].events[type].callbackMap[exp]
+ return jQuery;
+ };
+ jQuery.hotkeys = this;
+ return jQuery;
+})(jQuery);
\ No newline at end of file
Added: trunk/sandbox/ui/hotKey/src/main/templates/README
===================================================================
Added: trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx
===================================================================
--- trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx (rev 0)
+++ trunk/sandbox/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx 2008-06-11 17:47:45 UTC (rev 9006)
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ class="org.richfaces.renderkit.html.HotKeyRenderer"
+ baseclass="org.ajax4jsf.renderkit.AjaxComponentRendererBase"
+ component="org.richfaces.component.UIHotKey"
+ >
+ <f:clientid var="clientId"/>
+ <c:set var="key" value="#{component.attributes['key']}"/>
+ <c:set var="operation" value="#{component.attributes['operation']}"/>
+ <c:set var="timing" value="#{component.attributes['timing']}"/>
+ <c:set var="type" value="#{component.attributes['type']}"/>
+ <c:set var="propagete" value="#{component.attributes['propagete']}"/>
+ <c:set var="disableInInput" value="#{component.attributes['disableInInput']}"/>
+ <c:set var="checkParent" value="#{component.attributes['checkParent']}"/>
+ <c:set var="handler" value="#{component.attributes['handler']}"/>
+
+ <h:scripts>/org/richfaces/renderkit/html/scripts/jquery/jquery.js,/org/richfaces/renderkit/html/scripts/jquery.hotkeys.js,/org/richfaces/renderkit/html/scripts/hotKey.js</h:scripts>
+ <jsp:scriptlet>
+ <![CDATA[
+ StringBuffer options= new StringBuffer("{");
+ String operation = (String) variables.getVariable("operation");
+ options.append("operation:'");
+ options.append(operation);
+ options.append("'");
+
+ String type = (String) variables.getVariable("type");
+ if (!type.equals("")) {
+ options.append(",type:'");
+ options.append(type);
+ options.append("'");
+ }
+ String propagete = (String) variables.getVariable("propagete");
+ if (!propagete.equals("")) {
+ options.append(",propagete:");
+ options.append(propagete);
+ }
+
+ String disableInInput = (String) variables.getVariable("disableInInput");
+ if (!propagete.equals("")) {
+ options.append(",disableInInput:");
+ options.append(disableInInput);
+ }
+
+ String checkParent = (String) variables.getVariable("checkParent");
+ if (!propagete.equals("")) {
+ options.append(",checkParent:");
+ options.append(checkParent);
+ }
+
+ String timing = (String) variables.getVariable("timing");
+ options.append(",timing:'");
+ options.append(timing);
+ options.append("'");
+
+
+ options.append("}");
+ variables.setVariable("options", options);
+ ]]>
+ </jsp:scriptlet>
+ <span id="#{clientId}" style="display:none"
+ x:passThruWithExclusions="id"
+ >
+
+ <script>
+ new Richfaces.hotKey("#{clientId}","#{key}", #{options}, "#{handler}");
+ </script>
+ </span>
+</f:root>
\ No newline at end of file
Added: trunk/sandbox/ui/hotKey/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/sandbox/ui/hotKey/src/test/java/org/richfaces/component/JSFComponentTest.java (rev 0)
+++ trunk/sandbox/ui/hotKey/src/test/java/org/richfaces/component/JSFComponentTest.java 2008-06-11 17:47:45 UTC (rev 9006)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import javax.faces.component.UIComponent;
+
+/**
+ * Unit test for simple Component.
+ */
+public class JSFComponentTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public JSFComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testComponent()
+ {
+ assertTrue( true );
+ }
+}
16 years
JBoss Rich Faces SVN: r9005 - trunk/sandbox/ui.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2008-06-11 13:46:31 -0400 (Wed, 11 Jun 2008)
New Revision: 9005
Modified:
trunk/sandbox/ui/pom.xml
Log:
hotKey Init
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2008-06-11 16:46:31 UTC (rev 9004)
+++ trunk/sandbox/ui/pom.xml 2008-06-11 17:46:31 UTC (rev 9005)
@@ -19,5 +19,6 @@
<module>rex-messageBox</module>
<!--module>rex-button</module-->
<module>sortableHeader</module>
+ <module>hotKey</module>
</modules>
</project>
\ No newline at end of file
16 years
JBoss Rich Faces SVN: r9004 - branches/3.1.x/test-applications/qa/3.1.6.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-06-11 12:46:31 -0400 (Wed, 11 Jun 2008)
New Revision: 9004
Added:
branches/3.1.x/test-applications/qa/3.1.6/QA test report Build RF 3.1.6 CR1.xls
Removed:
branches/3.1.x/test-applications/qa/3.1.6/QA test report Build RF 3.1.6 CR5.xls
Log:
Copied: branches/3.1.x/test-applications/qa/3.1.6/QA test report Build RF 3.1.6 CR1.xls (from rev 9003, branches/3.1.x/test-applications/qa/3.1.6/QA test report Build RF 3.1.6 CR5.xls)
===================================================================
(Binary files differ)
Deleted: branches/3.1.x/test-applications/qa/3.1.6/QA test report Build RF 3.1.6 CR5.xls
===================================================================
(Binary files differ)
16 years
JBoss Rich Faces SVN: r9003 - in branches/3.1.x/test-applications/qa: 3.1.6 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-06-11 12:42:32 -0400 (Wed, 11 Jun 2008)
New Revision: 9003
Added:
branches/3.1.x/test-applications/qa/3.1.6/
branches/3.1.x/test-applications/qa/3.1.6/QA test report Build RF 3.1.6 CR5.xls
Log:
Added: branches/3.1.x/test-applications/qa/3.1.6/QA test report Build RF 3.1.6 CR5.xls
===================================================================
(Binary files differ)
Property changes on: branches/3.1.x/test-applications/qa/3.1.6/QA test report Build RF 3.1.6 CR5.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years
JBoss Rich Faces SVN: r9002 - in trunk/test-applications/seleniumTest/src: main/webapp/WEB-INF and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-06-11 12:41:48 -0400 (Wed, 11 Jun 2008)
New Revision: 9002
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxOutputPanel/
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
Add selenium test for a4j:outputPannel component
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java 2008-06-11 16:41:48 UTC (rev 9002)
@@ -0,0 +1,101 @@
+/*
+ * A4JOutputPanelTestBean.java Date created: 11.06.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.ajax4jsf.bean;
+
+/**
+ * A4JOutputPanel Test Bean
+ * @author Alexandr Levkovsky
+ *
+ */
+public class A4JOutputPanelTestBean {
+
+ private Boolean panel1VisibleFlag = true;
+ private Boolean panel2VisibleFlag = true;
+ private Boolean panel3VisibleFlag = true;
+ private Boolean panel4VisibleFlag = true;
+
+ /**
+ * @return the panel1VisibleFlag
+ */
+ public Boolean getPanel1VisibleFlag() {
+ return panel1VisibleFlag;
+ }
+ /**
+ * @param panel1VisibleFlag the panel1VisibleFlag to set
+ */
+ public void setPanel1VisibleFlag(Boolean panel1VisibleFlag) {
+ this.panel1VisibleFlag = panel1VisibleFlag;
+ }
+ /**
+ * @return the panel2VisibleFlag
+ */
+ public Boolean getPanel2VisibleFlag() {
+ return panel2VisibleFlag;
+ }
+ /**
+ * @param panel2VisibleFlag the panel2VisibleFlag to set
+ */
+ public void setPanel2VisibleFlag(Boolean panel2VisibleFlag) {
+ this.panel2VisibleFlag = panel2VisibleFlag;
+ }
+
+ /**
+ * @return the panel3VisibleFlag
+ */
+ public Boolean getPanel3VisibleFlag() {
+ return panel3VisibleFlag;
+ }
+
+ /**
+ * @param panel3VisibleFlag the panel3VisibleFlag to set
+ */
+ public void setPanel3VisibleFlag(Boolean panel3VisibleFlag) {
+ this.panel3VisibleFlag = panel3VisibleFlag;
+ }
+
+ /**
+ * @return the panel4VisibleFlag
+ */
+ public Boolean getPanel4VisibleFlag() {
+ return panel4VisibleFlag;
+ }
+
+ /**
+ * @param panel4VisibleFlag the panel4VisibleFlag to set
+ */
+ public void setPanel4VisibleFlag(Boolean panel4VisibleFlag) {
+ this.panel4VisibleFlag = panel4VisibleFlag;
+ }
+
+ public String b1Action(){
+ return null;
+ }
+
+ public String b2Action(){
+ setPanel1VisibleFlag(false);
+ setPanel2VisibleFlag(false);
+ return null;
+ }
+
+ public String b3Action(){
+ setPanel3VisibleFlag(false);
+ return null;
+ }
+
+ public String b4Action(){
+ setPanel4VisibleFlag(false);
+ return null;
+ }
+
+ public String reset(){
+ setPanel1VisibleFlag(true);
+ setPanel2VisibleFlag(true);
+ setPanel3VisibleFlag(true);
+ setPanel4VisibleFlag(true);
+ return null;
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/bean/A4JOutputPanelTestBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-06-11 16:26:13 UTC (rev 9001)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-06-11 16:41:48 UTC (rev 9002)
@@ -126,6 +126,11 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
+ <managed-bean-name>a4jOutputPanelBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.A4JOutputPanelTestBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>calendarBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.CalendarTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-06-11 16:26:13 UTC (rev 9001)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-06-11 16:41:48 UTC (rev 9002)
@@ -419,6 +419,26 @@
public void AssertNotVisible(String id) {
Assert.assertFalse(isVisibleById(id));
}
+
+ /**
+ * Asserts DOM node is present
+ * @param id - DOM element id
+ */
+ public void AssertRendered(String id) {
+ if (!isPresentById(id)) {
+ Assert.fail("Component " + id + " should be rendered on page");
+ }
+ }
+
+ /**
+ * Asserts DOM node is not present
+ * @param id - DOM element id
+ */
+ public void AssertNotRendered(String id) {
+ if (isPresentById(id)) {
+ Assert.fail("Component " + id + " should not be rendered on page");
+ }
+ }
/**
* Returns element's text
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2008-06-11 16:41:48 UTC (rev 9002)
@@ -0,0 +1,247 @@
+/*
+ * AjaxOutputPanel.java Date created: 10.06.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.RichSeleniumTest;
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+/**
+ * Ajax Output Panel selenium test
+ * @author Alexandr Levkovsky
+ *
+ */
+public class AjaxOutputPanelTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxOutputPanelTest() {
+ super("http", "localhost", serverPort);
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeMethod
+ @Parameters( { "browser", "filterPrefix" })
+ public void startSelenium(String browser, String filterPrefix) {
+ super.startSelenium(browser, filterPrefix);
+
+ //TODO should pass as parameter
+ renderPage(Template.SIMPLE);
+ }
+
+ @BeforeMethod
+ @Parameters( { "loadStyleStrategy", "loadScriptStrategy" })
+ protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
+ super.loadConfiguration(loadStyleStrategy, loadScriptStrategy);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterMethod(alwaysRun = true)
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ public String getTestUrl() {
+ return "pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml";
+ }
+
+ @Test
+ public void testLayoutAttribute() throws Exception {
+ // panel_1 has layout=inline(default)
+ // panel_2 has layout=block
+ // panel_3 has layout=none
+ writeStatus("Testing layout attribute...");
+
+ String panelId = "form:panel_1";
+ String panel2Id = "form:panel_2";
+ String panel3Id = getParentId() + "form:panel_3";
+
+ String type = runScript("getElementType('" + panelId + "')");
+ Assert.assertEquals(type.toLowerCase(), "span", "panel_1 has layout=inline(default) and should be 'span' element");
+
+ type = runScript("getElementType('" + panel2Id + "')");
+ Assert.assertEquals(type.toLowerCase(), "div", "panel_2 has layout=block and should be 'div' element");
+
+ // panel_3 has layout=none and should not present if a child component
+ // is rendered
+ if (isPresentById(panel3Id)) {
+ Assert.fail("panel_3 has layout=none and should not peresent if a child component is rendered ");
+ }
+
+ // remove child component rendering
+ writeStatus("Click button 3");
+ String buttonId = getParentId() + "form:b3";
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ // panel_3 has layout=none and should present if no child component is
+ // rendered with id of a child component and display:none style
+ if (!isPresentById(panel3Id + "_text")) {
+ Assert.fail("panel_3 has layout=none and should peresent if no child component is rendered with id of a child component");
+ }
+ if (isVisibleById(panel3Id + "_text")) {
+ Assert.fail("panel_3 has layout=none and should peresent if no child component is rendered with display:none style");
+ }
+ }
+
+ @Test
+ public void testRenderedAttribute() throws Exception {
+ writeStatus("Testing rendered attribute...");
+
+ String panelId = getParentId() + "form:panel_4";
+
+ // panel_4 has rendered=true and should present on page
+ AssertRendered(panelId);
+
+ // change rendered attribute to false
+ writeStatus("Click button 4");
+ String buttonId = getParentId() + "form:b4";
+ clickCommandAndWait(buttonId);
+
+ // panel_4 has rendered=false and should not present on page
+ AssertNotRendered(panelId);
+ }
+
+ @Test
+ public void testAjaxRenderedAttribute() throws Exception {
+ // panel_1 has ajaxRendered=false and is reRender by b1
+ // panel_2 has ajaxRendered=true
+ writeStatus("Testing ajaxRendered attribute...");
+
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_1_text";
+ String panelId2 = parentId + "panel_2_text";
+ String buttonId = parentId + "b2";
+ writeStatus("Click button 2");
+ // set panel_1 text visible flag to false
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ // panel_1 text should be visible as it reRendered only by b1
+ if (!isPresentById(panelId)) {
+ Assert.fail("panel_1 text should be visible as it reRendered only by b1");
+ }
+ // panel_2 text should not be visible as it has ajaxRendered=true
+ if (isPresentById(panelId2)) {
+ Assert.fail("panel_2 text should not be visible as it has ajaxRendered=true");
+ }
+
+ buttonId = parentId + "b1";
+ writeStatus("Click button 1");
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ // panel text should NOT be visible as it reRendered by b1
+ if (isPresentById(panelId)) {
+ Assert.fail("panel_1 text should not be visible as it reRendered by b1");
+ }
+ }
+
+ @Test
+ public void testOnDoubleClickEvent() throws Exception {
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_5";
+ writeStatus("Check ondoubleclick event");
+ selenium.doubleClick(panelId);
+ String panelResultId = panelId + "_result";
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnKeyDownEvent() throws Exception {
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_6";
+ writeStatus("Check onkeydown event");
+ selenium.keyDown(panelId, "1");
+ String panelResultId = panelId + "_result";
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnKeyPressEvent() throws Exception {
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_7";
+ writeStatus("Check onkeypress event");
+ selenium.keyPress(panelId, "1");
+ String panelResultId = panelId + "_result";
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnKeyUpEvent() throws Exception {
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_8";
+ writeStatus("Check onkeyup event");
+ selenium.keyUp(panelId, "1");
+ String panelResultId = panelId + "_result";
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnMouseDownEvent() throws Exception {
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_9";
+ writeStatus("Check onmousedown event");
+ selenium.mouseDown(panelId);
+ String panelResultId = panelId + "_result";
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnMouseMoveEvent() throws Exception {
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_10";
+ writeStatus("Check onmousemove event");
+ selenium.mouseMove(panelId);
+ String panelResultId = panelId + "_result";
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnMouseOutEvent() throws Exception {
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_11";
+ writeStatus("Check onmouseout event");
+ selenium.mouseOut(panelId);
+ String panelResultId = panelId + "_result";
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnMouseOverEvent() throws Exception {
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_12";
+ writeStatus("Check onmouseover event");
+ selenium.mouseOver(panelId);
+ String panelResultId = panelId + "_result";
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnMouseUpEvent() throws Exception {
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_13";
+ writeStatus("Check onmouseup event");
+ selenium.mouseUp(panelId);
+ String panelResultId = panelId + "_result";
+ AssertTextEquals(panelResultId, "Yes");
+ }
+
+ @Test
+ public void testOnClickEvent() throws Exception {
+ String parentId = getParentId() + "form:";
+ String panelId = parentId + "panel_14";
+ writeStatus("Check onclick event");
+ selenium.click(panelId);
+ String panelResultId = panelId + "_result";
+ AssertTextEquals(panelResultId, "Yes");
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years
JBoss Rich Faces SVN: r9001 - branches/3.1.x/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-06-11 12:26:13 -0400 (Wed, 11 Jun 2008)
New Revision: 9001
Modified:
branches/3.1.x/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-3646
Modified: branches/3.1.x/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- branches/3.1.x/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-06-11 15:42:51 UTC (rev 9000)
+++ branches/3.1.x/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-06-11 16:26:13 UTC (rev 9001)
@@ -213,6 +213,15 @@
return true;
},
+ _findTr: function(event) {
+ var elt = Event.element(event);
+ while (elt && (!elt.tagName || elt.tagName.toUpperCase() != 'TR')) {
+ elt = elt.parentNode;
+ }
+
+ return elt;
+ },
+
onKeyDown: function(event) {
if (this.isUnloaded()) return;
if (!this.initialized) {
@@ -226,7 +235,7 @@
this.update.parentNode.removeChild(this.update);
this.update = temp;
- var scripts = Element.select(temp, 'script');
+ var scripts = temp.getElementsByTagName('script');
for (var i = 0; i < scripts.length; i++) {
var script = scripts[i];
if (script.parentNode) {
@@ -352,7 +361,7 @@
},
onHover: function(event) {
- var element = Event.findElement(event, 'TR');
+ var element = this._findTr(event);//Event.findElement(event, 'TR');
if (!this.skipHover) {
if (this.index != element.autocompleteIndex) {
this.index = element.autocompleteIndex;
@@ -371,14 +380,14 @@
onClick: function(event) {
this.wasScroll = false;
this.wasBlur = false;
- var element = Event.findElement(event, 'TR');
+ var element = this._findTr(event);//Event.findElement(event, 'TR');
this.index = element.autocompleteIndex;
this.selectEntry(event);
this.hide();
},
onMouseOut: function(event) {
- var element = Event.findElement(event, 'TR');
+ var element = this._findTr(event);//Event.findElement(event, 'TR');
Event.stopObserving(element, "mousemove", this.onHover);
},
16 years
JBoss Rich Faces SVN: r9000 - branches/3.1.x/test-applications/jsp/src/main/webapp/DropDownMenu.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-06-11 11:42:51 -0400 (Wed, 11 Jun 2008)
New Revision: 9000
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/DropDownMenu/DropDownMenu.jsp
Log:
+label facet
Modified: branches/3.1.x/test-applications/jsp/src/main/webapp/DropDownMenu/DropDownMenu.jsp
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/webapp/DropDownMenu/DropDownMenu.jsp 2008-06-11 15:16:22 UTC (rev 8999)
+++ branches/3.1.x/test-applications/jsp/src/main/webapp/DropDownMenu/DropDownMenu.jsp 2008-06-11 15:42:51 UTC (rev 9000)
@@ -4,65 +4,87 @@
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="DropDownMenuSubviewID">
- <h:panelGrid columns="2">
- <rich:spacer width="400px" height="400px"></rich:spacer>
- <rich:panel>
- <rich:dropDownMenu id="ddmId" value="DropDownMenu" submitMode="#{dDMenu.mode}" hideDelay="#{dDMenu.hideDelay}"
- direction="#{dDMenu.direction}" horizontalOffset="#{dDMenu.horizontalOffset}" jointPoint="#{dDMenu.jointPoint}"
- popupWidth="#{dDMenu.popupWidth}" showDelay="#{dDMenu.showDelay}" rendered="#{dDMenu.rendered}"
- verticalOffset="#{dDMenu.verticalOffset}" styleClass="panelpos" event="#{dDMenu.event}"
- disabled="#{dDMenu.disabled}"
- oncollapse="showEvent('oncollapseInputID', 'oncollapse work!')" onexpand="showEvent('onexpandInputID', 'onexpand work!')"
- ongroupactivate="showEvent('ongroupactivateInputID', 'ongroupactivate work!')"
- onitemselect="showEvent('onitemselectInputID', 'onitemselect work!')"
- onmousemove="showEvent('onmousemoveInputID', 'onmousemove work!')" onmouseout="showEvent('onmouseoutInputID', 'onmouseout work!')"
- onmouseover="showEvent('onmouseoverInputID', 'onmouseover work!')" binding="#{dDMenu.mydDMenu}" >
- <rich:menuItem icon="#{dDMenu.icon}" onclick="showEvent('onclickInputID', 'onclick work (item)!')"
- oncomplete="showEvent('oncompleteInputID', 'oncomplete work (item)!')" onmousedown="showEvent('onmousedownInputID', 'onmousedown work (item)!')"
- onmousemove="showEvent('onmousemoveInputID', ' work (item)!')" onmouseout="alert('Hi!');"
- onmouseover="showEvent('onmouseoverInputID', 'onmouseover work (item)!')" onmouseup="showEvent('onmouseupInputID', 'onmouseup work (item)!')"
- onselect="showEvent('onselectInputID', 'onselect work (item)!')">
- <h:outputText value="Item1(test events)" />
- </rich:menuItem>
- <rich:menuSeparator />
- <rich:menuItem icon="#{dDMenu.icon}" onmousedown="alert('OnMouseDown')" selectClass="mousemove">
- <h:outputText value="OnMouseDown" />
- </rich:menuItem>
- <rich:menuSeparator />
- <rich:menuItem>
- <h:outputText value="Item2" />
- </rich:menuItem>
- <rich:menuItem icon="#{dDMenu.icon}">
- <h:outputText value="Item3" />
- </rich:menuItem>
- <rich:menuSeparator />
- <rich:menuItem icon="/pics/ajax_process.gif" iconDisabled="/pics/ajax_stoped.gif" disabled="#{dDMenu.disabled}">
- <h:outputText value="Image"></h:outputText>
- </rich:menuItem>
- <rich:menuItem disabled="#{dDMenu.disabled}" icon="#{dDMenu.icon}">
- <h:outputText value="Image:" />
- <h:graphicImage value="/pics/ajax_process.gif" />
- </rich:menuItem>
- <rich:menuSeparator />
- <rich:menuGroup value="Second level" direction="#{dDMenu.groupDirection}" disabled="#{dDMenu.disabled}" icon="#{dDMenu.icon}"
- iconFolder="#{dDMenu.iconFolder}">
+ <h:panelGrid columns="2">
+ <rich:spacer width="400px" height="400px"></rich:spacer>
+ <rich:panel>
+ <rich:dropDownMenu id="ddmId" value="DropDownMenu"
+ submitMode="#{dDMenu.mode}" hideDelay="#{dDMenu.hideDelay}"
+ direction="#{dDMenu.direction}"
+ horizontalOffset="#{dDMenu.horizontalOffset}"
+ jointPoint="#{dDMenu.jointPoint}" popupWidth="#{dDMenu.popupWidth}"
+ showDelay="#{dDMenu.showDelay}" rendered="#{dDMenu.rendered}"
+ verticalOffset="#{dDMenu.verticalOffset}" styleClass="panelpos"
+ event="#{dDMenu.event}" disabled="#{dDMenu.disabled}"
+ oncollapse="showEvent('oncollapseInputID', 'oncollapse work!')"
+ onexpand="showEvent('onexpandInputID', 'onexpand work!')"
+ ongroupactivate="showEvent('ongroupactivateInputID', 'ongroupactivate work!')"
+ onitemselect="showEvent('onitemselectInputID', 'onitemselect work!')"
+ onmousemove="showEvent('onmousemoveInputID', 'onmousemove work!')"
+ onmouseout="showEvent('onmouseoutInputID', 'onmouseout work!')"
+ onmouseover="showEvent('onmouseoverInputID', 'onmouseover work!')"
+ binding="#{dDMenu.mydDMenu}">
+ <f:facet name="label">
+ <h:panelGroup>
+ <h:graphicImage value="/pics/ajax_process.gif" styleClass="pic" />
+ <h:outputText value="File(bug 3629)"/>
+ </h:panelGroup>
+ </f:facet>
+ <rich:menuItem icon="#{dDMenu.icon}"
+ onclick="showEvent('onclickInputID', 'onclick work (item)!')"
+ oncomplete="showEvent('oncompleteInputID', 'oncomplete work (item)!')"
+ onmousedown="showEvent('onmousedownInputID', 'onmousedown work (item)!')"
+ onmousemove="showEvent('onmousemoveInputID', ' work (item)!')"
+ onmouseout="showEvent('onmouseoutInputID', 'onmouseout work (item)!')"
+ onmouseover="showEvent('onmouseoverInputID', 'onmouseover work (item)!')"
+ onmouseup="showEvent('onmouseupInputID', 'onmouseup work (item)!')"
+ onselect="showEvent('onselectInputID', 'onselect work (item)!')">
+ <h:outputText value="Item1(test events)" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="#{dDMenu.icon}"
+ onmousedown="alert('OnMouseDown')" selectClass="mousemove">
+ <h:outputText value="OnMouseDown" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem>
+ <h:outputText value="Item2" />
+ </rich:menuItem>
<rich:menuItem icon="#{dDMenu.icon}">
<h:outputText value="Item3" />
</rich:menuItem>
- <rich:menuItem value="Item4">
- <h:selectOneMenu value="#{dDMenu.selectMenu}">
- <f:selectItem itemLabel="Honda Accord" itemValue="accord" />
- <f:selectItem itemLabel="Toyota 4Runner" itemValue="4runner" />
- <f:selectItem itemLabel="Nissan Z350" itemValue="nissan-z" />
- </h:selectOneMenu>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/ajax_process.gif"
+ iconDisabled="/pics/ajax_stoped.gif"
+ disabled="#{dDMenu.disabled}">
+ <h:outputText value="Image"></h:outputText>
</rich:menuItem>
+ <rich:menuItem disabled="#{dDMenu.disabled}" icon="#{dDMenu.icon}">
+ <h:outputText value="Image:" />
+ <h:graphicImage value="/pics/ajax_process.gif" />
+ </rich:menuItem>
<rich:menuSeparator />
- <rich:menuItem icon="#{dDMenu.icon}">
- <h:outputText value="CheckBox " />
- <h:selectBooleanCheckbox value="#{dDMenu.check}" onclick="submit()" />
- </rich:menuItem>
- </rich:menuGroup>
- </rich:dropDownMenu>
- </rich:panel>
- </h:panelGrid>
+ <rich:menuGroup value="Second level"
+ direction="#{dDMenu.groupDirection}"
+ disabled="#{dDMenu.disabled}" icon="#{dDMenu.icon}"
+ iconFolder="#{dDMenu.iconFolder}">
+ <rich:menuItem icon="#{dDMenu.icon}">
+ <h:outputText value="Item3" />
+ </rich:menuItem>
+ <rich:menuItem value="Item4">
+ <h:selectOneMenu value="#{dDMenu.selectMenu}">
+ <f:selectItem itemLabel="Honda Accord" itemValue="accord" />
+ <f:selectItem itemLabel="Toyota 4Runner" itemValue="4runner" />
+ <f:selectItem itemLabel="Nissan Z350" itemValue="nissan-z" />
+ </h:selectOneMenu>
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="#{dDMenu.icon}">
+ <h:outputText value="CheckBox " />
+ <h:selectBooleanCheckbox value="#{dDMenu.check}"
+ onclick="submit()" />
+ </rich:menuItem>
+ </rich:menuGroup>
+ </rich:dropDownMenu>
+ </rich:panel>
+ </h:panelGrid>
</f:subview>
16 years
JBoss Rich Faces SVN: r8999 - in trunk: framework/impl/src/main/java/org/ajax4jsf/component and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-06-11 11:16:22 -0400 (Wed, 11 Jun 2008)
New Revision: 8999
Added:
trunk/framework/api/src/main/java/org/richfaces/component/ComponentPhaseEventHandler.java
trunk/framework/impl/src/main/java/org/richfaces/event/ComponentViewPhaseListener.java
Removed:
trunk/framework/impl/src/main/java/org/richfaces/component/ComponentPhaseEventHandler.java
trunk/framework/impl/src/main/java/org/richfaces/component/ComponentViewPhaseListener.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
trunk/framework/impl/src/main/resources/META-INF/faces-config.xml
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
Log:
RF-2815
Added: trunk/framework/api/src/main/java/org/richfaces/component/ComponentPhaseEventHandler.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/ComponentPhaseEventHandler.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/component/ComponentPhaseEventHandler.java 2008-06-11 15:16:22 UTC (rev 8999)
@@ -0,0 +1,9 @@
+package org.richfaces.component;
+
+import javax.faces.event.PhaseEvent;
+
+public interface ComponentPhaseEventHandler {
+
+ void beforePhase(PhaseEvent event);
+
+}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-06-11 13:35:39 UTC (rev 8998)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-06-11 15:16:22 UTC (rev 8999)
@@ -48,6 +48,7 @@
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
+import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
@@ -60,6 +61,7 @@
import org.ajax4jsf.renderkit.AjaxChildrenRenderer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.richfaces.component.ComponentPhaseEventHandler;
/**
* Base class for iterable components, like dataTable, Tomahawk dataList,
@@ -69,7 +71,7 @@
* @author shura
*
*/
-public abstract class UIDataAdaptor extends UIData implements AjaxDataEncoder {
+public abstract class UIDataAdaptor extends UIData implements AjaxDataEncoder, ComponentPhaseEventHandler {
/**
*
@@ -1212,7 +1214,6 @@
}
public void encodeBegin(FacesContext context) throws IOException {
- resetDataModel();
if (null != childState && !keepSaved(context)) {
childState.remove(getBaseClientId(context));
}
@@ -1648,4 +1649,8 @@
setExtendedDataModel(null);
super.setValue(value);
}
+
+ public void beforePhase(PhaseEvent event) {
+ resetDataModel();
+ }
}
Deleted: trunk/framework/impl/src/main/java/org/richfaces/component/ComponentPhaseEventHandler.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/component/ComponentPhaseEventHandler.java 2008-06-11 13:35:39 UTC (rev 8998)
+++ trunk/framework/impl/src/main/java/org/richfaces/component/ComponentPhaseEventHandler.java 2008-06-11 15:16:22 UTC (rev 8999)
@@ -1,9 +0,0 @@
-package org.richfaces.component;
-
-import javax.faces.event.PhaseEvent;
-
-public interface ComponentPhaseEventHandler {
-
- void doBeforePhase(PhaseEvent event);
-
-}
Deleted: trunk/framework/impl/src/main/java/org/richfaces/component/ComponentViewPhaseListener.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/component/ComponentViewPhaseListener.java 2008-06-11 13:35:39 UTC (rev 8998)
+++ trunk/framework/impl/src/main/java/org/richfaces/component/ComponentViewPhaseListener.java 2008-06-11 15:16:22 UTC (rev 8999)
@@ -1,48 +0,0 @@
-package org.richfaces.component;
-
-import java.util.Iterator;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
-
-
-public class ComponentViewPhaseListener implements PhaseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = -2437433246178955788L;
-
- public void afterPhase(PhaseEvent event) {
- }
-
- private void doBeforePhase(PhaseEvent event, UIComponent component) {
- if (component.isRendered()) {
- if (component instanceof ComponentPhaseEventHandler) {
- ((ComponentPhaseEventHandler) component).doBeforePhase(event);
- }
- Iterator<UIComponent> children = component.getFacetsAndChildren();
- while (children.hasNext()) {
- doBeforePhase(event, children.next());
- }
- }
-
- }
-
- public void beforePhase(PhaseEvent event) {
- FacesContext facesContext = event.getFacesContext();
- UIViewRoot viewRoot = facesContext.getViewRoot();
- if (viewRoot != null) {
- doBeforePhase(event, viewRoot);
- }
- }
-
- public PhaseId getPhaseId() {
- return PhaseId.RENDER_RESPONSE;
- }
-
-}
Added: trunk/framework/impl/src/main/java/org/richfaces/event/ComponentViewPhaseListener.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/event/ComponentViewPhaseListener.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/event/ComponentViewPhaseListener.java 2008-06-11 15:16:22 UTC (rev 8999)
@@ -0,0 +1,50 @@
+package org.richfaces.event;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.richfaces.component.ComponentPhaseEventHandler;
+
+
+public class ComponentViewPhaseListener implements PhaseListener {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2437433246178955788L;
+
+ public void afterPhase(PhaseEvent event) {
+ }
+
+ private void doBeforePhase(PhaseEvent event, UIComponent component) {
+ if (component.isRendered()) {
+ if (component instanceof ComponentPhaseEventHandler) {
+ ((ComponentPhaseEventHandler) component).beforePhase(event);
+ }
+ Iterator<UIComponent> children = component.getFacetsAndChildren();
+ while (children.hasNext()) {
+ doBeforePhase(event, children.next());
+ }
+ }
+
+ }
+
+ public void beforePhase(PhaseEvent event) {
+ FacesContext facesContext = event.getFacesContext();
+ UIViewRoot viewRoot = facesContext.getViewRoot();
+ if (viewRoot != null) {
+ doBeforePhase(event, viewRoot);
+ }
+ }
+
+ public PhaseId getPhaseId() {
+ return PhaseId.RENDER_RESPONSE;
+ }
+
+}
Modified: trunk/framework/impl/src/main/resources/META-INF/faces-config.xml
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/faces-config.xml 2008-06-11 13:35:39 UTC (rev 8998)
+++ trunk/framework/impl/src/main/resources/META-INF/faces-config.xml 2008-06-11 15:16:22 UTC (rev 8999)
@@ -18,7 +18,7 @@
<lifecycle>
<phase-listener>org.ajax4jsf.event.AjaxPhaseListener</phase-listener>
<phase-listener>org.ajax4jsf.event.InitPhaseListener</phase-listener>
- <phase-listener>org.richfaces.component.ComponentViewPhaseListener</phase-listener>
+ <phase-listener>org.richfaces.event.ComponentViewPhaseListener</phase-listener>
</lifecycle>
<managed-bean>
<managed-bean-name>a4j</managed-bean-name>
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-06-11 13:35:39 UTC (rev 8998)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-06-11 15:16:22 UTC (rev 8999)
@@ -48,7 +48,7 @@
* JSF component class
*
*/
-public abstract class UIDataTable extends SequenceDataAdaptor implements Sortable2, Filterable, ComponentPhaseEventHandler {
+public abstract class UIDataTable extends SequenceDataAdaptor implements Sortable2, Filterable{
Collection<Object> sortPriority = new ArrayList<Object>();
@@ -83,11 +83,7 @@
public static final String COMPONENT_TYPE = "org.richfaces.DataTable";
public static final String COMPONENT_FAMILY = "org.richfaces.DataTable";
-
- public void doBeforePhase(javax.faces.event.PhaseEvent event) {
- super.resetDataModel();
- }
-
+
@Override
protected ExtendedDataModel createDataModel() {
List<FilterField> filterFields = new LinkedList<FilterField>();
16 years