Author: nbelaevski
Date: 2010-08-30 14:45:51 -0400 (Mon, 30 Aug 2010)
New Revision: 19023
Added:
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
branches/RFPL-434/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml
branches/RFPL-434/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTest.xhtml
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/component/UIDataTableTest.java
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerBean.java
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
branches/RFPL-434/ui/iteration/ui/src/test/resources/org/richfaces/renderkit/dataTableTest.xhtml
Removed:
branches/RFPL-434/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml
Modified:
branches/RFPL-434/
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
branches/RFPL-434/core/impl/src/main/java/org/richfaces/component/UISequence.java
branches/RFPL-434/core/impl/src/main/resources/META-INF/resources/richfaces-queue.js
branches/RFPL-434/dist/readme-ui.txt
branches/RFPL-434/examples/core-demo/src/main/webapp/button.xhtml
branches/RFPL-434/examples/input-demo/src/main/webapp/autocomplete.xhtml
branches/RFPL-434/examples/richfaces-showcase/pom.xml
branches/RFPL-434/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml
branches/RFPL-434/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
branches/RFPL-434/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
branches/RFPL-434/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
branches/RFPL-434/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
branches/RFPL-434/ui/input/ui/src/main/templates/inplaceInput.template.xml
branches/RFPL-434/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
branches/RFPL-434/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractSubTable.java
branches/RFPL-434/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/subtable.js
branches/RFPL-434/ui/iteration/ui/src/main/templates/datascroller.template.xml
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataGridRendererTest.java
branches/RFPL-434/ui/iteration/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
branches/RFPL-434/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
branches/RFPL-434/ui/output/ui/src/main/templates/popupPanel.template.xml
Log:
Merged revisions
18970-18972,18975-18978,18987-18991,18993,18995,19004,19009,19014-19019,19021 via svnmerge
from
https://svn.jboss.org/repos/richfaces/trunk
Property changes on: branches/RFPL-434
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RFPL-754:1-18909 /trunk:1-18969
+ /branches/RFPL-754:1-18909 /trunk:1-19022
Modified:
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml
===================================================================
---
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/pom.xml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -1,6 +1,7 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
+#set(
+$symbol_escape = '\' )
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -73,13 +74,13 @@
<dependencies>
<dependency>
- <groupId>${jsf2.api.groupid}</groupId>
- <artifactId>${jsf2.api.artifactid}</artifactId>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>${jsf2.impl.groupid}</groupId>
- <artifactId>${jsf2.impl.artifactid}</artifactId>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -128,7 +129,7 @@
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>org.richfaces.ui</groupId>
+ <groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<version>${org.richfaces.bom.version}</version>
<scope>import</scope>
Copied:
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
(from rev 19021,
trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml)
===================================================================
---
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml
(rev 0)
+++
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -0,0 +1,11 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+<!--
+ For JBoss AS 6 integration there is a conflict with guava, and
+ google-collections. JBAS-8361
+-->
+ <path name="WEB-INF/classes"></path>
+
+ <path name="WEB-INF/lib/guava-r05.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+</scanning>
\ No newline at end of file
Modified:
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
===================================================================
---
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -1,35 +1,39 @@
<?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>
- <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>Sample RichFaces 4 Application</display-name>
+ <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>
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+ <mime-mapping>
+ <extension>ecss</extension>
+ <mime-type>text/css</mime-type>
+ </mime-mapping>
+ <welcome-file-list>
+ <welcome-file>faces/index.xhtml</welcome-file>
+ </welcome-file-list>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Modified:
branches/RFPL-434/core/impl/src/main/java/org/richfaces/component/UISequence.java
===================================================================
---
branches/RFPL-434/core/impl/src/main/java/org/richfaces/component/UISequence.java 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/core/impl/src/main/java/org/richfaces/component/UISequence.java 2010-08-30
18:45:51 UTC (rev 19023)
@@ -277,7 +277,7 @@
int rowIndex = getRowIndex();
int rows = getRows();
- if (rows > 0) {
+ if (rows > 1) {
return rowIndex % rows;
}
Modified:
branches/RFPL-434/core/impl/src/main/resources/META-INF/resources/richfaces-queue.js
===================================================================
---
branches/RFPL-434/core/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/core/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-08-30
18:45:51 UTC (rev 19023)
@@ -105,6 +105,10 @@
}
}
}
+
+ if (typeof this.queueOptions.requestGroupId == "undefined") {
+ this.queueOptions.requestGroupId = typeof this.source == "string" ?
this.source : this.source.id;
+ }
// copy of event should be created otherwise IE will fail
this.event = $.extend({}, event);
Modified: branches/RFPL-434/dist/readme-ui.txt
===================================================================
--- branches/RFPL-434/dist/readme-ui.txt 2010-08-30 16:51:33 UTC (rev 19022)
+++ branches/RFPL-434/dist/readme-ui.txt 2010-08-30 18:45:51 UTC (rev 19023)
@@ -17,6 +17,8 @@
1.7) slf4j-log4j12 (or whatever else - select the implementation according to logging
framework that you use)
1.8) sac-1.3, cssparser-0.9.5 - required for components CSS work
1.9) google-guava-r06 - core runtime dependency.
+ 1.10) annotations.jar from org.richfaces.cdk . It's optional and should be added
only if some RichFaces components will be
+ created/accessed dynamically from some appication actions/listeners.
For optimal performance it's recommended to add one of these caching frameworks to
application classpath: EhCache, JBoss Cache, OsCache.
Modified: branches/RFPL-434/examples/core-demo/src/main/webapp/button.xhtml
===================================================================
--- branches/RFPL-434/examples/core-demo/src/main/webapp/button.xhtml 2010-08-30 16:51:33
UTC (rev 19022)
+++ branches/RFPL-434/examples/core-demo/src/main/webapp/button.xhtml 2010-08-30 18:45:51
UTC (rev 19023)
@@ -23,11 +23,28 @@
<f:ajax event="action" execute="@form"
render=":out" listener="#{commandBean.listener}" />
</a4j:commandButton>
</h:form>
- <br />
+ <br />
<h:panelGroup id="out">
<h:outputText value="#{commandBean.name}" />
<h:outputText value="!" rendered="#{not empty
commandBean.name}" />
</h:panelGroup>
+ <br /><hr />
+ RF-9146: request grouping id not set:
+ <br />
+ <h:panelGroup id="out1">
+ <h:outputText value="#{commandBean.name}" />
+ </h:panelGroup>
+ <h:form>
+ <a4j:queue requestDelay="5000"/>
+ <a4j:commandButton value="Update 1" render="out1">
+ <a4j:param name="v1" value="Update 1"
assignTo="#{commandBean.name}" />
+ </a4j:commandButton>
+ <a4j:commandButton value="Update 2" render="out1">
+ <a4j:param name="v1" value="Update 2"
assignTo="#{commandBean.name}" />
+ </a4j:commandButton>
+ <hr />
+ <a4j:log level="debug" style="border: solid red 1px"
styleClass="log" mode="popup" />
+ </h:form>
</h:body>
</f:view>
</html>
\ No newline at end of file
Modified: branches/RFPL-434/examples/input-demo/src/main/webapp/autocomplete.xhtml
===================================================================
--- branches/RFPL-434/examples/input-demo/src/main/webapp/autocomplete.xhtml 2010-08-30
16:51:33 UTC (rev 19022)
+++ branches/RFPL-434/examples/input-demo/src/main/webapp/autocomplete.xhtml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -17,7 +17,7 @@
block text block text block text block text block text block text
block text block
- <input:autocomplete autocompleteMethod="#{autoCompleteBean.autocomplete}"
var="country" fetchValue="#{country.name}">
+ <input:autocomplete mode="" minChars="2"
autocompleteMethod="#{autoCompleteBean.autocomplete}" var="country"
fetchValue="#{country.name}" showButton="true">
#{country.name} #{country.iso} #{country.domain}
</input:autocomplete>
Modified: branches/RFPL-434/examples/richfaces-showcase/pom.xml
===================================================================
--- branches/RFPL-434/examples/richfaces-showcase/pom.xml 2010-08-30 16:51:33 UTC (rev
19022)
+++ branches/RFPL-434/examples/richfaces-showcase/pom.xml 2010-08-30 18:45:51 UTC (rev
19023)
@@ -17,37 +17,37 @@
<packaging>war</packaging>
<name>Richfaces Examples: Richfaces Showcase Application</name>
- <properties>
- </properties>
+ <properties>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-components-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-components-ui</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ </dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
@@ -112,13 +112,13 @@
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
- <version>2.2</version>
- </dependency>
+ <version>2.2</version>
+ </dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
- <version>2.2</version>
- </dependency>
+ <version>2.2</version>
+ </dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
Copied:
branches/RFPL-434/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml
(from rev 19021,
trunk/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml)
===================================================================
---
branches/RFPL-434/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml
(rev 0)
+++
branches/RFPL-434/examples/richfaces-showcase/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -0,0 +1,11 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+<!--
+ For JBoss AS 6 integration there is a conflict with guava, and
+ google-collections. JBAS-8361
+-->
+ <path name="WEB-INF/classes"></path>
+
+ <path name="WEB-INF/lib/guava-r05.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+</scanning>
\ No newline at end of file
Modified: branches/RFPL-434/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml
===================================================================
---
branches/RFPL-434/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/examples/richfaces-showcase/src/main/webapp/WEB-INF/web.xml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -1,52 +1,58 @@
-<?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"
- id="richfaces-showcase" version="2.5">
- <display-name>richfaces-showcase</display-name>
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- <welcome-file>index.htm</welcome-file>
- <welcome-file>index.jsp</welcome-file>
- <welcome-file>default.html</welcome-file>
- <welcome-file>default.htm</welcome-file>
- <welcome-file>default.jsp</welcome-file>
- </welcome-file-list>
- <context-param>
- <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
- <param-value>/WEB-INF/app-tags.taglib.xml</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>false</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.skin</param-name>
- <param-value>#{skinBean.skin}</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.PROJECT_STAGE</param-name>
- <param-value>Development</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>server</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>
-</web-app>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="richfaces-showcase" 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>richfaces-showcase</display-name>
+ <context-param>
+ <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
+ <param-value>/WEB-INF/app-tags.taglib.xml</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>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.skin</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</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>
+ <mime-mapping>
+ <extension>ecss</extension>
+ <mime-type>text/css</mime-type>
+ </mime-mapping>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Modified:
branches/RFPL-434/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
===================================================================
---
branches/RFPL-434/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-08-30
18:45:51 UTC (rev 19023)
@@ -24,6 +24,7 @@
import javax.faces.component.UIInput;
import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
@@ -62,4 +63,84 @@
@Attribute
public abstract String getTabIndex();
+
+ @Attribute(events=@EventName("blur"))
+ public abstract String getOnblur();
+
+ @Attribute(events=@EventName("click"))
+ public abstract String getOnclick();
+
+ @Attribute(events=@EventName("ondblclick"))
+ public abstract String getOndblclick();
+
+ @Attribute(events=@EventName("focus"))
+ public abstract String getOnfocus();
+
+ @Attribute(events=@EventName("keydown"))
+ public abstract String getOnkeydown();
+
+ @Attribute(events=@EventName("keypress"))
+ public abstract String getOnkeypress();
+
+ @Attribute(events=@EventName("keyup"))
+ public abstract String getOnkeypup();
+
+ @Attribute(events=@EventName("mousedown"))
+ public abstract String getOnmousedown();
+
+ @Attribute(events=@EventName("mousemove"))
+ public abstract String getOnmousemove();
+
+ @Attribute(events=@EventName("mouseout"))
+ public abstract String getOnmouseout();
+
+ @Attribute(events=@EventName("mouseover"))
+ public abstract String getOnmouseover();
+
+ @Attribute(events=@EventName("mouseup"))
+ public abstract String getOnmouseup();
+
+ @Attribute(events=@EventName("inputClick"))
+ public abstract String getOnInputClick();
+
+ @Attribute(events=@EventName("inputDblclick"))
+ public abstract String getOnInputDblclick();
+
+ @Attribute(events=@EventName("inputMousedown"))
+ public abstract String getOnInputMousedown();
+
+ @Attribute(events=@EventName("inputMousemove"))
+ public abstract String getOnInputMousemove();
+
+ @Attribute(events=@EventName("inputMouseout"))
+ public abstract String getOnInputMouseout();
+
+ @Attribute(events=@EventName("inputMouseover"))
+ public abstract String getOnInputMouseover();
+
+ @Attribute(events=@EventName("inputMouseup"))
+ public abstract String getOnInputMouseup();
+
+ @Attribute(events=@EventName("inputKeydown"))
+ public abstract String getOnInputKeydown();
+
+ @Attribute(events=@EventName("inputKeypress"))
+ public abstract String getOnInputKeypress();
+
+ @Attribute(events=@EventName("oninputKeyup"))
+ public abstract String getOnInputKeypup();
+
+ @Attribute(events=@EventName("inputFocus"))
+ public abstract String getOnInputFocus();
+
+ @Attribute(events=@EventName("inputBlur"))
+ public abstract String getOnInputBlur();
+
+ @Attribute(events=@EventName("select"))
+ public abstract String getOnselect();
+
+ @Attribute(events=@EventName("change"))
+ public abstract String getOnchange();
+
+ //TODO: what is default event?, add onViewActivated, onEditActivated events support
}
Modified:
branches/RFPL-434/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
---
branches/RFPL-434/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2010-08-30
18:45:51 UTC (rev 19023)
@@ -22,6 +22,7 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -35,6 +36,7 @@
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.renderkit.RendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.AbstractInplaceInput;
import org.richfaces.component.InplaceState;
import org.richfaces.component.util.HtmlUtil;
@@ -57,6 +59,8 @@
public static final String OPTIONS_INPUT = "input";
+ public static final String OPTIONS_FOCUS = "focusElement";
+
public static final String OPTIONS_BTN_OK = "okbtn";
public static final String OPTIONS_LABEL = "label";
@@ -79,6 +83,38 @@
private static final String NONE_CSS = "rf-ii-none";
+ private static final Map<String, ComponentAttribute>
INPLACEINPUT_HANDLER_ATTRIBUTES = Collections
+ .unmodifiableMap(ComponentAttribute.createMap(
+ new
ComponentAttribute(HTML.ONCLICK_ATTRIBUTE).setEventNames("inputClick").
+ setComponentAttributeName("onInputClick"),
+ new
ComponentAttribute(HTML.ONDBLCLICK_ATTRIBUTE).setEventNames("inputDblclick").
+ setComponentAttributeName("onInputDblclick"),
+ new
ComponentAttribute(HTML.ONMOUSEDOWN_ATTRIBUTE).setEventNames("inputMousedown").
+ setComponentAttributeName("onInputMousedown"),
+ new
ComponentAttribute(HTML.ONMOUSEUP_ATTRIBUTE).setEventNames("inputMouseup").
+ setComponentAttributeName("onInputMouseup"),
+ new
ComponentAttribute(HTML.ONMOUSEOVER_ATTRIBUTE).setEventNames("inputMouseover").
+ setComponentAttributeName("onInputMouseover"),
+ new
ComponentAttribute(HTML.ONMOUSEMOVE_ATTRIBUTE).setEventNames("inputMousemove").
+ setComponentAttributeName("onInputMousemove"),
+ new
ComponentAttribute(HTML.ONMOUSEOUT_ATTRIBUTE).setEventNames("inputMouseout").
+ setComponentAttributeName("onInputMouseout"),
+ new
ComponentAttribute(HTML.ONKEYPRESS_ATTRIBUTE).setEventNames("inputKeypress").
+ setComponentAttributeName("onInputKeypress"),
+ new
ComponentAttribute(HTML.ONKEYDOWN_ATTRIBUTE).setEventNames("inputKeydown").
+ setComponentAttributeName("onInputKeydown"),
+ new
ComponentAttribute(HTML.ONKEYUP_ATTRIBUTE).setEventNames("inputKeyup").
+ setComponentAttributeName("onInputKeyup"),
+ new
ComponentAttribute(HTML.ONBLUR_ATTRIBUTE).setEventNames("inputBlur").
+ setComponentAttributeName("onInputBlur"),
+ new
ComponentAttribute(HTML.ONFOCUS_ATTRIBUTE).setEventNames("inputFocus").
+ setComponentAttributeName("onInputFocus"),
+ new
ComponentAttribute(HTML.ONCHANGE_ATTRIBUTE).setEventNames("change").
+ setComponentAttributeName("onchange"),
+ new
ComponentAttribute(HTML.ONSELECT_ATTRIBUTE).setEventNames("select").
+ setComponentAttributeName("onselect")
+ ));
+
@Override
protected void doDecode(FacesContext facesContext, UIComponent component) {
@@ -90,6 +126,10 @@
}
}
+ protected void renderInputHandlers(FacesContext facesContext, UIComponent component)
throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component,
INPLACEINPUT_HANDLER_ATTRIBUTES);
+ }
+
public InplaceState getInplaceState(UIComponent component) {
return ((AbstractInplaceInput) component).getState();
}
@@ -147,6 +187,7 @@
options.put(OPTIONS_EDIT_CONTAINER, clientId + ":edit");
options.put(OPTIONS_INPUT, clientId + ":input");
options.put(OPTIONS_LABEL, clientId + ":label");
+ options.put(OPTIONS_FOCUS, clientId + ":focus");
boolean showControls = inplaceInput.isShowControls();
options.put(OPTIONS_SHOWCONTROLS, showControls);
Modified:
branches/RFPL-434/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js
===================================================================
---
branches/RFPL-434/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/Autocomplete.js 2010-08-30
18:45:51 UTC (rev 19023)
@@ -6,7 +6,19 @@
this.cache = {}
this.cache[this.key] = items || [];
this.values = typeof values != "function" ? values || this.cache[this.key] :
values(items);
+ this.useCache = checkValuesPrefix.call(this);
};
+
+ var checkValuesPrefix = function () {
+ var result = true;
+ for (var i = 0; i<this.values.length; i++) {
+ if (this.values[i].indexOf(this.key)!=0) {
+ result = false;
+ break;
+ }
+ }
+ return result;
+ }
var getItems = function (key) {
key = key.toLowerCase();
@@ -45,7 +57,7 @@
var isCached = function (key) {
key = key.toLowerCase();
- return this.cache[key] || this.key.indexOf(key)==0;
+ return this.cache[key] || this.useCache && key.indexOf(this.key)==0;
};
$.extend(rf.utils.Cache.prototype, (function () {
@@ -173,7 +185,7 @@
};
var autoFill = function (inputValue, value) {
- if( this.options.autofill) {
+ if( this.options.autofill && value.toLowerCase().indexOf(inputValue)==0) {
var field = rf.getDomElement(this.fieldId);
var start = rf.Selection.getStart(field);
this.setInputValue(inputValue + value.substring(inputValue.length));
@@ -184,7 +196,7 @@
var callAjax = function(event, value) {
- $(rf.getDomElement(this.id+ID.ITEMS)).removeData().empty();
+ clearItems.call(this);
rf.getDomElement(this.id+ID.VALUE).value = value;
@@ -245,18 +257,24 @@
this.items = $(newItems);
//TODO: works only with simple markup, not with <tr>
$(rf.getDomElement(this.id+ID.ITEMS)).empty().append(newItems);
- }
+ };
+ var clearItems = function () {
+ $(rf.getDomElement(this.id+ID.ITEMS)).removeData().empty();
+ this.items = [];
+ };
+
var onChangeValue = function (event, value) {
selectItem.call(this);
+ this.index = -1;
// value is undefined if called from AutocompleteBase onChange
var subValue = (typeof value == "undefined") ? this.__getSubValue() : value;
+ var oldValue = this.value;
+ this.value = subValue;
if (this.cache && this.cache.isCached(subValue)) {
updateItemsFromCache.call(this, subValue);
- this.index = -1;
- this.value = subValue;
if (this.options.selectFirst) {
if (event.which == rf.KEYS.RETURN || event.type == "click") {
this.setInputValue(subValue);
@@ -265,11 +283,17 @@
}
}
} else {
+ if (event.which == rf.KEYS.RETURN || event.type == "click") {
+ this.setInputValue(subValue);
+ }
if (subValue.length>=this.options.minChars) {
- if (this.options.ajaxMode && this.value!=subValue) {
- this.value = subValue;
+ if (this.options.ajaxMode && oldValue!=subValue) {
this.options.ajaxMode && callAjax.call(this, event, subValue);
}
+ } else {
+ if (this.options.ajaxMode) {
+ clearItems.call(this);
+ }
}
}
Modified:
branches/RFPL-434/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
---
branches/RFPL-434/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-08-30
18:45:51 UTC (rev 19023)
@@ -29,7 +29,7 @@
this.attachToDom(id);
this.namespace = this.namespace ||
"."+rf.Event.createNamespace(this.name, this.id);
-
+
this.currentState = options.state;
this.editEvent = options.editEvent;
this.noneCss = options.noneCss;
@@ -40,6 +40,7 @@
this.editContainer = $(document.getElementById(options.editContainer));
this.input = $(document.getElementById(options.input));
this.label = $(document.getElementById(options.label));
+ this.focusElement = $(document.getElementById(options.focusElement));
this.initialValue = this.label.text();
this.element.bind(this.editEvent, $.proxy(this.__editHandler, this));
@@ -94,13 +95,14 @@
}
isSaved = true;
this.__hide();
- },
+ },
cancel: function() {
var text = this.label.text();
this.input.val(text);
isSaved = true;
this.__hide();
+ this.element.focus();
},
setValue: function (value) {
@@ -113,7 +115,7 @@
},
/****************** private methods *****************************************/
-
+
__saveBtnHandler: function(e) {
this.save();
return false;
@@ -140,6 +142,7 @@
if(!isSaved) {
this.save();
}
+ return false;
},
__scrollHandler: function(e) {
@@ -169,7 +172,7 @@
rf.Event.unbindScrollEventHandlers(this.scrollElements, this);
this.scrollElements = null;
this.editContainer.addClass(this.noneCss);
- this.input.blur();
+ this.focusElement.focus();
},
destroy: function () {
Modified: branches/RFPL-434/ui/input/ui/src/main/templates/inplaceInput.template.xml
===================================================================
--- branches/RFPL-434/ui/input/ui/src/main/templates/inplaceInput.template.xml 2010-08-30
16:51:33 UTC (rev 19022)
+++ branches/RFPL-434/ui/input/ui/src/main/templates/inplaceInput.template.xml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -23,9 +23,13 @@
<span id="#{clientId}:label" class="rf-ii-lbl">
#{inplaceValue}
</span>
+ <input id="#{clientId}:focus" type="image"
style="position: absolute; top: 0px; left: 0px; outline-style: none;"
class="rf-ii-none"/>
<span id="#{clientId}:edit" class="#{getEditStyleClass(component,
inplaceState)}">
- <input id="#{clientId}:input" autocomplete="off"
name="#{clientId}:input" type="text" value="#{inplaceValue}"
class="rf-ii-f" cdk:passThrough="tabIndex" style="width:
#{component.attributes['inputWidth']};" />
-
+ <input id="#{clientId}:input" autocomplete="off"
name="#{clientId}:input"
+ type="text" value="#{inplaceValue}" class="rf-ii-f"
style="width: #{component.attributes['inputWidth']};"
+ cdk:passThrough="tabIndex">
+ <cdk:call expression="renderInputHandlers(facesContext,
component);"/>
+ </input>
<c:if test="#{component.attributes['showControls']}">
<span class="rf-ii-btn-prepos">
<span class="rf-ii-btn-pos">
Modified:
branches/RFPL-434/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
===================================================================
---
branches/RFPL-434/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-08-30
18:45:51 UTC (rev 19023)
@@ -51,16 +51,14 @@
environment = new HtmlUnitEnvironment();
environment.withWebRoot(new File("src/test/resources"));
environment.withResource("/WEB-INF/faces-config.xml",
"org/richfaces/renderkit/faces-config.xml");
- environment.withResource("/test.xhtml",
"org/richfaces/renderkit/rendererTest.xhtml");
+ environment.withResource("/test.xhtml",
"org/richfaces/renderkit/inplaceInputTest.xhtml");
environment.start();
}
@Test
public void testRenderDefaultState() throws Exception {
HtmlPage page = environment.getPage("/test.jsf");
- List<?> nodes = page.getByXPath("//*[@id =
'form:input_default']");
- assertEquals(1, nodes.size());
- HtmlElement span = (HtmlElement) nodes.get(0);
+ HtmlElement span = page.getFirstByXPath("//*[@id =
'form:input_default']");
assertEquals("span", span.getNodeName());
assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
@@ -70,7 +68,7 @@
DomNode text = label.getFirstChild();
assertEquals(DomNode.TEXT_NODE, text.getNodeType());
- HtmlElement edit = (HtmlElement)label.getNextSibling();
+ HtmlElement edit = page.getFirstByXPath("//*[@id =
'form:input_default:edit']");
assertEquals("span", edit.getNodeName());
assertEquals("rf-ii-e-s rf-ii-none",
edit.getAttribute(HTML.CLASS_ATTRIBUTE));
@@ -88,9 +86,7 @@
HtmlPage page = environment.getPage("/test.jsf");
- List<?> nodes = page.getByXPath("//*[@id =
'form:input_edit']");
- assertEquals(1, nodes.size());
- HtmlElement span = (HtmlElement) nodes.get(0);
+ HtmlElement span = page.getFirstByXPath("//*[@id =
'form:input_edit']");
assertEquals("span", span.getNodeName());
assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
@@ -100,7 +96,7 @@
DomNode text = label.getFirstChild();
assertEquals(DomNode.TEXT_NODE, text.getNodeType());
- HtmlElement edit = (HtmlElement)label.getNextSibling();
+ HtmlElement edit = page.getFirstByXPath("//*[@id =
'form:input_edit:edit']");
assertEquals("span", edit.getNodeName());
assertEquals("rf-ii-e-s", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
@@ -109,24 +105,15 @@
assertEquals("rf-ii-f", input.getAttribute(HTML.CLASS_ATTRIBUTE));
assertEquals(text.getNodeValue(), input.getAttribute(HTML.VALUE_ATTRIBUTE));
- List<?> buttonNodes = page.getByXPath("//*[@id =
'form:input_edit:btn']");
- assertEquals(1, buttonNodes.size());
-
- HtmlElement button = (HtmlElement) buttonNodes.get(0);
+ HtmlElement button = page.getFirstByXPath("//*[@id =
'form:input_edit:btn']");
assertEquals("span", button.getNodeName());
- List<?> okButtonNodes = page.getByXPath("//*[@id =
'form:input_edit:okbtn']");
- assertEquals(1, okButtonNodes.size());
-
- HtmlElement okButton = (HtmlElement) okButtonNodes.get(0);
+ HtmlElement okButton = page.getFirstByXPath("//*[@id =
'form:input_edit:okbtn']");
assertEquals("input", okButton.getNodeName());
assertEquals("rf-ii-btn",
okButton.getAttribute(HTML.CLASS_ATTRIBUTE));
assertEquals("image", okButton.getAttribute(HTML.TYPE_ATTR));
- List<?> cancelButtonNodes = page.getByXPath("//*[@id =
'form:input_edit:cancelbtn']");
- assertEquals(1, cancelButtonNodes.size());
-
- HtmlElement cancelButton = (HtmlElement) cancelButtonNodes.get(0);
+ HtmlElement cancelButton = page.getFirstByXPath("//*[@id =
'form:input_edit:cancelbtn']");
assertEquals("input", cancelButton.getNodeName());
assertEquals("rf-ii-btn",
cancelButton.getAttribute(HTML.CLASS_ATTRIBUTE));
assertEquals("image", cancelButton.getAttribute(HTML.TYPE_ATTR));
@@ -137,97 +124,62 @@
public void testEdit() throws Exception {
HtmlPage page = environment.getPage("/test.jsf");
edit(page, "input_default", "Another Test String");
-
blur(page);
-
- List<?> labelNodes = page.getByXPath("//*[@id =
'form:input_default:label']/text()");
- assertEquals(1, labelNodes.size());
- DomText text = (DomText) labelNodes.get(0);
+ DomText text = page.getFirstByXPath("//*[@id =
'form:input_default:label']/text()");
assertEquals("Another Test String", text.getTextContent());
-
- List<?>nodes = page.getByXPath("//*[@id =
'form:input_default']");
- assertEquals(1, nodes.size());
- HtmlElement span = (HtmlElement) nodes.get(0);
+ HtmlElement span = page.getFirstByXPath("//*[@id =
'form:input_default']");
assertEquals("rf-ii-d-s rf-ii-c-s",
span.getAttribute(HTML.CLASS_ATTRIBUTE));
-
}
private void blur(HtmlPage page) throws Exception {
- List<?> panelNodes = page.getByXPath("//*[@id =
'form:panel']");
- assertEquals(1, panelNodes.size());
- HtmlElement panel = (HtmlElement) panelNodes.get(0);
+ HtmlElement panel = page.getFirstByXPath("//*[@id =
'form:panel']");
panel.click();
}
private void typeNewValue(HtmlPage page, String inplaceInputId, String value) throws
Exception {
- List<?> inputNodes = page.getByXPath("//*[@id = 'form:" +
inplaceInputId + ":input']");
- assertEquals(1, inputNodes.size());
- HtmlElement input = (HtmlElement) inputNodes.get(0);
+ HtmlElement input = page.getFirstByXPath("//*[@id = 'form:" +
inplaceInputId + ":input']");
input.setAttribute(HTML.VALUE_ATTRIBUTE, "");
input.type(value);
}
private void edit(HtmlPage page, String inplaceInputId, String value) throws
Exception {
- List<?> nodes = page.getByXPath("//*[@id = 'form:" +
inplaceInputId + "']");
- assertEquals(1, nodes.size());
- HtmlElement span = (HtmlElement) nodes.get(0);
+ HtmlElement span = page.getFirstByXPath("//*[@id = 'form:" +
inplaceInputId + "']");
span.click();
-
- List<?> editNodes = page.getByXPath("//*[@id = 'form:" +
inplaceInputId + ":edit']");
- assertEquals(1, editNodes.size());
- HtmlElement edit = (HtmlElement) editNodes.get(0);
+ HtmlElement edit = page.getFirstByXPath("//*[@id = 'form:" +
inplaceInputId + ":edit']");
assertEquals("rf-ii-e-s", edit.getAttribute(HTML.CLASS_ATTRIBUTE));
-
typeNewValue(page, inplaceInputId, value);
}
@Test
public void testEditWithControls() throws Exception {
HtmlPage page = environment.getPage("/test.jsf");
-
edit(page, "input_controls", "Another Test String");
-
- List<?> cancelNodes = page.getByXPath("//*[@id =
'form:input_controls:cancelbtn']");
- assertEquals(1, cancelNodes.size());
- HtmlElement cancel = (HtmlElement) cancelNodes.get(0);
-
+
+ HtmlElement cancel = page.getFirstByXPath("//*[@id =
'form:input_controls:cancelbtn']");
cancel.mouseDown();
- List<?> labelNodes = page.getByXPath("//*[@id =
'form:input_controls:label']/text()");
- assertEquals(1, labelNodes.size());
- DomText text = (DomText) labelNodes.get(0);
+ DomText text = page.getFirstByXPath("//*[@id =
'form:input_controls:label']/text()");
assertEquals("Test String", text.getTextContent());
- List<?> nodes = page.getByXPath("//*[@id =
'form:input_controls']");
- assertEquals(1, nodes.size());
- HtmlElement span = (HtmlElement) nodes.get(0);
+ HtmlElement span = page.getFirstByXPath("//*[@id =
'form:input_controls']");
assertEquals("rf-ii-d-s", span.getAttribute(HTML.CLASS_ATTRIBUTE));
edit(page, "input_controls", "Another Test String");
- List<?> okNodes = page.getByXPath("//*[@id =
'form:input_controls:okbtn']");
- assertEquals(1, okNodes.size());
- HtmlElement ok = (HtmlElement) okNodes.get(0);
-
+ HtmlElement ok = page.getFirstByXPath("//*[@id =
'form:input_controls:okbtn']");
ok.mouseDown();
- labelNodes = page.getByXPath("//*[@id =
'form:input_controls:label']/text()");
- assertEquals(1, labelNodes.size());
- text = (DomText) labelNodes.get(0);
+ text = page.getFirstByXPath("//*[@id =
'form:input_controls:label']/text()");
assertEquals("Another Test String", text.getTextContent());
- nodes = page.getByXPath("//*[@id = 'form:input_controls']");
- assertEquals(1, nodes.size());
- span = (HtmlElement) nodes.get(0);
+ span = page.getFirstByXPath("//*[@id =
'form:input_controls']");
assertEquals("rf-ii-d-s rf-ii-c-s",
span.getAttribute(HTML.CLASS_ATTRIBUTE));
edit(page, "input_controls", "Test String");
blur(page);
- labelNodes = page.getByXPath("//*[@id =
'form:input_controls:label']/text()");
- assertEquals(1, labelNodes.size());
- text = (DomText) labelNodes.get(0);
+ text = page.getFirstByXPath("//*[@id =
'form:input_controls:label']/text()");
assertEquals("Test String", text.getTextContent());
}
Copied:
branches/RFPL-434/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTest.xhtml
(from rev 19021,
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTest.xhtml)
===================================================================
---
branches/RFPL-434/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTest.xhtml
(rev 0)
+++
branches/RFPL-434/ui/input/ui/src/test/resources/org/richfaces/renderkit/inplaceInputTest.xhtml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -0,0 +1,26 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:in="http://richfaces.org/input">
+<f:view contentType="text/html" />
+
+<h:head>
+ <title>Richfaces InplaceInput</title>
+</h:head>
+
+<h:body>
+ <h:form id="form">
+ <in:inplaceInput id="input_default"
value="#{dataBean.value}"/>
+
+ <in:inplaceInput id="input_controls" showControls="true"
value="#{dataBean.value}"/>
+
+ <in:inplaceInput id="input_edit" state="edit"
showControls="true" value="#{dataBean.value}"/>
+
+ <h:panelGroup id="panel">
+ <!-- click here for blur -->
+ </h:panelGroup>
+ </h:form>
+</h:body>
+</html>
Deleted:
branches/RFPL-434/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml
===================================================================
---
branches/RFPL-434/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/input/ui/src/test/resources/org/richfaces/renderkit/rendererTest.xhtml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -1,26 +0,0 @@
-<!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:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:in="http://richfaces.org/input">
-<f:view contentType="text/html" />
-
-<h:head>
- <title>Richfaces InplaceInput</title>
-</h:head>
-
-<h:body>
- <h:form id="form">
- <in:inplaceInput id="input_default"
value="#{dataBean.value}"/>
-
- <in:inplaceInput id="input_controls" showControls="true"
value="#{dataBean.value}"/>
-
- <in:inplaceInput id="input_edit" state="edit"
showControls="true" value="#{dataBean.value}"/>
-
- <h:panelGroup id="panel">
- <!-- click here for blur -->
- </h:panelGroup>
- </h:form>
-</h:body>
-</html>
Modified:
branches/RFPL-434/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractSubTable.java
===================================================================
---
branches/RFPL-434/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractSubTable.java 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractSubTable.java 2010-08-30
18:45:51 UTC (rev 19023)
@@ -1,5 +1,5 @@
/*
- * JBoss, Home of Professional Open Source
+* JBoss, Home of Professional Open Source
* Copyright ${year}, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
@@ -69,9 +69,14 @@
expanded
}
- @Attribute(defaultValue = "true")
- public abstract boolean isExpanded();
+ public boolean isExpanded() {
+ return (Boolean)getStateHelper().eval(PropertyKeys.expanded, true);
+ }
+ public void setExpanded(boolean expanded) {
+ getStateHelper().put(PropertyKeys.expanded, expanded);
+ }
+
@Attribute(defaultValue = MODE_CLIENT)
public abstract String getExpandMode();
@@ -79,6 +84,7 @@
if (event instanceof ToggleEvent) {
ToggleEvent toggleEvent = (ToggleEvent) event;
boolean newValue = toggleEvent.isExpanded();
+
getStateHelper().put(PropertyKeys.expanded, newValue);
FacesContext facesContext = getFacesContext();
Modified:
branches/RFPL-434/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/subtable.js
===================================================================
---
branches/RFPL-434/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/subtable.js 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/subtable.js 2010-08-30
18:45:51 UTC (rev 19023)
@@ -85,7 +85,7 @@
},
isExpand: function() {
- return (this.getState() > richfaces.ui.SubTable.collapse);
+ return (parseInt(this.getState()) == richfaces.ui.SubTable.expand);
},
switchState: function(options) {
Modified: branches/RFPL-434/ui/iteration/ui/src/main/templates/datascroller.template.xml
===================================================================
---
branches/RFPL-434/ui/iteration/ui/src/main/templates/datascroller.template.xml 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/iteration/ui/src/main/templates/datascroller.template.xml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -53,7 +53,7 @@
<c:if test="#{controlsState.fastForwardRendered}">
<c:choose>
<c:when test="#{controlsState.fastForwardEnabled}">
- <a id="#{clientId}_ds_ff" class="rf-ds-btn rf-ds-r"
href="javascript:void(0)">
+ <a id="#{clientId}_ds_ff" class="rf-ds-btn rf-ds-r"
href="javascript:void(0);">
»
</a>
</c:when>
@@ -68,7 +68,7 @@
<c:if test="#{controlsState.lastRendered}">
<c:choose>
<c:when test="#{controlsState.lastEnabled}">
- <a id="#{clientId}_ds_l" class="rf-ds-btn rf-ds-r"
href="javascript:void(0)">
+ <a id="#{clientId}_ds_l" class="rf-ds-btn rf-ds-r"
href="javascript:void(0);">
»»
</a>
</c:when>
Copied:
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/component/UIDataTableTest.java
(from rev 19021,
trunk/ui/iteration/ui/src/test/java/org/richfaces/component/UIDataTableTest.java)
===================================================================
---
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/component/UIDataTableTest.java
(rev 0)
+++
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/component/UIDataTableTest.java 2010-08-30
18:45:51 UTC (rev 19023)
@@ -0,0 +1,274 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.component;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.jboss.test.faces.AbstractFacesTest;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.model.Arrangeable;
+import org.richfaces.model.ArrangeableState;
+import org.richfaces.model.FilterField;
+import org.richfaces.model.SortField;
+import org.richfaces.model.SortMode;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class UIDataTableTest extends AbstractFacesTest {
+
+ private class MockArrangeableModel extends ExtendedDataModel<Object> implements
Arrangeable {
+
+ private ArrangeableState state;
+ @Override
+ public Object getRowKey() {
+ return null;
+ }
+
+ @Override
+ public void setRowKey(Object key) {
+ }
+
+ @Override
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object
argument) {
+ }
+
+ @Override
+ public int getRowCount() {
+ return 0;
+ }
+
+ @Override
+ public Object getRowData() {
+ return null;
+ }
+
+ @Override
+ public int getRowIndex() {
+ return 0;
+ }
+
+ @Override
+ public Object getWrappedData() {
+ return null;
+ }
+
+ @Override
+ public boolean isRowAvailable() {
+ return false;
+ }
+
+ @Override
+ public void setRowIndex(int rowIndex) {
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ }
+
+ public void arrange(FacesContext context, ArrangeableState state) {
+ this.state = state;
+ }
+
+ public ArrangeableState getState() {
+ return state;
+ }
+
+ }
+ private UIDataTable table = null;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ setupFacesRequest();
+ table = new UIDataTable();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ table = null;
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link
org.richfaces.component.UIDataTableBase#getRendersChildren()}.
+ */
+ @Test
+ public void testGetRendersChildren() {
+ Assert.assertTrue(table.getRendersChildren());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#dataChildren()}.
+ */
+ @Test
+ public void testDataChildren() {
+ Assert.assertTrue(table.dataChildren() instanceof DataTableDataIterator);
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#fixedChildren()}.
+ */
+ @Test
+ public void testFixedChildren() {
+ Assert.assertTrue(table.fixedChildren() instanceof
DataTableFixedChildrenIterator);
+ }
+
+ /**
+ * Test method for {@link
org.richfaces.component.UIDataTableBase#createExtendedDataModel()}.
+ */
+ @Test
+ public void testCreateExtendedDataModel() {
+ Assert.assertFalse(table.createExtendedDataModel() instanceof Arrangeable);
+ List<String> sortPriority = Arrays.asList("id2", "id0",
"id1");
+ List<UIComponent> children = table.getChildren();
+ ExpressionFactory expressionFactory =
facesContext.getApplication().getExpressionFactory();
+ ELContext elContext = facesContext.getELContext();
+ UIColumn column = new UIColumn();
+ column.setRendered(false);
+ children.add(column);
+ for (int i = 0; i < sortPriority.size(); i++) {
+ UIColumn child = new UIColumn();
+ child.setId("id" + i);
+ child.setValueExpression("filterExpression", expressionFactory
+ .createValueExpression(elContext, "#{'id" + i +
"'}", Object.class));
+ child.setValueExpression("sortBy", expressionFactory
+ .createValueExpression(elContext, "#{'id" + i +
"'}", Object.class));
+ child.setSortOrder(SortOrder.ascending);
+ children.add(child);
+ }
+ Assert.assertTrue(table.createExtendedDataModel() instanceof Arrangeable);
+ MockArrangeableModel model = new MockArrangeableModel();
+ table.setValue(model);
+ table.setSortPriority(sortPriority);
+ Assert.assertSame(model, table.createExtendedDataModel());
+ ArrangeableState state = model.getState();
+ List<FilterField> filterFields = state.getFilterFields();
+ for (int i = 0; i < sortPriority.size(); i++) {
+ Assert.assertEquals("id" + i ,
filterFields.get(i).getFilterExpression().getValue(elContext));
+ }
+ List<SortField> sortFields = state.getSortFields();
+ for (int i = 0; i < sortPriority.size(); i++) {
+ Assert.assertEquals(sortPriority.get(i),
sortFields.get(i).getSortBy().getValue(elContext));
+ }
+ Assert.assertEquals(facesContext.getViewRoot().getLocale(), state.getLocale());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#columns()}.
+ */
+ @Test
+ public void testColumns() {
+ Assert.assertTrue(table.columns() instanceof DataTableColumnsIterator);
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getHeader()}.
+ */
+ @Test
+ public void testGetHeader() {
+ UIOutput component = new UIOutput();
+ table.getFacets().put("header", component);
+ Assert.assertSame(component, table.getHeader());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getFooter()}.
+ */
+ @Test
+ public void testGetFooter() {
+ UIOutput component = new UIOutput();
+ table.getFacets().put("footer", component);
+ Assert.assertSame(component, table.getFooter());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getFilterVar()}
and
+ * {@link org.richfaces.component.UIDataTableBase#setFilterVar(java.lang.String)}.
+ */
+ @Test
+ public void testFilterVar() {
+ String string = "fv";
+ table.setFilterVar(string);
+ Assert.assertEquals(string, table.getFilterVar());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getSortPriority()}
and
+ * {@link
org.richfaces.component.UIDataTableBase#setSortPriority(java.util.Collection)}.
+ */
+ @Test
+ public void testSortPriority() {
+ table.setSortPriority(Collections.EMPTY_LIST);
+ Assert.assertEquals(Collections.EMPTY_LIST, table.getSortPriority());
+ }
+
+ /**
+ * Test method for {@link org.richfaces.component.UIDataTableBase#getSortMode()} and
+ * {@link
org.richfaces.component.UIDataTableBase#setSortMode(org.richfaces.model.SortMode)}.
+ */
+ @Test
+ public void testSortMode() {
+ table.setSortMode(SortMode.multi);
+ Assert.assertEquals(SortMode.multi, table.getSortMode());
+ }
+
+ /**
+ * Test method for {@link
org.richfaces.component.UIDataTableBase#isColumnFacetPresent(java.lang.String)}.
+ */
+ @Test
+ public void testIsColumnFacetPresent() {
+ String facetName = "header";
+ Assert.assertFalse(table.isColumnFacetPresent(facetName));
+ UIColumn child = new UIColumn();
+ List<UIComponent> children = table.getChildren();
+ children.add(new UIColumn());
+ children.add(child);
+ Assert.assertFalse(table.isColumnFacetPresent(facetName));
+ child.getFacets().put(facetName, new UIOutput());
+ Assert.assertTrue(table.isColumnFacetPresent(facetName));
+ child.setRendered(false);
+ Assert.assertFalse(table.isColumnFacetPresent(facetName));
+ }
+}
Modified:
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataGridRendererTest.java
===================================================================
---
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataGridRendererTest.java 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataGridRendererTest.java 2010-08-30
18:45:51 UTC (rev 19023)
@@ -15,7 +15,6 @@
import org.junit.Before;
import org.junit.Test;
import org.richfaces.component.AbstractDataGrid;
-import org.richfaces.component.UIDataGrid;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
Copied:
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerBean.java
(from rev 19021,
trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerBean.java)
===================================================================
---
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerBean.java
(rev 0)
+++
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerBean.java 2010-08-30
18:45:51 UTC (rev 19023)
@@ -0,0 +1,38 @@
+package org.richfaces.renderkit;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DataScrollerBean {
+
+ private List<String> content;
+
+ private int pageNumber = 1;
+
+
+ public DataScrollerBean() {
+ content = new ArrayList<String>();
+ content.add("1 page content");
+ content.add("2 page content");
+ content.add("3 page content");
+ content.add("4 page content");
+ content.add("5 page content");
+ content.add("6 page content");
+ }
+
+ public List<String> getContent() {
+ return content;
+ }
+
+ public void setContent(List<String> content) {
+ this.content = content;
+ }
+
+ public int getPageNumber() {
+ return pageNumber;
+ }
+
+ public void setPageNumber(int pageNumber) {
+ this.pageNumber = pageNumber;
+ }
+}
Copied:
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
(from rev 19021,
trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java)
===================================================================
---
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
(rev 0)
+++
branches/RFPL-434/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java 2010-08-30
18:45:51 UTC (rev 19023)
@@ -0,0 +1,440 @@
+package org.richfaces.renderkit;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.util.List;
+
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.html.DomNode;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class DataScrollerRenderTest {
+
+ private HtmlUnitEnvironment environment;
+
+ @Before
+ public void setUp() {
+ environment = new HtmlUnitEnvironment();
+ environment.withWebRoot(new File("src/test/resources"));
+ environment.withResource("/WEB-INF/faces-config.xml",
"org/richfaces/renderkit/faces-config.xml");
+ environment.withResource("/test.xhtml",
"org/richfaces/renderkit/dataTableTest.xhtml");
+ environment.start();
+ }
+
+ @Test
+ public void testEncoding() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+
+ String scrollerId = "scroller1";
+ //first scroll
+ List<?> nodes = page.getByXPath("//*[@id =
'form:scroller1']");
+
+ assertEquals(1, nodes.size());
+ HtmlElement span = (HtmlElement) nodes.get(0);
+ assertEquals("span", span.getNodeName());
+ assertEquals("rf-ds", span.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // first/fastRewind buttons with arrows
+ HtmlElement first = getFirstButton(page, scrollerId);
+ assertEquals("span", first.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
first.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ HtmlElement fastRewind = getFastRewindButton(page, scrollerId);
+ assertEquals("span", fastRewind.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
fastRewind.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // currently selected digital button
+ HtmlElement dc = getDigitalButton(page, scrollerId, 1);
+ assertEquals("span", dc.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
dc.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // digital buttons
+ HtmlElement d2 = getDigitalButton(page, scrollerId, 2);
+ assertEquals("a", d2.getNodeName());
+ assertEquals("rf-ds-dtl",
d2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("javascript:void(0);", d2.getAttribute(HTML.HREF_ATTR));
+
+ HtmlElement d3 = getDigitalButton(page, scrollerId, 3);
+ assertEquals("a", d3.getNodeName());
+ assertEquals("rf-ds-dtl",
d3.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("javascript:void(0);", d3.getAttribute(HTML.HREF_ATTR));
+
+ HtmlElement d4 = getDigitalButton(page, scrollerId, 4);
+ assertEquals("a", d4.getNodeName());
+ assertEquals("rf-ds-dtl",
d4.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("javascript:void(0);", d4.getAttribute(HTML.HREF_ATTR));
+
+ HtmlElement d5 = getDigitalButton(page, scrollerId, 5);
+ assertEquals("a", d5.getNodeName());
+ assertEquals("rf-ds-dtl",
d5.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("javascript:void(0);", d5.getAttribute(HTML.HREF_ATTR));
+
+ HtmlElement d6 = getDigitalButton(page, scrollerId, 6);
+ assertEquals("a", d6.getNodeName());
+ assertEquals("rf-ds-dtl",
d6.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("javascript:void(0);", d6.getAttribute(HTML.HREF_ATTR));
+
+ // last/fastForward buttons with arrows
+ HtmlElement fastForward = getFastForwardButton(page, scrollerId);
+ assertEquals("a", fastForward.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-r",
fastForward.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("javascript:void(0);",
fastForward.getAttribute(HTML.HREF_ATTR));
+
+ HtmlElement last = getLastButton(page, scrollerId);
+ assertEquals("a", last.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-r",
last.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("javascript:void(0);",
last.getAttribute(HTML.HREF_ATTR));
+ }
+
+ @Test
+ public void testOutDataScrollerFirstLastButtons() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+ String firstScrollerId = "scroller1";
+
+ //dataScroller inside dataTable 'footer' facet
+ String secondScrollerId = "richTable:scroller2";
+
+ HtmlElement last = getLastButton(page, firstScrollerId);
+ last.click();
+ checkLastPageButtons(page, firstScrollerId, secondScrollerId);
+
+ HtmlElement first = getFirstButton(page, firstScrollerId);
+ first.click();
+ checkFirstPageButtons(page, firstScrollerId, secondScrollerId);
+ }
+
+ @Test
+ public void testInnerDataScrollerFirstLastButtons() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+ String firstScrollerId = "scroller1";
+
+ //dataScroller inside dataTable 'footer' facet
+ String secondScrollerId = "richTable:scroller2";
+
+ HtmlElement last = getLastButton(page, secondScrollerId);
+ last.click();
+ checkLastPageButtons(page, firstScrollerId, secondScrollerId);
+
+ HtmlElement first = getFirstButton(page, secondScrollerId);
+ first.click();
+ checkFirstPageButtons(page, firstScrollerId, secondScrollerId);
+ }
+
+ @Test
+ public void testOutDataScrollerFastButtons() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+ String firstScrollerId = "scroller1";
+
+ //dataScroller inside dataTable 'footer' facet
+ String secondScrollerId = "richTable:scroller2";
+
+ for(int i = 2; i <= 6; i++) {
+ HtmlElement ff = getFastForwardButton(page, firstScrollerId);
+
+ ff.click();
+
+ HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
+ assertEquals("span", currentDigital1.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // if scroller inside dataTable has switched
+ HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
+ assertEquals("span", currentDigital2.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // check if page has switched
+ assertEquals(i + " page content", getCurrentPageContent(page, i));
+ }
+
+ checkLastPageButtons(page, firstScrollerId, secondScrollerId);
+
+ //scroll back
+ for(int i = 5; i >= 1; i--) {
+ HtmlElement fr = getFastRewindButton(page, firstScrollerId);
+ fr.click();
+ HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
+
+ assertEquals("span", currentDigital1.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // if scroller inside dataTable has switched
+ HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
+ assertEquals("span", currentDigital2.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // check if page has switched
+ assertEquals(i + " page content", getCurrentPageContent(page, i));
+ }
+
+ checkFirstPageButtons(page, firstScrollerId, secondScrollerId);
+ }
+
+ @Test
+ public void testInnerDataScrollerFastButtons() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+ String firstScrollerId = "scroller1";
+
+ //dataScroller inside dataTable 'footer' facet
+ String secondScrollerId = "richTable:scroller2";
+
+ for(int i = 2; i <= 6; i++) {
+ HtmlElement ff = getFastForwardButton(page, secondScrollerId);
+ ff.click();
+ HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
+ assertEquals("span", currentDigital2.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // if scroller outside dataTable has switched
+ HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
+ assertEquals("span", currentDigital1.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // check if page has switched
+ assertEquals(i + " page content", getCurrentPageContent(page, i));
+ }
+
+ checkLastPageButtons(page, firstScrollerId, secondScrollerId);
+
+ //scroll back
+ for(int i = 5; i >= 1; i--) {
+ HtmlElement fr = getFastRewindButton(page, secondScrollerId);
+ fr.click();
+
+ HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
+ assertEquals("span", currentDigital2.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // if scroller inside dataTable has switched
+ HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
+ assertEquals("span", currentDigital1.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // check if page has switched
+ assertEquals(i + " page content", getCurrentPageContent(page, i));
+ }
+
+ checkFirstPageButtons(page, firstScrollerId, secondScrollerId);
+ }
+
+ @Test
+ public void testOutDataScrollerDigitalButtons() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+ String firstScrollerId = "scroller1";
+
+ //dataScroller inside dataTable 'footer' facet
+ String secondScrollerId = "richTable:scroller2";
+
+ for(int i = 2; i <= 6; i++) {
+ HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
+ currentDigital1.click();
+
+ currentDigital1 = getDigitalButton(page, firstScrollerId, i);
+ assertEquals("span", currentDigital1.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // if scroller inside dataTable has switched
+ HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
+ assertEquals("span", currentDigital2.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // check if page has switched
+ assertEquals(i + " page content", getCurrentPageContent(page, i));
+ }
+
+ checkLastPageButtons(page, firstScrollerId, secondScrollerId);
+
+ //scroll back
+ for(int i = 5; i >= 1; i--) {
+ HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
+ currentDigital1.click();
+
+ currentDigital1 = getDigitalButton(page, firstScrollerId, i);
+ assertEquals("span", currentDigital1.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // if scroller inside dataTable has switched
+ HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
+ assertEquals("span", currentDigital2.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // check if page has switched
+ assertEquals(i + " page content", getCurrentPageContent(page, i));
+ }
+
+ checkFirstPageButtons(page, firstScrollerId, secondScrollerId);
+ }
+
+ @Test
+ public void testInnerDataScrollerDigitalButtons() throws Exception {
+ HtmlPage page = environment.getPage("/test.jsf");
+ String firstScrollerId = "scroller1";
+
+ //dataScroller inside dataTable 'footer' facet
+ String secondScrollerId = "richTable:scroller2";
+
+ for(int i = 2; i <= 6; i++) {
+ HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
+ currentDigital2.click();
+
+ currentDigital2 = getDigitalButton(page, secondScrollerId, i);
+ assertEquals("span", currentDigital2.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // if scroller outside dataTable has switched
+ HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
+ assertEquals("span", currentDigital1.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // check if page has switched
+ assertEquals(i + " page content", getCurrentPageContent(page, i));
+ }
+
+ checkLastPageButtons(page, firstScrollerId, secondScrollerId);
+
+ //scroll back
+ for(int i = 5; i >= 1; i--) {
+ HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
+ currentDigital2.click();
+
+ currentDigital2 = getDigitalButton(page, secondScrollerId, i);
+ assertEquals("span", currentDigital2.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // if scroller inside dataTable has switched
+ HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
+ assertEquals("span", currentDigital1.getNodeName());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ // check if page has switched
+ assertEquals(i + " page content", getCurrentPageContent(page, i));
+ }
+
+ checkFirstPageButtons(page, firstScrollerId, secondScrollerId);
+ }
+
+ @After
+ public void tearDown() {
+ environment.release();
+ environment = null;
+ }
+
+ private void checkFirstPageButtons(HtmlPage page, String firstScrollerId, String
secondScrollerId) throws Exception {
+ HtmlElement fastForward = getFastForwardButton(page, firstScrollerId);
+ HtmlElement last = getLastButton(page, firstScrollerId);
+
+ assertEquals("a", fastForward.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-r",
fastForward.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ assertEquals("a", last.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-r",
last.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ fastForward = getFastForwardButton(page, secondScrollerId);
+ last = getFastForwardButton(page, secondScrollerId);
+
+ assertEquals("a", fastForward.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-r",
fastForward.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ assertEquals("a", last.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-r",
last.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ //check if left buttons is disabled
+ HtmlElement fastRewind = getFastRewindButton(page, firstScrollerId);
+ HtmlElement first = getFirstButton(page, firstScrollerId);
+
+ assertEquals("span", fastRewind.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
fastRewind.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ assertEquals("span", first.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
first.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ fastRewind = getFastRewindButton(page, secondScrollerId);
+ first = getFirstButton(page, secondScrollerId);
+
+ assertEquals("span", fastRewind.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
fastRewind.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ assertEquals("span", first.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
first.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ }
+
+ private void checkLastPageButtons(HtmlPage page, String firstScrollerId, String
secondScrollerId) throws Exception {
+ //check if right buttons is disabled
+ HtmlElement fastForward = getFastForwardButton(page, firstScrollerId);
+ HtmlElement last = getLastButton(page, firstScrollerId);
+
+ assertEquals("span", fastForward.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-r rf-ds-dis",
fastForward.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ assertEquals("span", last.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-r rf-ds-dis",
last.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ fastForward = getFastForwardButton(page, secondScrollerId);
+ last = getFastForwardButton(page, secondScrollerId);
+
+ assertEquals("span", fastForward.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-r rf-ds-dis",
fastForward.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ assertEquals("span", last.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-r rf-ds-dis",
last.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ //check if left buttons is enabled
+ HtmlElement fastRewind = getFastRewindButton(page, firstScrollerId);
+ HtmlElement first = getFirstButton(page, firstScrollerId);
+
+ assertEquals("a", fastRewind.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-l",
fastRewind.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ assertEquals("a", first.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-l",
first.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ fastRewind = getFastRewindButton(page, secondScrollerId);
+ first = getFirstButton(page, secondScrollerId);
+
+ assertEquals("a", fastRewind.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-l",
fastRewind.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+
+ assertEquals("a", first.getNodeName());
+ assertEquals("rf-ds-btn rf-ds-l",
first.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ }
+
+ private String getCurrentPageContent(HtmlPage page, int i) throws Exception {
+ HtmlElement content = page.getFirstByXPath("//*[@id =
'form:richTable:" + (--i) + ":pageContent']");
+ DomNode text = content.getFirstChild();
+ assertEquals(DomNode.TEXT_NODE, text.getNodeType());
+ return text.getNodeValue();
+ }
+
+ private HtmlElement getFastRewindButton(HtmlPage page, String scrollerId) {
+ return page.getFirstByXPath("//*[@id = 'form:" + scrollerId
+"_ds_fr']");
+ }
+
+ private HtmlElement getFirstButton(HtmlPage page, String scrollerId) {
+ return page.getFirstByXPath("//*[@id = 'form:" + scrollerId
+"_ds_f']");
+ }
+
+ private HtmlElement getFastForwardButton(HtmlPage page, String scrollerId) {
+ return page.getFirstByXPath("//*[@id = 'form:" + scrollerId
+"_ds_ff']");
+ }
+
+ private HtmlElement getLastButton(HtmlPage page, String scrollerId) {
+ return page.getFirstByXPath("//*[@id = 'form:" + scrollerId
+"_ds_l']");
+ }
+
+ private HtmlElement getDigitalButton(HtmlPage page, String scrollerId, int i) {
+ return page.getFirstByXPath("//*[@id = 'form:" + scrollerId +
"_ds_" + i +"']");
+ }
+
+}
Copied:
branches/RFPL-434/ui/iteration/ui/src/test/resources/org/richfaces/renderkit/dataTableTest.xhtml
(from rev 19021,
trunk/ui/iteration/ui/src/test/resources/org/richfaces/renderkit/dataTableTest.xhtml)
===================================================================
---
branches/RFPL-434/ui/iteration/ui/src/test/resources/org/richfaces/renderkit/dataTableTest.xhtml
(rev 0)
+++
branches/RFPL-434/ui/iteration/ui/src/test/resources/org/richfaces/renderkit/dataTableTest.xhtml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -0,0 +1,29 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:it="http://richfaces.org/iteration">
+<f:view contentType="text/html" />
+
+<h:head>
+ <title>Richfaces List</title>
+</h:head>
+
+<h:body>
+ <h:form id="form">
+
+ <it:dataScroller id="scroller1" for="richTable"
page="#{dataScrollerBean.pageNumber}"
maxPages="6"></it:dataScroller>
+ <it:dataTable id="richTable" rowKeyVar="rowKey"
var="content" value="#{dataScrollerBean.content}"
rows="1">
+ <it:column>
+ <h:panelGroup id="pageContent">
+ <h:outputText value="#{content}"/>
+ </h:panelGroup>
+ </it:column>
+ <f:facet name="footer">
+ <it:dataScroller id="scroller2" for="richTable"
page="#{dataScrollerBean.pageNumber}"
maxPages="6"></it:dataScroller>
+ </f:facet>
+ </it:dataTable>
+ </h:form>
+</h:body>
+</html>
Modified:
branches/RFPL-434/ui/iteration/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
===================================================================
---
branches/RFPL-434/ui/iteration/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/iteration/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -10,5 +10,11 @@
<managed-bean-class>org.richfaces.renderkit.DataBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
-
+
+ <managed-bean>
+ <managed-bean-name>dataScrollerBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.renderkit.DataScrollerBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
</faces-config>
\ No newline at end of file
Modified:
branches/RFPL-434/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
---
branches/RFPL-434/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-08-30
16:51:33 UTC (rev 19022)
+++
branches/RFPL-434/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-08-30
18:45:51 UTC (rev 19023)
@@ -155,7 +155,10 @@
result.append("});");
}
- return result.toString();
+ if (result.length() > 0) {
+ return result.toString();
+ }
+ return null;
}
public String getStyleIfTrimmed(UIComponent panel){
Modified: branches/RFPL-434/ui/output/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- branches/RFPL-434/ui/output/ui/src/main/templates/popupPanel.template.xml 2010-08-30
16:51:33 UTC (rev 19022)
+++ branches/RFPL-434/ui/output/ui/src/main/templates/popupPanel.template.xml 2010-08-30
18:45:51 UTC (rev 19023)
@@ -70,8 +70,7 @@
</c:if>
</div>
-</div>
-<cdk:object type="java.lang.String" name="script"
value="#{buildScript(facesContext, component)}" />
+ <cdk:object type="java.lang.String" name="script"
value="#{buildScript(facesContext, component)}" />
<cdk:object type="java.lang.String" name="showScript"
value="#{buildShowScript(facesContext, component)}" />
<script type="text/javascript">
#{script}
@@ -81,7 +80,9 @@
#{showScript}
</script>
</c:if>
+</div>
+
</cc:implementation>
</cdk:root>
\ No newline at end of file