JBoss Rich Faces SVN: r15884 - root/docs/trunk/Component_Reference/en-US.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-11-16 00:49:10 -0500 (Mon, 16 Nov 2009)
New Revision: 15884
Modified:
root/docs/trunk/Component_Reference/en-US/Actions.xml
root/docs/trunk/Component_Reference/en-US/Book_Info.xml
root/docs/trunk/Component_Reference/en-US/Component_Reference.xml
root/docs/trunk/Component_Reference/en-US/Menus_and_toolbars.xml
root/docs/trunk/Component_Reference/en-US/Preface.xml
root/docs/trunk/Component_Reference/en-US/all-Component_Reference.xml
Log:
Worked on Actions.xml
Modified: root/docs/trunk/Component_Reference/en-US/Actions.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Actions.xml 2009-11-16 00:00:24 UTC (rev 15883)
+++ root/docs/trunk/Component_Reference/en-US/Actions.xml 2009-11-16 05:49:10 UTC (rev 15884)
@@ -10,22 +10,98 @@
<section id="sect-Component_Reference-Actions-a4jactionParam">
<title>a4j:actionParam</title>
<para>
- Incomplete
+ The <classname><a4j:actionParam></classname> behavior combines the functionality of the JavaServer Faces (<acronym>JSF</acronym>) components <classname><f:param></classname> and <classname><f:actionListener></classname>.
</para>
+ <para>
+ Basic usage of the <classname><a4j:actionParam></classname> requires three main attributes:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <code>name</code>, for the name of the parameter;
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <code>value</code>, for the initial value of the parameter; and
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <code>assignTo</code>, for defining the bean property. The property will be updated if the parent command component performs an action event during the <emphasis>Process Request</emphasis> phase.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ <xref linkend="exam-Component_Reference-a4jactionParam-a4jactionParam_example" /> shows a simple implementation along with the accompanying managed bean. When the <guibutton>Set name to Alex</guibutton> button is pressed, the application sets the <code>name</code> parameter of the bean to <literal>Alex</literal>, and displays the name in the output field.
+ </para>
+ <example id="exam-Component_Reference-a4jactionParam-a4jactionParam_example">
+ <title><a4j:actionParam> example</title>
+
+<programlisting language="xml">
+<h:form id="form">
+ <a4j:commandButton value="Set name to Alex" reRender="rep">
+ <a4j:actionparam name="username" value="Alex" assignTo="#{actionparamBean.name}"/>
+ </a4j:commandButton>
+ <h:outputText id="rep" value="Name: #{actionparamBean.name}"/>
+</h:form>
+</programlisting>
+
+<programlisting language="java">
+public class ActionparamBean {
+ private String name = "John";
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
+</programlisting>
+ </example>
+ <para>
+ The <classname><a4j:actionParam></classname> behavior can be used with non-Ajax components in addition to Ajax components. In this way, data model values can be updated without an JavaScript code on the server side.
+ </para>
+ <para>
+ The <code>converter</code> attribute can be used to specify how to convert the value before it is submitted to the data model. The property is assigned the new value during the <emphasis>Update Model</emphasis> phase.
+ </para>
+ <note>
+ <title>Note</title>
+ <para>
+ If the validation of the form fails the <emphasis>Update Model</emphasis> phase will be skipped and the property will not be updated.
+ </para>
+ </note>
+ <para>
+ Variables from JavaScript functions can be used for the <code>value</code> attribute. In such an implementation, the <code>noEscape</code> attribute should be set to <literal>true</literal>. Using <code>noEscape="true"</code>, the <code>value</code> attribute can contain any JavaScript expression or JavaScript function invocation, and the result will be sent to the server as the <code>value</code> attribute.
+ </para>
</section>
<section id="sect-Component_Reference-Actions-a4jajax">
<title>a4j:ajax</title>
<para>
- Incomplete
+ The <classname><a4j:ajax></classname> component allows Ajax capability to be added to any non-Ajax component. It is placed as a direct child to the component that requires Ajax support. The <classname><a4j:ajax></classname> component uses the common attributes listed in <xref linkend="chap-Component_Reference-Common_Ajax_attributes" />.
</para>
+ <note>
+ <title>Note</title>
+ <para>
+ When attaching the <classname><a4j:ajax></classname> component to non-Ajax JavaServer Faces command components, such as <classname><h:commandButton></classname> and <classname><h:commandLink></classname>, it is important to set <code>disabledDefault="true"</code>. If this attribute is not set, a non-Ajax request is sent after the Ajax request and the page is refreshed unexpectedly.
+ </para>
+ </note>
</section>
<section id="sect-Component_Reference-Actions-a4jajaxListener">
<title>a4j:ajaxListener</title>
<para>
- Incomplete
+ The <classname><a4j:ajaxListener></classname> component adds an action listener to a parent component. It works similar to the JavaServer Faces <classname><f:actionListener></classname> or <classname><f:valueChangeListener></classname> components, except that the invocation of <classname><a4j:ajaxListener></classname> is not canceled if validation of the <emphasis>Update Model</emphasis> phase fails. The <classname><a4j:ajaxListener></classname> component is guaranteed to be invoked with each Ajax response.
</para>
+ <para>
+ Baasic usage requires only the <code>type</code> attribute, which defines the fully-qualified Java class name for the listener. This Java class should implement the <classname>org.ajax4jsf.event.AjaxListener</classname> interface, which is a base listener for all listeners and is capable of receiving Ajax events. The object from which the event originated could be accessed using the <methodname>java.util.EventObject.getSource()</methodname> method.
+ </para>
+ <para>
+ The <classname><a4j:ajaxListener></classname> component is not invoked for non-Ajax requests, or when the RichFaces works in the <emphasis>Ajax request generates non-Ajax response</emphasis> mode, so the <classname><a4j:ajaxListener></classname> invocation is a good indicator that an Ajax response is going to be processed.
+ </para>
</section>
<section id="sect-Component_Reference-Actions-a4jcommandButton">
@@ -130,8 +206,29 @@
<section id="sect-Component_Reference-Actions-a4jjsFunction">
<title>a4j:jsFunction</title>
<para>
- Incomplete
+ The <classname><a4j:jsFunction></classname> component allows Ajax requests to be performed directly from JavaScript code, and server-side data to be invoked and returned in a <acronym>JSON</acronym> format to use in client-side JavaScript calls.
</para>
+ <para>
+ The <classname><a4j:jsFunction></classname> component has all the common Ajax action attributes as listed in <xref linkend="chap-Component_Reference-Common_Ajax_attributes" />; the <code>action</code> and <code>actionListener</code> attributes can be invoked and parts of the page can be re-rendered after a successful call to the JavaScript function. The example shows how an Ajax request can be initiated from the JavaScript and a partial page update performed. The JavaScript function can be invoked with the data returned by the Ajax response.
+ </para>
+ <example>
+ <title><a4j:jsFunction> example</title>
+<programlisting language="xml">
+<h:form>
+ ...
+ <a4j:jsFunction name="callScript" data="#{bean.someProperty1}" reRender="someComponent" oncomplete="myScript(data.subProperty1, data.subProperty2)">
+ <a4j:actionParam name="param_name" assignTo="#{bean.someProperty2}"/>
+ </a4j:jsFunction>
+ ...
+</h:form>
+</programlisting>
+ </example>
+ <para>
+ The <classname><a4j:jsFunction></classname> component allows the use of the <classname><a4j:actionParam></classname> component or the JavaServer Faces <classname><f:param></classname> component to pass any number of parameters for the JavaScript function.
+ </para>
+ <para>
+ The <classname><a4j:jsFunction></classname> component is similar to the <classname><a4j:commandButton></classname> component, but it can be activated from the JavaScript code. This allows some server-side functionality to be invoked and the returned data to subsequently be used in a JavaScript function invoked by the <code>oncomplete</code> event attribute. In this way, the <classname><a4j:jsFunction></classname> component can be used instead of the <classname><a4j:commandButton></classname> component.
+ </para>
</section>
<section id="sect-Component_Reference-Actions-a4jpoll">
Modified: root/docs/trunk/Component_Reference/en-US/Book_Info.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Book_Info.xml 2009-11-16 00:00:24 UTC (rev 15883)
+++ root/docs/trunk/Component_Reference/en-US/Book_Info.xml 2009-11-16 05:49:10 UTC (rev 15884)
@@ -27,7 +27,7 @@
<year>&YEAR;</year>
<holder>&HOLDER;</holder>
</copyright>
- <!-- FOR PUBLICAN --><xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK: --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ <!-- FOR PUBLICAN --><xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK: --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
</xi:fallback>
</xi:include>
<xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
Modified: root/docs/trunk/Component_Reference/en-US/Component_Reference.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Component_Reference.xml 2009-11-16 00:00:24 UTC (rev 15883)
+++ root/docs/trunk/Component_Reference/en-US/Component_Reference.xml 2009-11-16 05:49:10 UTC (rev 15884)
@@ -4,9 +4,9 @@
<book status="draft">
<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- <!--
+ <!--
<xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- --><xi:include href="Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ --><xi:include href="Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
<xi:include href="Common_Ajax_attributes.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
<xi:include href="Common_features.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
<part id="part-Component_Reference-a4j_tag_library">
Modified: root/docs/trunk/Component_Reference/en-US/Menus_and_toolbars.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Menus_and_toolbars.xml 2009-11-16 00:00:24 UTC (rev 15883)
+++ root/docs/trunk/Component_Reference/en-US/Menus_and_toolbars.xml 2009-11-16 05:49:10 UTC (rev 15884)
@@ -90,7 +90,7 @@
<title>Standard icons</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelMenuIcons.png" format="PNG" />
+ <imagedata fileref="images/figu-Component_Reference-richpanelMenuGroup-Standard_icons.png" format="PNG" />
</imageobject>
</mediaobject>
</figure>
@@ -125,7 +125,7 @@
<title>Standard icons</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/panelMenuIcons.png" format="PNG" />
+ <imagedata fileref="images/figu-Component_Reference-richpanelMenuItem-Standard_icons.png" format="PNG" />
</imageobject>
</mediaobject>
</figure>
Modified: root/docs/trunk/Component_Reference/en-US/Preface.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Preface.xml 2009-11-16 00:00:24 UTC (rev 15883)
+++ root/docs/trunk/Component_Reference/en-US/Preface.xml 2009-11-16 05:49:10 UTC (rev 15884)
@@ -4,10 +4,10 @@
<preface id="pref-Component_Reference-Preface">
<title>Preface</title>
- <!-- FOR JDOCBOOK --><xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR PUBLICAN --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ <!-- FOR JDOCBOOK --><xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR PUBLICAN --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
</xi:fallback>
</xi:include>
- <!-- PUBLICAN'S ORIGINAL XINCLUDES --><xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ <!-- PUBLICAN'S ORIGINAL XINCLUDES --><xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
</xi:fallback>
</xi:include>
</xi:fallback>
Modified: root/docs/trunk/Component_Reference/en-US/all-Component_Reference.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/all-Component_Reference.xml 2009-11-16 00:00:24 UTC (rev 15883)
+++ root/docs/trunk/Component_Reference/en-US/all-Component_Reference.xml 2009-11-16 05:49:10 UTC (rev 15884)
@@ -28,7 +28,7 @@
<year>2009</year>
<holder>Red Hat</holder>
</copyright>
- <!-- FOR PUBLICAN -->
+ <!-- FOR PUBLICAN -->
<legalnotice xml:base="Common_Content/Legal_Notice.xml">
<para>
Copyright <trademark class="copyright"></trademark> 2009 Red Hat This material may only be distributed subject to the terms and conditions set forth in the GNU Free Documentation License (GFDL), V1.2 or later (the latest version is presently available at <ulink url="http://www.gnu.org/licenses/fdl.txt">http://www.gnu.org/licenses/fdl.txt</ulink>).
@@ -46,7 +46,7 @@
</author>
</authorgroup>
</bookinfo>
- <!-- <xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include> -->
+ <!-- <xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include> -->
<chapter id="chap-Component_Reference-Introduction" lang="en-US">
<title>Introduction</title>
<para>
15 years, 1 month
JBoss Rich Faces SVN: r15883 - root/docs/trunk/Component_Reference/en-US/images.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-11-15 19:00:24 -0500 (Sun, 15 Nov 2009)
New Revision: 15883
Added:
root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richpanelMenuGroup-Standard_icons.png
root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richpanelMenuItem-Standard_icons.png
Removed:
root/docs/trunk/Component_Reference/en-US/images/panelMenuGroupIcons.png
Log:
Renamed figures to follow standard
Copied: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richpanelMenuGroup-Standard_icons.png (from rev 15882, root/docs/trunk/Component_Reference/en-US/images/panelMenuGroupIcons.png)
===================================================================
(Binary files differ)
Copied: root/docs/trunk/Component_Reference/en-US/images/figu-Component_Reference-richpanelMenuItem-Standard_icons.png (from rev 15882, root/docs/trunk/Component_Reference/en-US/images/panelMenuGroupIcons.png)
===================================================================
(Binary files differ)
Deleted: root/docs/trunk/Component_Reference/en-US/images/panelMenuGroupIcons.png
===================================================================
(Binary files differ)
15 years, 1 month
JBoss Rich Faces SVN: r15882 - in branches/community/3.3.X: samples/beanValidatorSample/src/main/webapp and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-11-13 20:26:31 -0500 (Fri, 13 Nov 2009)
New Revision: 15882
Added:
branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src/
Removed:
branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr299src/
Modified:
branches/community/3.3.X/samples/beanValidatorSample/pom.xml
branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src/org/richfaces/example/Bean.java
branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src/org/richfaces/example/LengthBean.java
branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src/org/richfaces/example/NotEmptyBean.java
branches/community/3.3.X/ui/beanValidator/pom.xml
branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/MockValidationProvider.java
Log:
https://jira.jboss.org/jira/browse/RF-8049
Modified: branches/community/3.3.X/samples/beanValidatorSample/pom.xml
===================================================================
--- branches/community/3.3.X/samples/beanValidatorSample/pom.xml 2009-11-13 22:52:40 UTC (rev 15881)
+++ branches/community/3.3.X/samples/beanValidatorSample/pom.xml 2009-11-14 01:26:31 UTC (rev 15882)
@@ -98,7 +98,7 @@
</dependencies>
</profile>
<profile>
- <id>jsr299</id>
+ <id>jsr303</id>
<build>
<plugins>
<plugin>
@@ -114,7 +114,7 @@
</goals>
<configuration>
<sources>
- <source>src/main/webapp/jsr299src</source>
+ <source>src/main/webapp/jsr303src</source>
</sources>
</configuration>
</execution>
@@ -126,12 +126,12 @@
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
- <version>1.0.CR3</version>
+ <version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
- <version>4.0.0.Beta2</version>
+ <version>4.0.1.GA</version>
</dependency>
</dependencies>
</profile>
Copied: branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src (from rev 15877, branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr299src)
Modified: branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src/org/richfaces/example/Bean.java
===================================================================
--- branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr299src/org/richfaces/example/Bean.java 2009-11-13 13:54:53 UTC (rev 15877)
+++ branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src/org/richfaces/example/Bean.java 2009-11-14 01:26:31 UTC (rev 15882)
@@ -23,9 +23,10 @@
import javax.validation.constraints.Pattern;
-import org.hibernate.validation.constraints.NotEmpty;
+import org.hibernate.validator.constraints.NotEmpty;
+
/**
* JSF bean with text property validation.
*/
Modified: branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src/org/richfaces/example/LengthBean.java
===================================================================
--- branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr299src/org/richfaces/example/LengthBean.java 2009-11-13 13:54:53 UTC (rev 15877)
+++ branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src/org/richfaces/example/LengthBean.java 2009-11-14 01:26:31 UTC (rev 15882)
@@ -3,7 +3,7 @@
*/
package org.richfaces.example;
-import org.hibernate.validation.constraints.Length;
+import org.hibernate.validator.constraints.Length;
import org.richfaces.Validable;
/**
Modified: branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src/org/richfaces/example/NotEmptyBean.java
===================================================================
--- branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr299src/org/richfaces/example/NotEmptyBean.java 2009-11-13 13:54:53 UTC (rev 15877)
+++ branches/community/3.3.X/samples/beanValidatorSample/src/main/webapp/jsr303src/org/richfaces/example/NotEmptyBean.java 2009-11-14 01:26:31 UTC (rev 15882)
@@ -3,7 +3,7 @@
*/
package org.richfaces.example;
-import org.hibernate.validation.constraints.NotEmpty;
+import org.hibernate.validator.constraints.NotEmpty;
import org.richfaces.Validable;
/**
Modified: branches/community/3.3.X/ui/beanValidator/pom.xml
===================================================================
--- branches/community/3.3.X/ui/beanValidator/pom.xml 2009-11-13 22:52:40 UTC (rev 15881)
+++ branches/community/3.3.X/ui/beanValidator/pom.xml 2009-11-14 01:26:31 UTC (rev 15882)
@@ -70,7 +70,7 @@
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
- <version>1.0.CR3</version>
+ <version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Modified: branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/MockValidationProvider.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/MockValidationProvider.java 2009-11-13 22:52:40 UTC (rev 15881)
+++ branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/MockValidationProvider.java 2009-11-14 01:26:31 UTC (rev 15882)
@@ -148,6 +148,12 @@
// TODO Auto-generated method stub
return this;
}
+
+ public ValidatorContext constraintValidatorFactory(
+ ConstraintValidatorFactory factory) {
+ // TODO Auto-generated method stub
+ return null;
+ }
};
}
@@ -156,6 +162,16 @@
// TODO Auto-generated method stub
return null;
}
+
+ public ConstraintValidatorFactory getConstraintValidatorFactory() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public TraversableResolver getTraversableResolver() {
+ // TODO Auto-generated method stub
+ return null;
+ }
};
}
@@ -211,6 +227,16 @@
// TODO Auto-generated method stub
return this;
}
+
+ public ConstraintValidatorFactory getDefaultConstraintValidatorFactory() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public TraversableResolver getDefaultTraversableResolver() {
+ // TODO Auto-generated method stub
+ return null;
+ }
};
}
15 years, 1 month
JBoss Rich Faces SVN: r15881 - branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-11-13 17:52:40 -0500 (Fri, 13 Nov 2009)
New Revision: 15881
Modified:
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/MethodCallElement.java
Log:
https://jira.jboss.org/jira/browse/RF-8134
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/MethodCallElement.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/MethodCallElement.java 2009-11-13 17:56:30 UTC (rev 15880)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/MethodCallElement.java 2009-11-13 22:52:40 UTC (rev 15881)
@@ -31,73 +31,88 @@
import java.util.Map;
import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
import javax.faces.el.MethodNotFoundException;
+import javax.faces.render.Renderer;
import org.ajax4jsf.Messages;
+import org.ajax4jsf.renderkit.RendererBase;
+import org.ajax4jsf.renderkit.RendererUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xml.sax.SAXException;
-
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:47 $
- *
+ *
*/
-public class MethodCallElement extends ElementBase {
+public class MethodCallElement extends ElementBase {
public static final String UTILS_PREFIX = "utils.";
-
+
static final Log _log = LogFactory.getLog(MethodCallElement.class);
private String _name = null;
-
- private List parameters = new ArrayList();
-
- private Invoker invoker = new Invoker();
-
- private MethodCacheState state = new MethodCacheState();
-
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.compiler.CompiledXML#encode(javax.faces.render.Renderer, javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+
+ private List<MethodParameterElement> parameters = new ArrayList<MethodParameterElement>(
+ 3);
+
+ private volatile Invoker invoker;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.ajax4jsf.renderkit.compiler.CompiledXML#encode(javax.faces.render
+ * .Renderer, javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent)
*/
- public void encode(TemplateContext context ) throws IOException {
- getValue(context);
+ public void encode(TemplateContext context) throws IOException {
+ getValue(context);
}
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.compiler.ElementBase#encode(org.ajax4jsf.renderkit.compiler.TemplateContext, java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.ajax4jsf.renderkit.compiler.ElementBase#encode(org.ajax4jsf.renderkit
+ * .compiler.TemplateContext, java.lang.String)
*/
- public void encode(TemplateContext context, String breakPoint) throws IOException {
+ public void encode(TemplateContext context, String breakPoint)
+ throws IOException {
// Text not contain breakpoints.
encode(context);
}
-
-
+
public Object getValue(TemplateContext context) throws FacesException {
+ if (null == invoker) {
+ throw new FacesException(Messages
+ .getMessage(Messages.RENDERER_METHOD_NOT_SET_ERROR));
+ }
// prepare method params. we attempt to call 3 signatures :
// a) name(FacesContext,UIComponent [, param0...])
// b) name(TempalateContext [,param0...])
// c) name([param0...])
- state.init(parameters);
- Object[] values = state.computeParameterValues(context);
-
- InvokeData data = null;
- synchronized (state) {
- state.update(context, values, invoker);
- data = invoker.invokeMethod(context, state);
- }
- return invoker.invokeMethod(data);
+ Object[] values = computeParameterValues(context);
+
+ return invoker.invokeMethod(context, values);
// perform childrens.
// super.encode(renderer,context,component);
}
+ public Object[] computeParameterValues(TemplateContext context) {
+ Object[] ps = new Object[parameters.size()];
+ for (int i = 0; i < ps.length; i++) {
+ ps[i] = parameters.get(i).valueGetter.getValueOrDefault(context);
+ }
+ return ps;
+ }
-
- public void addParameter(MethodParameterElement parameter){
+ public void addParameter(MethodParameterElement parameter) {
parameters.add(parameter);
}
+
/**
* @return Returns the methodName.
*/
@@ -106,13 +121,14 @@
}
/**
- * @param methodName The methodName to set.
+ * @param methodName
+ * The methodName to set.
*/
public void setName(String methodName) {
- if(methodName.startsWith(UTILS_PREFIX)){
+ if (methodName.startsWith(UTILS_PREFIX)) {
this._name = methodName.substring(UTILS_PREFIX.length());
this.invoker = getRendererUtilsInvoker(_name);
- } else if(methodName.indexOf('.') >= 0) {
+ } else if (methodName.indexOf('.') >= 0) {
this._name = methodName;
this.invoker = getStaticInvoker(_name);
} else {
@@ -121,385 +137,430 @@
}
}
- static Map staticInvokers = new HashMap();
-
- public StaticInvoker getStaticInvoker(String methodName) {
- StaticInvoker invoker = (StaticInvoker)staticInvokers.get(methodName);
- if(invoker == null) {
- invoker = new StaticInvoker(methodName);
- staticInvokers.put(methodName, invoker);
- }
- return invoker;
+ public Invoker getStaticInvoker(String methodName) {
+ StaticInvoker invoker = new StaticInvoker(methodName);
+ return invoker;
}
- static Map rendererInvokers = new HashMap();
-
- public RendererInvoker getRendererInvoker(String methodName) {
- RendererInvoker invoker = (RendererInvoker)rendererInvokers.get(methodName);
- if(invoker == null) {
- invoker = new RendererInvoker(false, methodName);
- rendererInvokers.put(methodName, invoker);
- }
+ public Invoker getRendererInvoker(String methodName) {
+ RendererInvoker invoker = new RendererInvoker(methodName);
return invoker;
}
-
- static Map utilsInvokers = new HashMap();
- public RendererInvoker getRendererUtilsInvoker(String methodName) {
- RendererInvoker invoker = (RendererInvoker)utilsInvokers.get(methodName);
- if(invoker == null) {
- invoker = new RendererInvoker(true, methodName);
- utilsInvokers.put(methodName, invoker);
- }
+ public Invoker getRendererUtilsInvoker(String methodName) {
+ RendererInvoker invoker = new RendererUtilsInvoker(methodName);
return invoker;
}
-
+
public String getTag() {
- return HtmlCompiler.NS_PREFIX+HtmlCompiler.CALL_TAG;
+ return HtmlCompiler.NS_PREFIX + HtmlCompiler.CALL_TAG;
}
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.compiler.ElementBase#setParent(org.ajax4jsf.renderkit.compiler.PreparedTemplate)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.ajax4jsf.renderkit.compiler.ElementBase#setParent(org.ajax4jsf.renderkit
+ * .compiler.PreparedTemplate)
*/
- public void setParent(PreparedTemplate parent) throws SAXException {
+ public void setParent(PreparedTemplate parent) throws SAXException {
super.setParent(parent);
- if (getName()==null) {
- throw new SAXException(Messages.getMessage(Messages.NO_NAME_ATTRIBUTE_ERROR, getTag()));
+ if (getName() == null) {
+ throw new SAXException(Messages.getMessage(
+ Messages.NO_NAME_ATTRIBUTE_ERROR, getTag()));
}
}
-
-/* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.compiler.ElementBase#getString(org.ajax4jsf.renderkit.compiler.TemplateContext)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.ajax4jsf.renderkit.compiler.ElementBase#getString(org.ajax4jsf.renderkit
+ * .compiler.TemplateContext)
*/
public String getString(TemplateContext context) throws FacesException {
Object result = getValue(context);
- if (null == result || result.toString().length()==0) {
- result = "";
+ if (null == result || result.toString().length() == 0) {
+ result = "";
}
return result.toString();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.ajax4jsf.renderkit.compiler.ElementBase#getAllowedClasses()
*/
- protected Class[] getAllowedClasses() {
- // TODO Auto-generated method stub
- return new Class[]{
- MethodParameterElement.class,
- ResourceElement.class
- };
+ @SuppressWarnings("unchecked")
+ protected Class<? extends ElementBase>[] getAllowedClasses() {
+ return new Class[] { MethodParameterElement.class,
+ ResourceElement.class };
}
}
-class InvokeData {
- TemplateContext context;
- Method method;
- Object object;
- Object[] arguments;
- InvokeData(TemplateContext context, Method method, Object object, Object[] arguments) {
- this.context = context;
- this.method = method;
- this.object = object;
- this.arguments = (Object[]) arguments.clone();
- }
-}
+abstract class Invoker {
-class Invoker {
- String methodName;
+ protected volatile Signature current;
- InvokeData invokeMethod(TemplateContext context, MethodCacheState state) {
- throw new FacesException(Messages.getMessage(Messages.RENDERER_METHOD_NOT_SET_ERROR));
+ protected String methodName;
+
+ public Invoker(String name) {
+ this.methodName = name;
}
- void handleInvocationTargetException(TemplateContext context, InvocationTargetException e) {}
- void handleIllegalAccessException(TemplateContext context, IllegalAccessException e) {}
- void handleMethodNotFoundException(TemplateContext context) throws MethodNotFoundException {}
-
- InvokeData invokeMethod(TemplateContext context, Map methods, Class cls, Object object, MethodCacheState state) {
- Method method = provideMethod(methods, cls, object, state);
- return new InvokeData(context, method, object, state.current.arguments);
- }
-
- Object invokeMethod(InvokeData data) {
- if(data.method != null) {
+ public Object invokeMethod(TemplateContext context, Object[] parameters) {
+ Object result = null;
+ Class<?>[] parameterTypes = new Class[parameters.length];
+ for (int i = 0; i < parameters.length; i++) {
+ Object parameter = parameters[i];
+ if (null != parameter) {
+ parameterTypes[i] = parameter.getClass();
+ }
+ }
+ // Use a copy to avoid synchronization.
+ Signature signature = current;
+ if (null == signature
+ || !signature.isApplicable(context, getInvokedClass(context),
+ parameterTypes)) {
+ // Clalculate target signature
+ signature = provideMethod(context, parameterTypes);
+ current = signature;
+ }
try {
- return data.method.invoke(data.object, data.arguments);
+ result = signature.invoke(context, getInvokedObject(context),
+ parameters);
+ } catch (IllegalArgumentException e) {
+ throw new FacesException(e);
+ } catch (IllegalAccessException e) {
+ handleIllegalAccessException(context, e);
} catch (InvocationTargetException e) {
- handleInvocationTargetException(data.context, e);
- } catch (IllegalAccessException e) {
- handleIllegalAccessException(data.context, e);
+ handleInvocationTargetException(context, e);
}
- }
- handleMethodNotFoundException(data.context);
- return null;
+ return result;
}
-
- public Class getInvokedClass(TemplateContext context) {
- return null;
- }
-
- private Method provideMethod(Map methods, Class cls, Object object, MethodCacheState state) {
- if(state.method != null) return state.method;
- if(methods.size() > 0) {
- for (int i = 0; i < state.signatures.length; i++) {
- state.method = (Method)methods.get(getClassesKey(state.signatures[i].arguments));
- if(state.method != null) {
- state.current = state.signatures[i];
- return state.method;
+ abstract void handleInvocationTargetException(TemplateContext context,
+ InvocationTargetException e);
+
+ abstract void handleIllegalAccessException(TemplateContext context,
+ IllegalAccessException e);
+
+ abstract void handleMethodNotFoundException(TemplateContext context);
+
+ public abstract Class<?> getInvokedClass(TemplateContext context);
+
+ public abstract Object getInvokedObject(TemplateContext context);
+
+ protected Signature provideMethod(TemplateContext context,
+ Class<?>[] parameterTypes) {
+ Class<?> cls = getInvokedClass(context);
+ if (null != cls) {
+ // TODO - cache signatures ?
+ Object object = getInvokedObject(context);
+ Method[] methods = cls.getMethods();
+ for (int m = 0; m < methods.length; m++) {
+ if (methods[m].getName().equals(methodName)
+ && (object != null || Modifier.isStatic(methods[m]
+ .getModifiers()))) {
+ Signature s = new Signature0(methods[m]);
+ if (s.isApplicable(context, cls, parameterTypes)) {
+ return s;
+ }
+ s = new Signature1(methods[m]);
+ if (s.isApplicable(context, cls, parameterTypes)) {
+ return s;
+ }
+ s = new Signature2(methods[m]);
+ if (s.isApplicable(context, cls, parameterTypes)) {
+ return s;
+ }
}
}
}
-
- if(cls == null && object != null) cls = object.getClass();
- Method[] ms = cls.getMethods();
- for (int m = 0; m < ms.length; m++) {
- if(!ms[m].getName().equals(methodName)) continue;
- if(object == null && !Modifier.isStatic(ms[m].getModifiers())) continue;
- Class[] cs = ms[m].getParameterTypes();
- Signature s = getMatchingArguments(cs, state.signatures);
- if(s == null) continue;
- state.current = s;
- state.method = ms[m];
- methods.put(getClassesKey(s.arguments), ms[m]);
- return state.method;
- }
-
+ handleMethodNotFoundException(context);
return null;
}
- private String getClassesKey(Object[] args) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < args.length; i++) {
- String dk = args[i] == null ? "null" : args[i].getClass().getName();
- sb.append(";").append(dk);
- }
- return sb.toString();
- }
-
- private Signature getMatchingArguments(Class[] cs, Signature[] sgs) {
- for (int i = 0; i < sgs.length; i++) {
- if(isMatching(cs, sgs[i].arguments)) return sgs[i];
- }
- return null;
- }
-
- static boolean isMatching(Class[] cs, Object[] args) {
- if(cs.length != args.length) return false;
+ static boolean isMatching(Class<?>[] cs, Class<?>[] args) {
+ if (cs.length != args.length)
+ return false;
for (int i = 0; i < cs.length; i++) {
- if(args[i] != null && !cs[i].isAssignableFrom(args[i].getClass())) return false;
+ if (args[i] != null && !cs[i].isAssignableFrom(args[i]))
+ return false;
}
return true;
}
}
class RendererInvoker extends Invoker {
- boolean utils = false;
- Map renderers = new HashMap();
-
- public RendererInvoker(boolean utils, String methodName) {
- this.utils = utils;
- this.methodName = methodName;
+
+ public RendererInvoker(String methodName) {
+ super(methodName);
}
- public Class getInvokedClass(TemplateContext context) {
+ public Class<? extends Object> getInvokedClass(TemplateContext context) {
Object object = getInvokedObject(context);
- return (object != null) ? object.getClass() : null;
+ return (object != null) ? object.getClass() : Renderer.class;
}
-
- private Object getInvokedObject(TemplateContext context) {
- if(utils) {
- return context.getRenderer().getUtils();
- } else {
- return context.getRenderer();
- }
+
+ public Object getInvokedObject(TemplateContext context) {
+ return context.getRenderer();
}
-
- InvokeData invokeMethod(TemplateContext context, MethodCacheState state) {
+
+ void handleInvocationTargetException(TemplateContext context,
+ InvocationTargetException e) {
+ String logMessage = Messages.getMessage(Messages.METHOD_CALL_ERROR_1a,
+ methodName, context.getComponent().getId());
+ String excMessage = Messages.getMessage(Messages.METHOD_CALL_ERROR_2a,
+ new Object[] { methodName, context.getComponent().getId(),
+ e.getCause().getMessage() });
+ MethodCallElement._log.error(logMessage, e);
+ throw new FacesException(excMessage, e);
+ }
+
+ void handleIllegalAccessException(TemplateContext context,
+ IllegalAccessException e) {
+ String logMessage = Messages.getMessage(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_3a, methodName, context
+ .getComponent().getId()));
+ String excMessage = Messages.getMessage(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_4a, new Object[] { methodName,
+ context.getComponent().getId(),
+ e.getCause().getMessage() }));
+ MethodCallElement._log.error(logMessage, e);
+ throw new FacesException(excMessage, e);
+ }
+
+ void handleMethodNotFoundException(TemplateContext context)
+ throws MethodNotFoundException {
+ String logMessage = Messages.getMessage(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_5a, methodName, context
+ .getComponent().getId()));
+ String excMessage = Messages.getMessage(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_6a, methodName));
+ MethodCallElement._log.error(logMessage);
+ throw new FacesException(excMessage);
+ }
+}
+
+class RendererUtilsInvoker extends RendererInvoker {
+
+ public RendererUtilsInvoker(String methodName) {
+ super(methodName);
+ }
+
+ public Class<? extends Object> getInvokedClass(TemplateContext context) {
Object object = getInvokedObject(context);
- Map methods = getMethods(object);
- return invokeMethod(context, methods, null, object, state);
+ return (object != null) ? object.getClass() : RendererUtils.class;
}
-
- private Map getMethods(Object object) {
- if(object == null) return null;
- Map methods = (Map)renderers.get(object);
- if(methods == null) {
- methods = new HashMap();
- renderers.put(object, methods);
- }
- return methods;
+
+ public Object getInvokedObject(TemplateContext context) {
+ RendererBase renderer = context.getRenderer();
+ return null != renderer ? renderer.getUtils() : null;
}
- void handleInvocationTargetException(TemplateContext context, InvocationTargetException e) {
- String logMessage = (utils)
- ? Messages.getMessage(Messages.METHOD_CALL_ERROR_1, methodName, context.getComponent().getId())
- : Messages.getMessage(Messages.METHOD_CALL_ERROR_1a, methodName, context.getComponent().getId());
- String excMessage = (utils)
- ? Messages.getMessage(Messages.METHOD_CALL_ERROR_2, new Object[]{methodName, context.getComponent().getId(), e.getCause().getMessage()})
- : Messages.getMessage(Messages.METHOD_CALL_ERROR_2a, new Object[]{methodName, context.getComponent().getId(), e.getCause().getMessage()});
+ void handleInvocationTargetException(TemplateContext context,
+ InvocationTargetException e) {
+ String logMessage = Messages.getMessage(Messages.METHOD_CALL_ERROR_1,
+ methodName, context.getComponent().getId());
+ String excMessage = Messages.getMessage(Messages.METHOD_CALL_ERROR_2,
+ new Object[] { methodName, context.getComponent().getId(),
+ e.getCause().getMessage() });
MethodCallElement._log.error(logMessage, e);
throw new FacesException(excMessage, e);
}
- void handleIllegalAccessException(TemplateContext context, IllegalAccessException e) {
- String logMessage = (utils)
- ? Messages.getMessage(Messages.getMessage(Messages.METHOD_CALL_ERROR_3, methodName, context.getComponent().getId()))
- : Messages.getMessage(Messages.getMessage(Messages.METHOD_CALL_ERROR_3a, methodName, context.getComponent().getId()));
- String excMessage = (utils)
- ? Messages.getMessage(Messages.getMessage(Messages.METHOD_CALL_ERROR_4, new Object[]{methodName, context.getComponent().getId(), e.getCause().getMessage()}))
- : Messages.getMessage(Messages.getMessage(Messages.METHOD_CALL_ERROR_4a, new Object[]{methodName, context.getComponent().getId(), e.getCause().getMessage()}));
+
+ void handleIllegalAccessException(TemplateContext context,
+ IllegalAccessException e) {
+ String logMessage = Messages.getMessage(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_3, methodName, context
+ .getComponent().getId()));
+ String excMessage = Messages.getMessage(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_4, new Object[] { methodName,
+ context.getComponent().getId(),
+ e.getCause().getMessage() }));
MethodCallElement._log.error(logMessage, e);
throw new FacesException(excMessage, e);
}
-
- void handleMethodNotFoundException(TemplateContext context) throws MethodNotFoundException {
- String logMessage = (utils)
- ? Messages.getMessage(Messages.getMessage(Messages.METHOD_CALL_ERROR_5, methodName, context.getComponent().getId()))
- : Messages.getMessage(Messages.getMessage(Messages.METHOD_CALL_ERROR_5a, methodName, context.getComponent().getId()));
- String excMessage = (utils)
- ? Messages.getMessage(Messages.getMessage(Messages.METHOD_CALL_ERROR_6, methodName))
- : Messages.getMessage(Messages.getMessage(Messages.METHOD_CALL_ERROR_6a, methodName));
- MethodCallElement._log.error(logMessage);
+
+ void handleMethodNotFoundException(TemplateContext context)
+ throws MethodNotFoundException {
+ String logMessage = Messages.getMessage(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_5, methodName, context
+ .getComponent().getId()));
+ String excMessage = Messages.getMessage(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_6, methodName));
+ MethodCallElement._log.error(logMessage);
throw new FacesException(excMessage);
}
}
class StaticInvoker extends Invoker {
String className;
- Class cls;
- Map methods = new HashMap();
-
+ Class<?> cls;
+ Map<String, Method> methods = new HashMap<String, Method>();
+
StaticInvoker(String methodName) {
- this.methodName = methodName;
+ super(methodName);
int i = methodName.lastIndexOf('.');
className = methodName.substring(0, i);
this.methodName = methodName.substring(i + 1);
try {
- cls = Thread.currentThread().getContextClassLoader().loadClass(className);
+ cls = Thread.currentThread().getContextClassLoader().loadClass(
+ className);
} catch (ClassNotFoundException e) {
- //ignore, throw exception when invoking
+ // ignore, throw exception when invoking
}
}
- InvokeData invokeMethod(TemplateContext context, MethodCacheState state) {
- if(cls == null) throw new FacesException(className, new ClassNotFoundException(className));
- return invokeMethod(context, methods, cls, null, state);
+ @Override
+ public Class<?> getInvokedClass(TemplateContext context) {
+ return cls;
}
- void handleInvocationTargetException(TemplateContext context, InvocationTargetException e) {
- MethodCallElement._log.error(Messages.getMessage(Messages.METHOD_CALL_ERROR_1a, methodName, context.getComponent().getId()), e);
- throw new FacesException(Messages.getMessage(Messages.METHOD_CALL_ERROR_2a, new Object[]{methodName, context.getComponent().getId(), e.getCause().getMessage()}), e);
+ @Override
+ public Object getInvokedObject(TemplateContext context) {
+ return null;
}
- void handleIllegalAccessException(TemplateContext context, IllegalAccessException e) {
- MethodCallElement._log.error(Messages.getMessage(Messages.METHOD_CALL_ERROR_3a, methodName, context.getComponent().getId()), e);
- throw new FacesException(Messages.getMessage(Messages.METHOD_CALL_ERROR_4a, new Object[]{methodName, context.getComponent().getId(), e.getCause().getMessage()}), e);
- }
- void handleMethodNotFoundException(TemplateContext context) throws MethodNotFoundException {
- MethodCallElement._log.error(Messages.getMessage(Messages.METHOD_CALL_ERROR_5a, methodName, context.getComponent().getId()));
- throw new MethodNotFoundException(Messages.getMessage(Messages.METHOD_CALL_ERROR_6a, methodName));
+
+ void handleInvocationTargetException(TemplateContext context,
+ InvocationTargetException e) {
+ MethodCallElement._log.error(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_1a, methodName, context
+ .getComponent().getId()), e);
+ throw new FacesException(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_2a, new Object[] { methodName,
+ context.getComponent().getId(),
+ e.getCause().getMessage() }), e);
}
+
+ void handleIllegalAccessException(TemplateContext context,
+ IllegalAccessException e) {
+ MethodCallElement._log.error(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_3a, methodName, context
+ .getComponent().getId()), e);
+ throw new FacesException(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_4a, new Object[] { methodName,
+ context.getComponent().getId(),
+ e.getCause().getMessage() }), e);
+ }
+
+ void handleMethodNotFoundException(TemplateContext context)
+ throws MethodNotFoundException {
+ MethodCallElement._log.error(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_5a, methodName, context
+ .getComponent().getId()));
+ throw new MethodNotFoundException(Messages.getMessage(
+ Messages.METHOD_CALL_ERROR_6a, methodName));
+ }
+
}
-class MethodCacheState {
- private MethodParameterElement[] elements;
- private Class[] parameterClasses;
- private Object[] parameterValues;
- private Class lastCallingClass = null;
- public Method method;
- public Signature current;
- public Signature[] signatures;
-
- public void init(List parameters) {
- if(elements != null) return;
- synchronized (this) {
- if(elements != null) return;
- int size = parameters.size();
- parameterClasses = new Class[size];
- parameterValues = new Object[size];
- signatures = new Signature[3];
- signatures[0] = new Signature2(size);
- signatures[1] = new Signature1(size);
- signatures[2] = new Signature0(size);
- elements = (MethodParameterElement[])parameters.toArray(new MethodParameterElement[0]);
- }
+abstract class Signature {
+
+ Method method;
+
+ Signature(Method method) {
+ this.method = method;
}
-
- public Object[] computeParameterValues(TemplateContext context) {
- Object[] ps = new Object[elements.length];
- for (int i = 0; i < elements.length; i++) {
- ps[i] = elements[i].valueGetter.getValueOrDefault(context);
+
+ boolean isApplicable(TemplateContext context, Class targetClass,
+ Class<?>[] parameters) {
+ if (!method.getDeclaringClass().isAssignableFrom(targetClass)) {
+ return false;
}
- return ps;
- }
-
- public void update(TemplateContext context, Object[] values, Invoker invoker) {
- boolean changed = false;
- for (int i = 0; i < elements.length; i++) {
- Object parametr = values[i];
- Class c = (parametr == null) ? null : parametr.getClass();
- if(c != parameterClasses[i]) {
- parameterClasses[i] = c;
- changed = true;
- }
- parameterValues[i] = parametr;
+ Class<?>[] methodParameterTypes = this.method.getParameterTypes();
+ Class<?>[] parameterTypes = getParameterTypes(context, parameters);
+ if (methodParameterTypes.length != parameterTypes.length) {
+ return false;
}
- if(method != null && !changed && lastCallingClass != invoker.getInvokedClass(context)) {
- lastCallingClass = invoker.getInvokedClass(context);
- changed = true;
- }
- if(changed || current == null) {
- for (int i = 0; i < signatures.length; i++) {
- signatures[i].update(context, parameterValues);
+ for (int i = 0; i < parameterTypes.length; i++) {
+ if (null != parameterTypes[i]
+ && !methodParameterTypes[i]
+ .isAssignableFrom(parameterTypes[i])) {
+ return false;
}
- method = null;
- current = null;
- } else {
- current.update(context, parameterValues);
}
- }
-
-}
+ return true;
+ }
-abstract class Signature {
- Object[] arguments;
+ abstract Class<?>[] getParameterTypes(TemplateContext context,
+ Class<?>[] parameters);
- Signature() {}
+ abstract Object[] getParameterValues(TemplateContext context,
+ Object[] parameters);
- void update(TemplateContext context, Object[] parameters) {}
+ Object invoke(TemplateContext context, Object target, Object[] parameters)
+ throws IllegalArgumentException, IllegalAccessException,
+ InvocationTargetException {
+ return this.method.invoke(target, getParameterValues(context,
+ parameters));
+ }
+
}
class Signature0 extends Signature {
- Signature0(int size) {
- arguments = new Object[size];
+
+ Signature0(Method method) {
+ super(method);
}
- void update(TemplateContext context, Object[] parameters) {
- System.arraycopy(parameters, 0, arguments, 0, parameters.length);
+ @Override
+ Class<?>[] getParameterTypes(TemplateContext context, Class<?>[] parameters) {
+ return parameters;
}
-
+
+ @Override
+ Object[] getParameterValues(TemplateContext context, Object[] parameters) {
+ return parameters;
+ }
+
}
class Signature1 extends Signature {
- Signature1(int size) {
- arguments = new Object[size + 1];
+ Signature1(Method method) {
+ super(method);
}
- void update(TemplateContext context, Object[] parameters) {
- arguments[0] = context;
- System.arraycopy(parameters, 0, arguments, 1, parameters.length);
+
+ @Override
+ Class<?>[] getParameterTypes(TemplateContext context, Class<?>[] parameters) {
+ Class<?>[] types = new Class[parameters.length + 1];
+ types[0] = TemplateContext.class;
+ System.arraycopy(parameters, 0, types, 1, parameters.length);
+ return types;
}
-
+
+ @Override
+ Object[] getParameterValues(TemplateContext context, Object[] parameters) {
+ Object[] values = new Object[parameters.length + 1];
+ values[0] = context;
+ System.arraycopy(parameters, 0, values, 1, parameters.length);
+ return values;
+ }
+
}
class Signature2 extends Signature {
- Signature2(int size) {
- arguments = new Object[size + 2];
+ Signature2(Method method) {
+ super(method);
}
- void update(TemplateContext context, Object[] parameters) {
- arguments[0] = context.getFacesContext();
- arguments[1] = context.getComponent();
- System.arraycopy(parameters, 0, arguments, 2, parameters.length);
- }
+
+ @Override
+ Class<?>[] getParameterTypes(TemplateContext context, Class<?>[] parameters) {
+ Class<?>[] types = new Class[parameters.length + 2];
+ types[0] = FacesContext.class;
+ types[1] = context.getComponent().getClass();
+ System.arraycopy(parameters, 0, types, 2, parameters.length);
+ return types;
+ }
+
+ @Override
+ Object[] getParameterValues(TemplateContext context, Object[] parameters) {
+ Object[] values = new Object[parameters.length + 2];
+ values[0] = context.getFacesContext();
+ values[1] = context.getComponent();
+ System.arraycopy(parameters, 0, values, 2, parameters.length);
+ return values;
+ }
}
15 years, 1 month
JBoss Rich Faces SVN: r15880 - root/examples-sandbox/trunk/components/tables/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-11-13 12:56:30 -0500 (Fri, 13 Nov 2009)
New Revision: 15880
Modified:
root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml
Log:
RF-7852 ExtendedDataTable sample
Modified: root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml 2009-11-13 17:56:29 UTC (rev 15879)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml 2009-11-13 17:56:30 UTC (rev 15880)
@@ -36,7 +36,25 @@
<h:body>
<h:form id="form1">
- <rich:extendedDataTable />
+ <rich:extendedDataTable var="record" value="#{dataBean.employeeList}" rows="20">
+ <rich:column id="column_name">
+ <f:facet name="header">
+ <h:outputText id="columnHeader1" value="Column Header Facet"/>
+ </f:facet>
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooter1" value="Column Footer Facet"/>
+ </f:facet>
+ </rich:column>
+
+ <rich:column id="column_title">
+ <h:outputText value="#{record.title}" />
+ </rich:column>
+
+ <rich:column id="column_email">
+ <h:outputText value="#{record.EMail}" />
+ </rich:column>
+ </rich:extendedDataTable>
</h:form>
</h:body>
</html>
15 years, 1 month
JBoss Rich Faces SVN: r15879 - in root/ui-sandbox/trunk/components/tables/ui/src/main: resources/META-INF/resources and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-11-13 12:56:29 -0500 (Fri, 13 Nov 2009)
New Revision: 15879
Added:
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.js
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.css
Log:
RF-7865
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2009-11-13 17:55:27 UTC (rev 15878)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2009-11-13 17:56:29 UTC (rev 15879)
@@ -22,19 +22,27 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.util.Iterator;
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.renderkit.RendererBase;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.component.UIDataTableBase;
+import org.richfaces.component.util.HtmlUtil;
-public class ExtendedDataTableRenderer extends RendererBase {
+@ResourceDependencies({
+ @ResourceDependency(name = "extendedDataTable.js"),
+ @ResourceDependency(name = "extendedDataTable.css")
+})
+public class ExtendedDataTableRenderer extends AbstractTableRenderer {
@Override
protected Class<? extends UIComponent> getComponentClass() {
- return UIComponent.class;
+ return UIDataTableBase.class;
}
@Override
@@ -42,7 +50,7 @@
UIComponent component) throws IOException {
writer.startElement(HTML.DIV_ELEM, component);
writer.writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(context), null);
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable " + component.getAttributes().get("styleClass"), null);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rich-extable", (String)component.getAttributes().get("styleClass")), null);
getUtils().writeAttribute(writer, HTML.STYLE_ATTRIBUTE, component.getAttributes().get("style"));
}
@@ -50,13 +58,170 @@
@Override
protected void doEncodeChildren(ResponseWriter writer,
FacesContext context, UIComponent component) throws IOException {
- // TODO Auto-generated method stub
- super.doEncodeChildren(writer, context, component);
+ UIDataTableBase table = (UIDataTableBase) component;
+ Object key = table.getRowKey();
+ table.captureOrigValue(context);
+ table.setRowKey(context, null);
+ encodeStyle(writer, context, table);
+ encodeHeaderOrFooter(writer, context, table, "header");
+ encodeBody(writer, context, table);
+ encodeHeaderOrFooter(writer, context, table, "footer");
+ table.setRowKey(context,key);
+ table.restoreOrigValue(context);
}
@Override
protected void doEncodeEnd(ResponseWriter writer, FacesContext context,
UIComponent component) throws IOException {
- context.getResponseWriter().endElement(HTML.DIV_ELEM);
+ writer.startElement(HTML.SCRIPT_ELEM, component);
+ writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
+ writer.write("new RichFaces.ExtendedDataTable('" + component.getClientId(context) + "');");
+ writer.endElement(HTML.SCRIPT_ELEM);
+ writer.endElement(HTML.DIV_ELEM);
}
+
+ private void encodeStyle(ResponseWriter writer, FacesContext context,
+ UIDataTableBase table) throws IOException {
+ writer.startElement("style", table);
+ writer.writeAttribute(HTML.TYPE_ATTR, "text/css", null);
+ writer.writeText(".rich-extable-part-width{", null); //TODO getNormalizedId(context, state.getGrid())
+ writer.writeText("width: 100%;", "width");
+ writer.writeText("}", null);
+ int columnIndex = 0;
+ Iterator<UIComponent> columns = table.columns();
+ while (columns.hasNext()) {
+ UIComponent column = (UIComponent) columns.next();
+ String width = getColumnWidth(column);
+ writer.writeText(".rich-extable-cell-width-" + columnIndex++ + " {", "width"); //TODO getNormalizedId(context, state.getGrid())
+ writer.writeText("width: " + width + ";", "width");
+ writer.writeText("}", "width");
+ }
+ writer.endElement("style");
+ }
+
+ private void encodeHeaderOrFooter(ResponseWriter writer, FacesContext context,
+ UIDataTableBase table, String name) throws IOException {
+ if (isColumnFacetPresent(table, name)) {
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rich-extable-" + name, (String)table.getAttributes().get(name + "Class")), null);
+ writer.startElement(HTML.TABLE_ELEMENT, table);
+ writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
+ writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
+ writer.startElement(HTML.TBOBY_ELEMENT, table);
+ writer.startElement(HTML.TR_ELEMENT, table);
+ int columnIndex = 0;
+ Iterator<UIComponent> columns = table.columns();
+ writer.startElement(HTML.TD_ELEM, table);
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":n" + name.charAt(0) + "pe", null);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable" + ("footer".equals(name) ? "-footer" : "") + "-part rich-extable-part-width", null);
+ writer.startElement(HTML.TABLE_ELEMENT, table);
+ writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
+ writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
+ writer.startElement(HTML.TBOBY_ELEMENT, table);
+ writer.startElement(HTML.TR_ELEMENT, table);
+ while (columns.hasNext()) {
+ encodeHeaderOrFooterCell(context, writer, columns.next(), "rich-extable-" + name + "-cell", "rich-extable-cell-width-" + columnIndex++, name);
+ }
+ writer.endElement(HTML.TR_ELEMENT);
+ writer.endElement(HTML.TBOBY_ELEMENT);
+ writer.endElement(HTML.TABLE_ELEMENT);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.TD_ELEM);
+ writer.endElement(HTML.TR_ELEMENT);
+ writer.endElement(HTML.TBOBY_ELEMENT);
+ writer.endElement(HTML.TABLE_ELEMENT);
+ writer.endElement(HTML.DIV_ELEM);
+ }
+ }
+
+ private void encodeBody(ResponseWriter writer, FacesContext context,
+ UIDataTableBase table) throws IOException {
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":b", null);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-body", null);
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":c", null);
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.startElement(HTML.TABLE_ELEMENT, table);
+ writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
+ writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
+ writer.startElement(HTML.TBOBY_ELEMENT, table);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":tb", null);
+ writer.startElement(HTML.TR_ELEMENT, table);
+ writer.startElement(HTML.TD_ELEM, table);
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":nbpe", null);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-part rich-extable-part-width", null);
+ writer.startElement(HTML.TABLE_ELEMENT, table);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":nbte", null);
+ writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
+ writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
+ writer.startElement(HTML.TBOBY_ELEMENT, table);
+ encodeRows(context, table);
+ writer.endElement(HTML.TBOBY_ELEMENT);
+ writer.endElement(HTML.TABLE_ELEMENT);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.TD_ELEM);
+ writer.endElement(HTML.TR_ELEMENT);
+ writer.endElement(HTML.TBOBY_ELEMENT);
+ writer.endElement(HTML.TABLE_ELEMENT);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.DIV_ELEM);
+ }
+
+ private void encodeHeaderOrFooterCell(FacesContext context, ResponseWriter writer,
+ UIComponent column, String skinCellClass, String widthCellClass,
+ String facetName) throws IOException {
+ if (column.isRendered()) {
+
+ String classAttribute = facetName + "Class";
+ writer.startElement(HTML.TD_ELEM, column);
+ writer.startElement(HTML.DIV_ELEM, column);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, HtmlUtil.concatClasses(skinCellClass, widthCellClass,
+ (String) column.getAttributes().get(classAttribute)), null);
+
+
+ UIComponent facet = column.getFacet(facetName);
+ if (facet != null && facet.isRendered()) {
+ renderChild(context, facet);
+ }
+
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.TD_ELEM);
+ }
+ }
+
+ @Override
+ public void encodeRow(FacesContext context, RowHolder rowHolder)
+ throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ UIDataTableBase table = (UIDataTableBase) rowHolder.getRow(); //TODO Don't use cast this
+ writer.startElement(HTML.TR_ELEMENT, table);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context), null);
+ Iterator<UIComponent> columns = table.columns();
+ int columnIndex = 0;
+ while (columns.hasNext()) {
+ UIComponent column = (UIComponent) columns.next();
+ if (column.isRendered()) {
+ writer.startElement(HTML.TD_ELEM, table);
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-std2-cell rich-std2-cell-width-" + columnIndex++, null);
+ renderChildren(context, column);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.TD_ELEM);
+ }
+ }
+ writer.endElement(HTML.TR_ELEMENT);
+ }
+
+ private String getColumnWidth(UIComponent column) {
+ String width = (String) column.getAttributes().get("width");
+ if (width == null || width.indexOf("%") != -1) {
+ width = "100px";
+ }
+ return width;
+ }
+
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.css
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.css 2009-11-13 17:55:27 UTC (rev 15878)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.css 2009-11-13 17:56:29 UTC (rev 15879)
@@ -47,12 +47,12 @@
overflow: hidden;
}
-.rich-extable-footer-part{
+/*.rich-extable-footer-part{
overflow-x: auto;
overflow-y: visible;
-}
+}*/
-.rich-extable-cell, .rich-extable-header-cell{
+.rich-extable-cell, .rich-extable-header-cell, .rich-extable-footer-cell{
height: 20px;
overflow: hidden;
border-bottom: 1px solid #C4C0C9;
Added: root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.js
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.js (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.js 2009-11-13 17:56:29 UTC (rev 15879)
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+(function(richfaces, jQuery) {
+ richfaces.ExtendedDataTable = function(id) {
+ this.id = id;
+ this.element = document.getElementById(id);
+ this.bodyElement = document.getElementById(id + ":b");
+ this.contentElement = document.getElementById(id + ":c");
+ this.marginElement = this.contentElement.firstChild;//TODO this.marginElement = Richfaces.firstDescendant(this.contentElement);
+ this.dataTableElement = this.contentElement.lastChild;//TODO this.dataTableElement = Richfaces.lastDescendant(this.contentElement);
+ this.frozenHeaderPartElement = document.getElementById(id + ":fhpe");
+
+ this.normalPartStyle = Utils.getRule(".rich-std2-part-width").style;
+ this.resizerHolderStyle = Utils.getRule(".rich-std2-resizer-holder").style;
+ this.idSuffixs = [":nhpe", ":nbpe", ":nfpe"];
+
+ this.scrollElement = document.getElementById(this.id + this.idSuffixs[2]);
+
+ this.rows = document.getElementById(id + ":nbte").rows.length;
+
+ this.scrollListener = this.updateScrollPosition.bindAsEventListener(this);
+ Event.observe(this.scrollElement, 'scroll', this.scrollListener);
+ this.updateDataListener = this.updateData.bindAsEventListener(this);
+ Event.observe(this.bodyElement, 'scroll', this.updateDataListener);
+ this.resizeListener = this.updateLayout.bindAsEventListener(this);
+ Event.observe(window, 'resize', this.resizeListener);
+
+ var table = this;
+ jQuery(document).ready(function(){
+ table.contentElement.style.height = (table.rowCount * table.dataTableElement.offsetHeight / table.rows) + "px";
+ table.updateLayout();
+ });
+ };
+}(window.RichFaces, jQuery));
+
15 years, 1 month
JBoss Rich Faces SVN: r15878 - root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-11-13 12:55:27 -0500 (Fri, 13 Nov 2009)
New Revision: 15878
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml
Log:
RF-7864
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml 2009-11-13 13:54:53 UTC (rev 15877)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml 2009-11-13 17:55:27 UTC (rev 15878)
@@ -1,3 +1,4 @@
+<?xml version='1.0' encoding='UTF-8'?>
<!--
JBoss, Home of Professional Open Source
Copyright ${year}, Red Hat, Inc. and individual contributors
@@ -22,8 +23,6 @@
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<?xml version='1.0' encoding='UTF-8'?>
-
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
version="2.0">
15 years, 1 month
JBoss Rich Faces SVN: r15877 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: java/org/jboss/richfaces/integrationTest/tooltip and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2009-11-13 08:54:53 -0500 (Fri, 13 Nov 2009)
New Revision: 15877
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/style/StyleTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/style/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/locators.properties
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/messages.properties
Log:
* XPath locators replaced by jQuery locators
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/style/StyleTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/style/StyleTestCase.java 2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/style/StyleTestCase.java 2009-11-13 13:54:53 UTC (rev 15877)
@@ -67,7 +67,6 @@
selenium.click(locLink);
selenium.waitForPageToLoad(Long.toString(Wait.DEFAULT_TIMEOUT));
-
scrollIntoView(LOC_FIELDSET_HEADER, true);
assertEquals(msgColor, getStyle(LOC_PANEL, "background-color"), format(
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java 2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java 2009-11-13 13:54:53 UTC (rev 15877)
@@ -36,21 +36,21 @@
private final String LOC_FIELDSET_HEADER_2 = getLoc("FIELDSET_HEADER_2");
private final String LOC_TD_PREFORMATTED = getLoc("TD_PREFORMATTED");
- private final String LOC_DIV_TOOLTIP_ITEM_PREFORMATTED = getLoc("DIV_TOOLTIP_ITEM_PREFORMATTED");
- private final String LOC_OUTPUT_TOOLTIP_MAKE = format(LOC_DIV_TOOLTIP_ITEM_PREFORMATTED, Column.MAKE);
- private final String LOC_OUTPUT_TOOLTIP_MODEL = format(LOC_DIV_TOOLTIP_ITEM_PREFORMATTED, Column.MODEL);
- private final String LOC_OUTPUT_TOOLTIP_YEAR = format(LOC_DIV_TOOLTIP_ITEM_PREFORMATTED, Column.YEAR);
- private final String LOC_TD_MAKE_RELATIVE_TO_LABEL = getLoc("TD_MAKE_RELATIVE_TO_LABEL");
+ private final String LOC_OUTPUT_TOOLTIP_MAKE = getLoc("OUTPUT_TOOLTIP_MAKE");
+ private final String LOC_OUTPUT_TOOLTIP_MODEL = getLoc("OUTPUT_TOOLTIP_MODEL");
+ private final String LOC_OUTPUT_TOOLTIP_YEAR = getLoc("OUTPUT_TOOLTIP_YEAR");
+
+ private final String LOC_TD_MAKE_RELATIVE_TO_LABEL = getLoc("TD_MAKE_RELATIVE_TO_LABEL");
private final String LOC_TD_MAKE_RELATIVE_TO_ACTIVE_TOOLTIP_AREA = getLoc("TD_MAKE_RELATIVE_TO_ACTIVE_TOOLTIP_AREA");
private final String MSG_EVENT_COORDS_FOR_TABLE = getMsg("EVENT_COORDS_FOR_TABLE");
@Test
public void testIterateThroughTable() {
- int rows = selenium.getXpathCount(format(LOC_TD_PREFORMATTED, 0, Column.MAKE)).intValue();
+ int rows = getJQueryCount(format(LOC_TD_PREFORMATTED, 0, Column.MAKE));
for (int row = 1; row <= rows; row++) {
- final String locCellMake = format(LOC_TD_PREFORMATTED, row, Column.MAKE);
+ final String locCellMake = format(LOC_TD_PREFORMATTED, row, Column.MAKE);
final String locCellModel = format(LOC_TD_PREFORMATTED, row, Column.MODEL);
final String locCellYear = format(LOC_TD_PREFORMATTED, row, Column.YEAR);
final String locActiveTooltipArea = format(LOC_TD_MAKE_RELATIVE_TO_ACTIVE_TOOLTIP_AREA, locCellMake);
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java 2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java 2009-11-13 13:54:53 UTC (rev 15877)
@@ -137,9 +137,8 @@
assertFalse(selenium.isTextPresent(MSG_OUTPUT_TOOLTIP_3_4_TEXT));
selenium.clickAt(LOC_PANEL_SAMPLE_4, MSG_EVENT_COORDS_AT_PANEL);
-
tooltipsRequested = waitForTooltipChanges(tooltipsRequested, i == 0);
-
+
selenium.mouseOut(LOC_PANEL_SAMPLE_4);
waitForTextDisappears(MSG_OUTPUT_TOOLTIP_3_4_TEXT);
}
@@ -166,16 +165,17 @@
private Retrieve<Integer> retrieveRequestedTooltips = new Retrieve<Integer>() {
public Integer retrieve() {
- String text = Wait.interval(20).timeout(2000).waitForChangeAndReturn(null, new Retrieve<String>() {
+ String text = Wait.interval(10).timeout(2000).waitForChangeAndReturn(null, new Retrieve<String>() {
public String retrieve() {
- return getTextOrNull(LOC_SPAN_TOOLTIPS_REQUESTED);
+ String retrieved = getTextOrNull(LOC_SPAN_TOOLTIPS_REQUESTED);
+ return retrieved;
}
});
Matcher matcher = MSG_REGEXP_TOOLTIPS_REQUESTED.matcher(text);
if (!matcher.matches()) {
fail();
}
- return Integer.valueOf(matcher.group(1));
+ return Integer.valueOf(text);
}
};
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/style/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/style/locators.properties 2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/style/locators.properties 2009-11-13 13:54:53 UTC (rev 15877)
@@ -1,5 +1,5 @@
-FIELDSET_HEADER=//legend[text()\='Style demo']
-LINK_DEEP_MARINE=//a[text()\='DeepMarine']
-LINK_BLUE_SKY=//a[text()\='BlueSky']
-LINK_JAPAN_CHERRY=//a[text()\='JapanCherry']
-PANEL=//table[@class\='rsPanel']
\ No newline at end of file
+FIELDSET_HEADER=jquery=fieldset:eq(1)
+LINK_DEEP_MARINE=jquery=a:textEquals(DeepMarine)
+LINK_BLUE_SKY=jquery=a:textEquals(BlueSky)
+LINK_JAPAN_CHERRY=jquery=a:textEquals(JapanCherry)
+PANEL=jquery=table.rsPanel
\ No newline at end of file
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/locators.properties 2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/locators.properties 2009-11-13 13:54:53 UTC (rev 15877)
@@ -1,11 +1,14 @@
-FIELDSET_HEADER_1=//legend[text()\='ToolTip example']
-PANEL_SAMPLE_1=//div[contains(@id,'sample1')]
-PANEL_SAMPLE_2=//div[contains(@id,'sample2')]
-PANEL_SAMPLE_3=//div[contains(@id,'sample3')]
-PANEL_SAMPLE_4=//div[contains(@id,'sample4')]
-SPAN_TOOLTIPS_REQUESTED=//*[contains(@style,'display\: block')]//*[contains(text(),'tooltips requested\:')]/../..
-FIELDSET_HEADER_2=//*[normalize-space(@class)\='rich-table']
-TD_PREFORMATTED=//*[contains(@class,'rich-table')]//*[contains(@class,'rich-table-row')]{0,choice,0\#|1\#[{0}]}//*[contains(@class,'rich-table-cell')][{1,choice,0\#2|1\#3|2\#4}]
-DIV_TOOLTIP_ITEM_PREFORMATTED=//*[contains(@class,'rich-tool-tip') and contains(@style,'display\: block')]//*[text()\='Vehicle details\:']/../../../*/*/*[text()\='{0,choice,0\#make|1\#model|2\#year}\:']/following-sibling\:\:*[1]
-TD_MAKE_RELATIVE_TO_ACTIVE_TOOLTIP_AREA={0}/*
-TD_MAKE_RELATIVE_TO_LABEL={0}/*/*[contains(@id,'\:make')]
+FIELDSET_HEADER_1=jquery=legend:textEquals(ToolTip example)
+PANEL_SAMPLE_1=jquery=div#sample1_body
+PANEL_SAMPLE_2=jquery=div#sample2_body
+PANEL_SAMPLE_3=jquery=div[id$=sample3_body]
+PANEL_SAMPLE_4=jquery=div[id$=sample4_body]
+SPAN_TOOLTIPS_REQUESTED=jquery=div[style*=block] span[class*=tooltipData]
+
+FIELDSET_HEADER_2=jquery=table.rich-table
+TD_PREFORMATTED=jquery=tr.rich-table-row{0,choice,0\#|1\#:nth-child({0})} > td:nth-child({1,choice,0\#2|1\#3|2\#4})
+OUTPUT_TOOLTIP_MAKE=jquery=div[class*=rich-tool-tip][style*=block] tbody span[class*=tooltipData]:eq(0)
+OUTPUT_TOOLTIP_MODEL=jquery=div[class*=rich-tool-tip][style*=block] tbody span[class*=tooltipData]:eq(1)
+OUTPUT_TOOLTIP_YEAR=jquery=div[class*=rich-tool-tip][style*=block] tbody span[class*=tooltipData]:eq(2)
+TD_MAKE_RELATIVE_TO_ACTIVE_TOOLTIP_AREA={0} div
+TD_MAKE_RELATIVE_TO_LABEL={0} > div > span
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/messages.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/messages.properties 2009-11-13 13:21:50 UTC (rev 15876)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/tooltip/messages.properties 2009-11-13 13:54:53 UTC (rev 15877)
@@ -3,5 +3,5 @@
OUTPUT_TOOLTIP_2=This tool-tip content also pre-rendered to the page.
OUTPUT_TOOLTIP_3_4_WAITING=Wait...
OUTPUT_TOOLTIP_3_4_TEXT=This tool-tip content was rendered on server
-REGEXP_TOOLTIPS_REQUESTED=.*\\s(\\d+)$
+REGEXP_TOOLTIPS_REQUESTED=\\d+
EVENT_COORDS_FOR_TABLE=2,2
15 years, 1 month
JBoss Rich Faces SVN: r15876 - in branches/sandbox/3.3.X_JSF2: framework and 65 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-11-13 08:21:50 -0500 (Fri, 13 Nov 2009)
New Revision: 15876
Added:
branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/DataVisitResult.java
branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/DataVisitor.java
branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockApplication2.java
branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockFacesContext2.java
branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockResourceManager.java
branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockResourseHandler.java
branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/URLBuilder.java
branches/sandbox/3.3.X_JSF2/ui/core/src/test/java/org/ajax4jsf/component/URLBuilder.java
Modified:
branches/sandbox/3.3.X_JSF2/framework/api/pom.xml
branches/sandbox/3.3.X_JSF2/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java
branches/sandbox/3.3.X_JSF2/framework/impl/pom.xml
branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
branches/sandbox/3.3.X_JSF2/framework/jsf-test/pom.xml
branches/sandbox/3.3.X_JSF2/framework/pom.xml
branches/sandbox/3.3.X_JSF2/framework/test/pom.xml
branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/AbstractAjax4JsfTestCase.java
branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockExternalContext.java
branches/sandbox/3.3.X_JSF2/framework/test/src/test/resources/WEB-INF/web.xml
branches/sandbox/3.3.X_JSF2/pom.xml
branches/sandbox/3.3.X_JSF2/samples/pom.xml
branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/pom.xml
branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml
branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/templates/include/components-group.xhtml
branches/sandbox/3.3.X_JSF2/ui/assembly/pom.xml
branches/sandbox/3.3.X_JSF2/ui/beanValidator/pom.xml
branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputSecret.java
branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputText.java
branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputTextarea.java
branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/test/java/org/richfaces/component/BeanValidatorComponentTest.java
branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/test/java/org/richfaces/component/GraphValidatorComponentTest.java
branches/sandbox/3.3.X_JSF2/ui/calendar/pom.xml
branches/sandbox/3.3.X_JSF2/ui/colorPicker/pom.xml
branches/sandbox/3.3.X_JSF2/ui/columns/pom.xml
branches/sandbox/3.3.X_JSF2/ui/columns/src/main/config/component/columns.xml
branches/sandbox/3.3.X_JSF2/ui/columns/src/test/java/org/richfaces/jsp/tag/ColumnsJspTagTest.java
branches/sandbox/3.3.X_JSF2/ui/combobox/pom.xml
branches/sandbox/3.3.X_JSF2/ui/componentControl/pom.xml
branches/sandbox/3.3.X_JSF2/ui/componentControl/src/test/java/org/richfaces/component/ComponentControlTest.java
branches/sandbox/3.3.X_JSF2/ui/contextMenu/pom.xml
branches/sandbox/3.3.X_JSF2/ui/core/src/main/config/component/actionParameter.xml
branches/sandbox/3.3.X_JSF2/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java
branches/sandbox/3.3.X_JSF2/ui/core/src/test/java/org/ajax4jsf/component/UIAjaxFormTest.java
branches/sandbox/3.3.X_JSF2/ui/core/src/test/resources/org/ajax4jsf/component/queue-ajax-form.xhtml
branches/sandbox/3.3.X_JSF2/ui/dataFilterSlider/pom.xml
branches/sandbox/3.3.X_JSF2/ui/datascroller/pom.xml
branches/sandbox/3.3.X_JSF2/ui/dropdown-menu/pom.xml
branches/sandbox/3.3.X_JSF2/ui/editor/pom.xml
branches/sandbox/3.3.X_JSF2/ui/extendedDataTable/pom.xml
branches/sandbox/3.3.X_JSF2/ui/fileUpload/pom.xml
branches/sandbox/3.3.X_JSF2/ui/functions/pom.xml
branches/sandbox/3.3.X_JSF2/ui/hotKey/pom.xml
branches/sandbox/3.3.X_JSF2/ui/hotKey/src/test/java/org/richfaces/component/HotKeyComponentTest.java
branches/sandbox/3.3.X_JSF2/ui/inplaceInput/pom.xml
branches/sandbox/3.3.X_JSF2/ui/inplaceSelect/pom.xml
branches/sandbox/3.3.X_JSF2/ui/layout/pom.xml
branches/sandbox/3.3.X_JSF2/ui/menu-components/pom.xml
branches/sandbox/3.3.X_JSF2/ui/message/pom.xml
branches/sandbox/3.3.X_JSF2/ui/message/src/test/java/org/richfaces/renderer/RichMessageRendererTest.java
branches/sandbox/3.3.X_JSF2/ui/message/src/test/java/org/richfaces/renderer/RichMessagesRendererTest.java
branches/sandbox/3.3.X_JSF2/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
branches/sandbox/3.3.X_JSF2/ui/panel/pom.xml
branches/sandbox/3.3.X_JSF2/ui/panelmenu/pom.xml
branches/sandbox/3.3.X_JSF2/ui/pickList/pom.xml
branches/sandbox/3.3.X_JSF2/ui/pom.xml
branches/sandbox/3.3.X_JSF2/ui/progressBAR/pom.xml
branches/sandbox/3.3.X_JSF2/ui/scrollableDataTable/pom.xml
branches/sandbox/3.3.X_JSF2/ui/simpleTogglePanel/pom.xml
branches/sandbox/3.3.X_JSF2/ui/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java
branches/sandbox/3.3.X_JSF2/ui/spacer/pom.xml
branches/sandbox/3.3.X_JSF2/ui/state/pom.xml
branches/sandbox/3.3.X_JSF2/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java
branches/sandbox/3.3.X_JSF2/ui/suggestionbox/pom.xml
branches/sandbox/3.3.X_JSF2/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
branches/sandbox/3.3.X_JSF2/ui/tabPanel/pom.xml
branches/sandbox/3.3.X_JSF2/ui/togglePanel/pom.xml
branches/sandbox/3.3.X_JSF2/ui/toolBar/pom.xml
branches/sandbox/3.3.X_JSF2/ui/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java
branches/sandbox/3.3.X_JSF2/ui/tooltip/pom.xml
branches/sandbox/3.3.X_JSF2/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
branches/sandbox/3.3.X_JSF2/ui/treeModel/pom.xml
Log:
Modified: branches/sandbox/3.3.X_JSF2/framework/api/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/api/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/framework/api/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -2,7 +2,7 @@
<parent>
<artifactId>framework</artifactId>
<groupId>org.richfaces</groupId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.framework</groupId>
Modified: branches/sandbox/3.3.X_JSF2/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/framework/api/src/main/java/org/ajax4jsf/model/DataVisitor.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -22,7 +22,6 @@
package org.ajax4jsf.model;
import java.io.IOException;
-
import javax.faces.context.FacesContext;
/**
Modified: branches/sandbox/3.3.X_JSF2/framework/impl/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/impl/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/framework/impl/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -3,7 +3,7 @@
<parent>
<artifactId>framework</artifactId>
<groupId>org.richfaces</groupId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.framework</groupId>
Added: branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/DataVisitResult.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/DataVisitResult.java (rev 0)
+++ branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/DataVisitResult.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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.ajax4jsf.component;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public enum DataVisitResult {CONTINUE, STOP}
Added: branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/DataVisitor.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/DataVisitor.java (rev 0)
+++ branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/DataVisitor.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -0,0 +1,43 @@
+/**
+ * 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.ajax4jsf.component;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * Interface for classes, able to receive visitor processing calls from ExtendedDataModel
+ * @author shura
+ *
+ */
+public interface DataVisitor {
+
+ /**
+ * This method called back ( as visitor ) from {@link ExtendedDataModel#walk(FacesContext, DataVisitor, Range)} for
+ * each row.
+ * @param context current JSF context.
+ * @param rowKey current row key of DataModel
+ * @param argument Implementation-specific argument
+ */
+ public DataVisitResult process(FacesContext context, Object rowKey, Object argument);
+}
Modified: branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -42,6 +42,9 @@
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
+import javax.faces.component.visit.VisitCallback;
+import javax.faces.component.visit.VisitContext;
+import javax.faces.component.visit.VisitResult;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
@@ -562,6 +565,47 @@
}
}
+ public boolean visitTree(VisitContext context, VisitCallback callback) {
+
+ // First check to see whether we are visitable. If not
+ // short-circuit out of this subtree, though allow the
+ // visit to proceed through to other subtrees.
+ if (!isVisitable(context))
+ return false;
+
+ // Push ourselves to EL before visiting
+ FacesContext facesContext = context.getFacesContext();
+ pushComponentToEL(facesContext, null);
+
+ try {
+ // Visit ourselves. Note that we delegate to the
+ // VisitContext to actually perform the visit.
+ VisitResult result = context.invokeVisitCallback(this, callback);
+
+ // If the visit is complete, short-circuit out and end the visit
+ if (result == VisitResult.COMPLETE)
+ return true;
+
+ // Visit children if necessary
+ if (result == VisitResult.ACCEPT) {
+ Iterator<UIComponent> kids = this.getFacetsAndChildren();
+
+ while (kids.hasNext()) {
+ boolean done = kids.next().visitTree(context, callback);
+
+ // If any kid visit returns true, we are done.
+ if (done)
+ return true;
+ }
+ }
+ } finally {
+ // Pop ourselves off the EL stack
+ popComponentFromEL(facesContext);
+ }
+
+ // Return false to allow the visit to continue
+ return false;
+ }
/**
* @param var
* @param attrs
Modified: branches/sandbox/3.3.X_JSF2/framework/jsf-test/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/jsf-test/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/framework/jsf-test/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -4,24 +4,16 @@
<parent>
<artifactId>framework</artifactId>
<groupId>org.richfaces</groupId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.framework</groupId>
<artifactId>jsf-test</artifactId>
<name>jsf-test</name>
<version>3.3.3-jsf2-SNAPSHOT</version>
- <profiles>
- <profile>
- <id>jsf2</id>
- <properties>
- <jsf.api.groupId>com.sun.faces</jsf.api.groupId>
- <jsf.impl.groupId>com.sun.faces</jsf.impl.groupId>
- <jsf.api.version>2.0.1</jsf.api.version>
- <jsf.impl.version>2.0.1</jsf.impl.version>
- </properties>
- <dependencies>
- <dependency>
+
+ <dependencies>
+ <dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.1</version>
@@ -33,34 +25,6 @@
<version>2.0.1</version>
<scope>provided</scope>
</dependency>
- </dependencies>
- </profile>
-<profile>
- <id>jsf1.2</id>
- <properties>
- <jsf.api.groupId>javax.faces</jsf.api.groupId>
- <jsf.impl.groupId>javax.faces</jsf.impl.groupId>
- <jsf.api.version>1.2_12</jsf.api.version>
- <jsf.impl.version>1.2_12</jsf.impl.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_12</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_12</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
- <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Modified: branches/sandbox/3.3.X_JSF2/framework/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/framework/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -57,12 +57,6 @@
<profiles>
<profile>
<id>jsf2</id>
- <properties>
- <jsf.api.groupId>com.sun.faces</jsf.api.groupId>
- <jsf.impl.groupId>com.sun.faces</jsf.impl.groupId>
- <jsf.api.version>2.0.1</jsf.api.version>
- <jsf.impl.version>2.0.1</jsf.impl.version>
- </properties>
<dependencies>
<dependency>
<groupId>com.sun.faces</groupId>
@@ -74,12 +68,6 @@
</profile>
<profile>
<id>jsf1.2</id>
- <properties>
- <jsf.api.groupId>javax.faces</jsf.api.groupId>
- <jsf.impl.groupId>javax.faces</jsf.impl.groupId>
- <jsf.api.version>1.2_12</jsf.api.version>
- <jsf.impl.version>1.2_12</jsf.impl.version>
- </properties>
<dependencies>
<dependency>
<groupId>javax.faces</groupId>
Modified: branches/sandbox/3.3.X_JSF2/framework/test/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/test/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/framework/test/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -2,7 +2,7 @@
<parent>
<artifactId>framework</artifactId>
<groupId>org.richfaces</groupId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.framework</groupId>
@@ -10,44 +10,19 @@
<version>3.3.3-jsf2-SNAPSHOT</version>
<name>Ajax4Jsf test framework</name>
<url>https://ajax4jsf.dev.java.net</url>
- <profiles>
- <profile>
- <id>jsf2</id>
- <properties>
- <jsf.api.groupId>com.sun.faces</jsf.api.groupId>
- <jsf.impl.groupId>com.sun.faces</jsf.impl.groupId>
- <jsf.api.version>2.0.1</jsf.api.version>
- <jsf.impl.version>2.0.1</jsf.impl.version>
- </properties>
- <dependencies>
- <dependency>
+ <dependencies>
+ <dependency>
<groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
+ <artifactId>jsf-api</artifactId>
<version>2.0.1</version>
<scope>provided</scope>
</dependency>
- </dependencies>
- </profile>
-<profile>
- <id>jsf1.2</id>
- <properties>
- <jsf.api.groupId>javax.faces</jsf.api.groupId>
- <jsf.impl.groupId>javax.faces</jsf.impl.groupId>
- <jsf.api.version>1.2_12</jsf.api.version>
- <jsf.impl.version>1.2_12</jsf.impl.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>javax.faces</groupId>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_12</version>
+ <version>2.0.1</version>
<scope>provided</scope>
</dependency>
- </dependencies>
- </profile>
- </profiles>
-
- <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -79,7 +54,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>${richfaces.version}</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
Modified: branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/AbstractAjax4JsfTestCase.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/AbstractAjax4JsfTestCase.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/AbstractAjax4JsfTestCase.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,8 +44,10 @@
import javax.el.ExpressionFactory;
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
+import javax.faces.application.ResourceHandler;
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.render.RenderKitFactory;
@@ -94,6 +96,11 @@
import com.gargoylesoftware.htmlunit.WebResponseData;
import com.gargoylesoftware.htmlunit.WebResponseImpl;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.sun.faces.RIConstants;
+import com.sun.faces.application.ApplicationAssociate;
+import com.sun.faces.application.ApplicationImpl;
+import com.sun.faces.application.resource.ResourceHandlerImpl;
+import com.sun.faces.component.visit.VisitContextFactoryImpl;
/**
* Base class for testing components and renderers in a4j framework
@@ -159,12 +166,14 @@
// Setup FacesContext with necessary init parameters.
this.servletContext.addInitParameter(SkinFactory.SKIN_PARAMETER, getSkinName());
+ this.servletContext.addInitParameter("com.sun.faces.allowTextChildren", "true");
this.servletContext.addInitParameter("com.sun.faces.externalizeJavaScript", "true");
// setup VCP renderKit, create renderers.
RenderKitFactory vcpRenderKitFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+ FactoryFinder.setFactory(FactoryFinder.VISIT_CONTEXT_FACTORY, "com.sun.faces.component.visit.VisitContextFactoryImpl");
vcpRenderKit = new ChameleonRenderKitImpl();
vcpRenderKitFactory.addRenderKit("HTML_CHAMELEON", vcpRenderKit);
renderKit.addRenderer(UIViewRoot.COMPONENT_FAMILY, UIViewRoot.COMPONENT_TYPE, new AjaxViewRootRenderer());
@@ -175,7 +184,7 @@
request.setAttribute(AjaxContext.AJAX_CONTEXT_KEY, ajaxContext);
// Setup ViewHandler / ViewRoot.
application.setViewHandler(new MockViewHandler(application.getViewHandler()));
-
+ application = new MockApplication2(application);
UIViewRoot root = new MockViewRoot();
root.setViewId("/viewId");
root.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
@@ -185,7 +194,8 @@
servletContext.setAttribute("a4jSkin", new SkinBean());
// Setup servlet context and testing web.xml
request.setPathElements("/testContext","/faces","/vievId.jsf","");
-
+ ResourceHandler handler = new MockResourseHandler();
+ application.setResourceHandler(handler);
File webRoot = new File(getClass().getResource("/WEB-INF/web.xml").getFile()).getParentFile().getParentFile();
if (webRoot.exists()) {
servletContext.setDocumentRoot(webRoot);
@@ -244,9 +254,10 @@
while (resources.hasMoreElements()) {
parser.parse((URL) resources.nextElement());
}
-
+ facesContext = new MockFacesContext2(facesContext);
externalContext = new MockExternalContext(externalContext);
facesContext.setExternalContext(externalContext);
+ facesContext.setApplication(application);
elContext = facesContext.getELContext();
expressionFactory = application.getExpressionFactory();
}
@@ -581,7 +592,7 @@
response.setContentType("text/html");
ResponseWriter responseWriter = renderKit.createResponseWriter(response.getWriter(),"text/html",null);
UIViewRoot viewRoot = facesContext.getViewRoot();
-
+
facesContext.setResponseWriter(responseWriter);
encodeDocumentProlog(facesContext, viewRoot, responseWriter);
Added: branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockApplication2.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockApplication2.java (rev 0)
+++ branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockApplication2.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -0,0 +1,300 @@
+package org.ajax4jsf.tests;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Locale;
+
+import javax.el.ELContextListener;
+import javax.el.ELResolver;
+import javax.el.ExpressionFactory;
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.application.NavigationHandler;
+import javax.faces.application.ResourceHandler;
+import javax.faces.application.StateManager;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.PropertyResolver;
+import javax.faces.el.ReferenceSyntaxException;
+import javax.faces.el.ValueBinding;
+import javax.faces.el.VariableResolver;
+import javax.faces.event.ActionListener;
+import javax.faces.event.SystemEvent;
+import javax.faces.validator.Validator;
+
+import org.apache.shale.test.mock.MockApplication;
+
+import com.sun.faces.application.resource.ResourceHandlerImpl;
+
+
+public class MockApplication2 extends MockApplication{
+ private MockApplication application;
+ private ResourceHandler resourceHandler;
+
+ public MockApplication2() {
+ }
+
+ public MockApplication2(MockApplication application2) {
+ application = application2;
+ }
+
+ @Override
+ public void addComponent(String componentType, String componentClass) {
+ application.addComponent(componentType, componentClass);
+
+ }
+
+ @Override
+ public void addConverter(String converterId, String converterClass) {
+ if(application != null){
+ application.addConverter(converterId, converterClass);
+ }
+
+
+ }
+ public ELResolver getELResolver(){
+ return application.getELResolver();
+ }
+ public ExpressionFactory getExpressionFactory() {
+
+ return application.getExpressionFactory();
+
+ }
+ @Override
+ public ELContextListener [] getELContextListeners() {
+
+ return application.getELContextListeners();
+
+ }
+
+ @Override
+ public void publishEvent(FacesContext context,
+ Class<? extends SystemEvent> systemEventClass, Object source) {
+
+ return ;
+
+ }
+
+ public void setResourceHandler(ResourceHandler resourceHandler) {
+
+ this.resourceHandler = resourceHandler;
+
+ }
+
+ public ResourceHandler getResourceHandler() {
+
+ return resourceHandler;
+
+ }
+
+ @Override
+ public void addValidator(String validatorId, String validatorClass) {
+ application.addValidator(validatorId, validatorClass);
+
+ }
+
+ @Override
+ public UIComponent createComponent(String arg0) throws FacesException {
+ // TODO Auto-generated method stub
+ return application.createComponent(arg0);
+ }
+
+ @Override
+ public UIComponent createComponent(ValueBinding arg0, FacesContext arg1,
+ String arg2) throws FacesException {
+ // TODO Auto-generated method stub
+ return application.createComponent(arg0, arg1, arg2);
+ }
+
+ @Override
+ public Converter createConverter(String arg0) {
+ // TODO Auto-generated method stub
+ return application.createConverter(arg0);
+ }
+
+ @Override
+ public Converter createConverter(Class arg0) {
+ // TODO Auto-generated method stub
+ return application.createConverter(arg0);
+ }
+
+ @Override
+ public Validator createValidator(String arg0) throws FacesException {
+ // TODO Auto-generated method stub
+ return application.createValidator(arg0);
+ }
+
+ @Override
+ public ValueBinding createValueBinding(String ref)
+ throws ReferenceSyntaxException {
+ // TODO Auto-generated method stub
+ return application.createValueBinding(ref);
+ }
+
+ @Override
+ public ActionListener getActionListener() {
+ // TODO Auto-generated method stub
+ return application.getActionListener();
+ }
+
+ @Override
+ public Iterator<String> getComponentTypes() {
+ // TODO Auto-generated method stub
+ return application.getComponentTypes();
+ }
+
+ @Override
+ public Iterator<String> getConverterIds() {
+ // TODO Auto-generated method stub
+ return application.getConverterIds();
+ }
+
+ @Override
+ public Iterator<Class<?>> getConverterTypes() {
+ // TODO Auto-generated method stub
+ return application.getConverterTypes();
+ }
+
+ @Override
+ public Locale getDefaultLocale() {
+ // TODO Auto-generated method stub
+ return application.getDefaultLocale();
+ }
+
+ @Override
+ public String getDefaultRenderKitId() {
+ // TODO Auto-generated method stub
+ return application.getDefaultRenderKitId();
+ }
+
+ @Override
+ public String getMessageBundle() {
+ // TODO Auto-generated method stub
+ return application.getMessageBundle();
+ }
+
+ @Override
+ public NavigationHandler getNavigationHandler() {
+ // TODO Auto-generated method stub
+ return application.getNavigationHandler();
+ }
+
+ @Override
+ public PropertyResolver getPropertyResolver() {
+ // TODO Auto-generated method stub
+ return application.getPropertyResolver();
+ }
+
+ @Override
+ public StateManager getStateManager() {
+ // TODO Auto-generated method stub
+ return application.getStateManager();
+ }
+
+ @Override
+ public Iterator<Locale> getSupportedLocales() {
+ // TODO Auto-generated method stub
+ return application.getSupportedLocales();
+ }
+
+ @Override
+ public Iterator<String> getValidatorIds() {
+ // TODO Auto-generated method stub
+ return application.getValidatorIds();
+ }
+
+ @Override
+ public VariableResolver getVariableResolver() {
+ // TODO Auto-generated method stub
+ return application.getVariableResolver();
+ }
+
+ @Override
+ public ViewHandler getViewHandler() {
+ // TODO Auto-generated method stub
+ return application.getViewHandler();
+ }
+
+ @Override
+ public void setActionListener(ActionListener actionListener) {
+ if(application != null){
+ application.setActionListener(actionListener);
+ }
+
+
+ }
+
+ @Override
+ public void setDefaultLocale(Locale defaultLocale) {
+ if(application != null){
+ application.setDefaultLocale(defaultLocale);
+ }
+
+
+ }
+
+ @Override
+ public void setDefaultRenderKitId(String defaultRenderKitId) {
+ if(application != null){
+ application.setDefaultRenderKitId(defaultRenderKitId);
+ }
+
+
+ }
+
+ @Override
+ public void setMessageBundle(String messageBundle) {
+ application.setMessageBundle(messageBundle);
+
+ }
+
+ @Override
+ public void setNavigationHandler(NavigationHandler navigationHandler) {
+ if(application != null){
+ application.setNavigationHandler(navigationHandler);
+ }
+
+
+ }
+
+ @Override
+ public void setPropertyResolver(PropertyResolver propertyResolver) {
+ if(application != null){
+ application.setPropertyResolver(propertyResolver);
+ }
+
+
+ }
+
+ @Override
+ public void setStateManager(StateManager stateManager) {
+ if(application != null){
+ application.setStateManager(stateManager);
+ }
+
+
+ }
+
+ @Override
+ public void setVariableResolver(VariableResolver variableResolver) {
+ if(application != null){
+ application.setVariableResolver(variableResolver);
+ }
+
+
+ }
+
+ @Override
+ public void setViewHandler(ViewHandler viewHandler) {
+ if(application != null){
+ application.setViewHandler(viewHandler);
+ }
+
+
+ }
+
+
+}
Modified: branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockExternalContext.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockExternalContext.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockExternalContext.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -22,17 +22,31 @@
package org.ajax4jsf.tests;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.Principal;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.Flash;
+import javax.faces.context.PartialResponseWriter;
+import javax.faces.context.PartialViewContext;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -44,12 +58,12 @@
* @author Siarhej Chalipau
*
*/
-public class MockExternalContext extends MockExternalContext12 {
+public class MockExternalContext extends MockExternalContext12{
/*
* Realizes methods unimplemented by org.apache.shale.test.mock.MockExternalContext operations.
*
*/
-
+ private MockExternalContext12 mockContext;
private Map requestParameterValuesMap = null;
private Map requestHeaderMap = null;
private Map requestHeaderValuesMap = null;
@@ -59,8 +73,22 @@
public MockExternalContext(org.apache.shale.test.mock.MockExternalContext baseContext) {
super((ServletContext)baseContext.getContext(),
(HttpServletRequest)baseContext.getRequest(), (HttpServletResponse)baseContext.getResponse());
+ mockContext = this;
}
+
+ @Override
+ public String encodePartialActionURL(String url) {
+ UrlBuilder builder = new UrlBuilder(url, getResponseCharacterEncoding());
+ return ((HttpServletResponse) mockContext.getResponse()).encodeURL(builder.createUrl());
+ }
+ @Override
+ public String getResponseCharacterEncoding() {
+
+ return super.getResponseCharacterEncoding();
+
+ }
+
public Map getRequestParameterValuesMap() {
if (null == requestParameterValuesMap) {
requestParameterValuesMap = new HashMap();
@@ -76,9 +104,15 @@
public void dispatch(String requestURI)
throws IOException, FacesException {
//TODO hans, should be implemented
- super.dispatch(requestURI);
+ mockContext.dispatch(requestURI);
}
+ public String getMimeType(String file) {
+
+ return "xhtml";
+
+ }
+
public Map getRequestHeaderMap() {
if (null == requestHeaderMap) {
requestHeaderMap = new TreeMap(CASE_INSENSITIVE_COMPARATOR);
@@ -142,7 +176,7 @@
public void redirect(String requestURI) throws IOException {
// TODO hans, should be implemented
- super.redirect(requestURI);
+ mockContext.redirect(requestURI);
}
protected final static Comparator CASE_INSENSITIVE_COMPARATOR = new Comparator() {
@@ -152,5 +186,5 @@
return s0.toUpperCase().compareTo(s1.toUpperCase());
}
};
-
+
}
Added: branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockFacesContext2.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockFacesContext2.java (rev 0)
+++ branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockFacesContext2.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -0,0 +1,178 @@
+package org.ajax4jsf.tests;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.el.ELContext;
+import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseStream;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.RenderKit;
+
+import org.apache.shale.test.mock.MockFacesContext;
+
+public class MockFacesContext2 extends MockFacesContext{
+
+ MockFacesContext facesContext;
+ private boolean validationFailed;
+ Map<Object, Object> attributes;
+
+ public MockFacesContext2(MockFacesContext facesContext) {
+ this.facesContext = facesContext;
+ }
+
+ public Map<Object,Object> getAttributes(){
+ if (attributes == null) {
+ attributes = new HashMap<Object, Object>();
+ }
+ Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
+ if(requestMap != null){
+ for(String entry : requestMap.keySet()){
+ attributes.put(entry, requestMap.get(entry));
+ }
+ }
+ return attributes;
+ }
+
+ public ELContext getELContext() {
+
+ return facesContext.getELContext();
+
+ }
+
+ public void validationFailed() {
+ validationFailed = true;
+ }
+
+ @Override
+ public void addMessage(String clientId, FacesMessage message) {
+ facesContext.addMessage(clientId, message);
+
+ }
+
+ @Override
+ public Application getApplication() {
+ // TODO Auto-generated method stub
+ return facesContext.getApplication();
+ }
+
+ @Override
+ public void setApplication(Application application) {
+ // TODO Auto-generated method stub
+ facesContext.setApplication(application);
+ }
+
+ @Override
+ public Iterator<String> getClientIdsWithMessages() {
+ // TODO Auto-generated method stub
+ return facesContext.getClientIdsWithMessages();
+ }
+
+ @Override
+ public ExternalContext getExternalContext() {
+ // TODO Auto-generated method stub
+ return facesContext.getExternalContext();
+ }
+
+ @Override
+ public void setExternalContext(ExternalContext extContext) {
+ // TODO Auto-generated method stub
+ facesContext.setExternalContext(extContext);
+ }
+
+ @Override
+ public Severity getMaximumSeverity() {
+ // TODO Auto-generated method stub
+ return facesContext.getMaximumSeverity();
+ }
+
+ @Override
+ public Iterator<FacesMessage> getMessages() {
+ // TODO Auto-generated method stub
+ return facesContext.getMessages();
+ }
+
+ @Override
+ public Iterator<FacesMessage> getMessages(String clientId) {
+ // TODO Auto-generated method stub
+ return facesContext.getMessages(clientId);
+ }
+
+ @Override
+ public RenderKit getRenderKit() {
+ // TODO Auto-generated method stub
+ return facesContext.getRenderKit();
+ }
+
+ @Override
+ public boolean getRenderResponse() {
+ // TODO Auto-generated method stub
+ return facesContext.getRenderResponse();
+ }
+
+ @Override
+ public boolean getResponseComplete() {
+ // TODO Auto-generated method stub
+ return facesContext.getResponseComplete();
+ }
+
+ @Override
+ public ResponseStream getResponseStream() {
+ // TODO Auto-generated method stub
+ return facesContext.getResponseStream();
+ }
+
+ @Override
+ public ResponseWriter getResponseWriter() {
+ // TODO Auto-generated method stub
+ return facesContext.getResponseWriter();
+ }
+
+ @Override
+ public UIViewRoot getViewRoot() {
+ // TODO Auto-generated method stub
+ return facesContext.getViewRoot();
+ }
+
+ @Override
+ public void release() {
+ facesContext.release();
+
+ }
+
+ @Override
+ public void renderResponse() {
+ facesContext.renderResponse();
+
+ }
+
+ @Override
+ public void responseComplete() {
+ facesContext.responseComplete();
+
+ }
+
+ @Override
+ public void setResponseStream(ResponseStream responseStream) {
+ facesContext.setResponseStream(responseStream);
+
+ }
+
+ @Override
+ public void setResponseWriter(ResponseWriter responseWriter) {
+ facesContext.setResponseWriter(responseWriter);
+
+ }
+
+ @Override
+ public void setViewRoot(UIViewRoot viewRoot) {
+ facesContext.setViewRoot(viewRoot);
+
+ }
+}
Added: branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockResourceManager.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockResourceManager.java (rev 0)
+++ branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockResourceManager.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -0,0 +1,20 @@
+package org.ajax4jsf.tests;
+
+import javax.faces.context.FacesContext;
+
+import com.sun.faces.application.resource.LibraryInfo;
+import com.sun.faces.application.resource.ResourceCache;
+import com.sun.faces.application.resource.ResourceManager;
+
+public class MockResourceManager extends ResourceManager {
+
+ public MockResourceManager(ResourceCache cache) {
+ super(cache);
+ }
+
+ public LibraryInfo findLibrary(String libraryName,
+ String localePrefix,
+ FacesContext ctx) {
+ return null;
+ }
+}
Added: branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockResourseHandler.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockResourseHandler.java (rev 0)
+++ branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/MockResourseHandler.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -0,0 +1,517 @@
+package org.ajax4jsf.tests;
+
+import com.sun.faces.application.resource.LibraryInfo;
+import com.sun.faces.application.resource.ResourceCache;
+import com.sun.faces.application.resource.ResourceImpl;
+import com.sun.faces.application.resource.ResourceInfo;
+import com.sun.faces.config.WebConfiguration;
+import static com.sun.faces.config.WebConfiguration.WebContextInitParameter.*;
+import com.sun.faces.util.FacesLogger;
+import com.sun.faces.util.RequestStateManager;
+import com.sun.faces.util.Util;
+
+import javax.faces.application.ProjectStage;
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.ByteBuffer;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Pattern;
+
+/**
+ * This is the default implementation of {@link ResourceHandler}.
+ */
+public class MockResourseHandler extends ResourceHandler {
+
+ // Log instance for this class
+ private static final Logger LOGGER = FacesLogger.APPLICATION.getLogger();
+
+ MockResourceManager manager;
+ List<Pattern> excludePatterns;
+ private long creationTime;
+ private long maxAge;
+ private WebConfiguration webconfig;
+
+ // ------------------------------------------------------------ Constructors
+
+
+ /**
+ * Creates a new instance of ResourceHandlerImpl
+ */
+ public MockResourseHandler() {
+
+ creationTime = System.currentTimeMillis();
+ webconfig = WebConfiguration.getInstance();
+ ExternalContext extContext = FacesContext.getCurrentInstance().getExternalContext();
+ ResourceCache cache = new ResourceCache();
+ manager = new MockResourceManager(cache);
+ initExclusions();
+ initMaxAge();
+
+ }
+
+
+ // ------------------------------------------- Methods from Resource Handler
+
+
+ /**
+ * @see ResourceHandler#createResource(String)
+ */
+ public Resource createResource(String resourceName) {
+
+ Util.notNull("resourceName", resourceName);
+
+ return createResource(resourceName, null, null);
+
+ }
+
+
+ /**
+ * @see ResourceHandler#createResource(String, String)
+ */
+ public Resource createResource(String resourceName, String libraryName) {
+
+ Util.notNull("resourceName", resourceName);
+
+ return createResource(resourceName, libraryName, null);
+
+ }
+
+
+ /**
+ * @see ResourceHandler#createResource(String, String, String)
+ */
+ public Resource createResource(String resourceName,
+ String libraryName,
+ String contentType) {
+
+ Util.notNull("resourceName", resourceName);
+ FacesContext ctx = FacesContext.getCurrentInstance();
+
+ boolean development = ctx.isProjectStage(ProjectStage.Development);
+
+ String ctype = ((contentType != null)
+ ? contentType
+ : getContentType(ctx, resourceName));
+ ResourceInfo info = manager.findResource(libraryName,
+ resourceName,
+ ctype,
+ ctx);
+ if (info == null) {
+ // prevent message from being when we're dealing with
+ // groovy is present and Application.createComponent()
+ // tries to resolve a .groovy file as backing UIComponent.
+ if (!development && "application/x-groovy".equals(ctype)) {
+ return null;
+ }
+ logMissingResource(ctx, resourceName, libraryName, null);
+ return null;
+ } else {
+ return new ResourceImpl(info, ctype, creationTime, maxAge);
+ }
+
+ }
+
+ @Override
+ public boolean libraryExists(String libraryName) {
+
+ if (libraryName.contains("../")) {
+ return false;
+ }
+ FacesContext context = FacesContext.getCurrentInstance();
+ LibraryInfo info = manager.findLibrary(libraryName, null, context);
+ return (info != null);
+
+ }
+
+ /**
+ * @see ResourceHandler#isResourceRequest(javax.faces.context.FacesContext)
+ */
+ public boolean isResourceRequest(FacesContext context) {
+
+ Boolean isResourceRequest = (Boolean)
+ RequestStateManager.get(context,
+ RequestStateManager.RESOURCE_REQUEST);
+ if (isResourceRequest == null) {
+ String resourceId = normalizeResourceRequest(context);
+ isResourceRequest = (resourceId != null
+ ? resourceId.startsWith(RESOURCE_IDENTIFIER)
+ : Boolean.FALSE);
+ RequestStateManager.set(context,
+ RequestStateManager.RESOURCE_REQUEST,
+ isResourceRequest);
+ }
+
+ return (isResourceRequest);
+
+ }
+
+ @Override
+ public String getRendererTypeForResourceName(String resourceName) {
+ String rendererType = null;
+
+ String contentType = getContentType(FacesContext.getCurrentInstance(),
+ resourceName);
+ if (null != contentType) {
+ contentType = contentType.toLowerCase();
+ if (-1 != contentType.indexOf("javascript")) {
+ rendererType = "javax.faces.resource.Script";
+ }
+ else if (-1 != contentType.indexOf("css")) {
+ rendererType = "javax.faces.resource.Stylesheet";
+ }
+ }
+ return rendererType;
+ }
+
+
+
+
+
+ /**
+ * @see javax.faces.application.ResourceHandler#handleResourceRequest(javax.faces.context.FacesContext)
+ */
+ public void handleResourceRequest(FacesContext context) throws IOException {
+
+ String resourceId = normalizeResourceRequest(context);
+ // handleResourceRequest called for a non-resource request,
+ // bail out.
+ if (resourceId == null) {
+ return;
+ }
+
+ ExternalContext extContext = context.getExternalContext();
+
+ if (isExcluded(resourceId)) {
+ extContext.setResponseStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
+ assert (null != resourceId);
+ assert (resourceId.startsWith(RESOURCE_IDENTIFIER));
+
+ Resource resource = null;
+ String resourceName = null;
+ String libraryName = null;
+ if (ResourceHandler.RESOURCE_IDENTIFIER.length() < resourceId.length()) {
+ resourceName = resourceId.substring(RESOURCE_IDENTIFIER.length() + 1);
+ assert(resourceName != null);
+ libraryName = context.getExternalContext().getRequestParameterMap()
+ .get("ln");
+ resource = createResource(resourceName, libraryName);
+ }
+
+ if (resource != null) {
+ if (resource.userAgentNeedsUpdate(context)) {
+ ReadableByteChannel resourceChannel = null;
+ WritableByteChannel out = null;
+ ByteBuffer buf = allocateByteBuffer();
+ try {
+ InputStream in = resource.getInputStream();
+ if (in == null) {
+ send404(context, resourceName, libraryName, true);
+ return;
+ }
+ resourceChannel =
+ Channels.newChannel(resource.getInputStream());
+ out = Channels.newChannel(extContext.getResponseOutputStream());
+ extContext.setResponseBufferSize(buf.capacity());
+ String contentType = resource.getContentType();
+ if (contentType != null) {
+ extContext.setResponseContentType(resource.getContentType());
+ }
+ handleHeaders(context, resource);
+
+ int size = 0;
+ for (int thisRead = resourceChannel.read(buf), totalWritten = 0;
+ thisRead != -1;
+ thisRead = resourceChannel.read(buf)) {
+
+ buf.rewind();
+ buf.limit(thisRead);
+ do {
+ totalWritten += out.write(buf);
+ } while (totalWritten < size);
+ buf.clear();
+ size += thisRead;
+
+ }
+
+ extContext.setResponseContentLength(size);
+
+ } catch (IOException ioe) {
+ send404(context, resourceName, libraryName, ioe, true);
+ } finally {
+ if (out != null) {
+ out.close();
+ }
+ if (resourceChannel != null) {
+ resourceChannel.close();
+ }
+ }
+ } else {
+ send304(context);
+ }
+
+ } else {
+ // already logged elsewhere
+ send404(context, resourceName, libraryName, false);
+ }
+
+ }
+
+
+ private void send404(FacesContext ctx,
+ String resourceName,
+ String libraryName,
+ boolean logMessage) {
+
+ send404(ctx, resourceName, libraryName, null, logMessage);
+
+ }
+
+
+ private void send404(FacesContext ctx,
+ String resourceName,
+ String libraryName,
+ Throwable t,
+ boolean logMessage) {
+
+ ctx.getExternalContext().setResponseStatus(HttpServletResponse.SC_NOT_FOUND);
+ if (logMessage) {
+ logMissingResource(ctx, resourceName, libraryName, t);
+ }
+
+
+ }
+
+
+ private void send304(FacesContext ctx) {
+
+ ctx.getExternalContext().setResponseStatus(HttpServletResponse.SC_NOT_MODIFIED);
+
+ }
+
+
+
+ // ------------------------------------------------- Package Private Methods
+
+
+ /**
+ * This method is leveraged by {@link ResourceImpl} to detemine if a resource
+ * has been upated. In short, a resource has been updated if the timestamp
+ * is newer than the timestamp of the ResourceHandler creation time.
+ * @return the time when the ResourceHandler was instantiated (in milliseconds)
+ */
+ long getCreationTime() {
+
+ return creationTime;
+
+ }
+
+
+ /**
+ * This method is here soley for the purpose of unit testing and will
+ * not be invoked during normal runtime.
+ * @param creationTime the time in milliseconds
+ */
+ void setCreationTime(long creationTime) {
+
+ this.creationTime = creationTime;
+
+ }
+
+
+ /**
+ * Utility method leveraged by ResourceImpl to reduce the cost of
+ * looking up the WebConfiguration per-instance.
+ * @return the {@link WebConfiguration} for this application
+ */
+ WebConfiguration getWebConfig() {
+
+ return webconfig;
+
+ }
+
+
+ // --------------------------------------------------------- Private Methods
+
+
+ /**
+ * Log a message indicating a particular resource (reference by name and/or
+ * library) could not be found. If this was due to an exception, the exception
+ * provided will be logged as well.
+ *
+ * @param ctx the {@link FacesContext} for the current request
+ * @param resourceName the resource name
+ * @param libraryName the resource library
+ * @param t the exception caught when attempting to find the resource
+ */
+ private void logMissingResource(FacesContext ctx,
+ String resourceName,
+ String libraryName,
+ Throwable t) {
+
+ Level level;
+ if (!ctx.isProjectStage(ProjectStage.Production)) {
+ level = Level.WARNING;
+ } else {
+ level = ((t != null) ? Level.WARNING : Level.FINE);
+ }
+
+ if (libraryName != null) {
+ if (LOGGER.isLoggable(level)) {
+ LOGGER.log(level,
+ "jsf.application.resource.unable_to_serve_from_library",
+ new Object[]{resourceName, libraryName});
+ if (t != null) {
+ LOGGER.log(level, "", t);
+ }
+ }
+ } else {
+ if (LOGGER.isLoggable(level)) {
+ LOGGER.log(level,
+ "jsf.application.resource.unable_to_serve",
+ new Object[]{resourceName});
+ if (t != null) {
+ LOGGER.log(level, "", t);
+ }
+ }
+ }
+
+ }
+
+
+ /**
+ * @param resourceName the resource of interest. The resourceName in question
+ * may consist of zero or more path elements such that resourceName could
+ * be something like path1/path2/resource.jpg or resource.jpg
+ * @return the content type for this resource
+ */
+ private String getContentType(FacesContext ctx, String resourceName) {
+
+ return ctx.getExternalContext().getMimeType(resourceName);
+
+ }
+
+
+ /**
+ * Normalize the request path to exclude JSF invocation information.
+ * If the FacesServlet servicing this request was prefix mapped, then
+ * the path to the FacesServlet will be removed.
+ * If the FacesServlet servicing this request was extension mapped, then
+ * the extension will be trimmed off.
+ * @param context the <code>FacesContext</code> for the current request
+ * @return the request path without JSF invocation information
+ */
+ private String normalizeResourceRequest(FacesContext context) {
+
+ String path;
+ String facesServletMapping = Util.getFacesMapping(context);
+ // If it is extension mapped
+ if (!Util.isPrefixMapped(facesServletMapping)) {
+ path = context.getExternalContext().getRequestServletPath();
+ // strip off the extension
+ int i = path.lastIndexOf(".");
+ if (0 < i) {
+ path = path.substring(0, i);
+ }
+ } else {
+ path = context.getExternalContext().getRequestPathInfo();
+ }
+ return path;
+
+ }
+
+
+ /**
+ * @param resourceId the normalized request path as returned by
+ * {@link #normalizeResourceRequest(javax.faces.context.FacesContext)}
+ * @return <code>true</code> if the request matces an excluded resource,
+ * otherwise <code>false</code>
+ */
+ private boolean isExcluded(String resourceId) {
+ for (Pattern pattern : excludePatterns) {
+ if (pattern.matcher(resourceId).matches()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ /**
+ * Initialize the exclusions for this application.
+ * If no explicit exclusions are configured, the defaults of
+ * <ul>
+ * <li>.class</li>
+ * <li>.properties</li>
+ * <li>.xhtml</li>
+ * <li>.jsp</li>
+ * <li>.jspx</li>
+ * <ul>
+ * will be used.
+ */
+ private void initExclusions() {
+
+ String excludesParam = webconfig
+ .getOptionValue(ResourceExcludes);
+ String[] patterns = Util.split(excludesParam, " ");
+ excludePatterns = new ArrayList<Pattern>(patterns.length);
+ for (String pattern : patterns) {
+ excludePatterns.add(Pattern.compile(".*\\" + pattern));
+ }
+
+ }
+
+ private void initMaxAge() {
+
+ maxAge = Long.parseLong(webconfig.getOptionValue(DefaultResourceMaxAge));
+
+ }
+
+
+ private void handleHeaders(FacesContext ctx,
+ Resource resource) {
+
+ ExternalContext extContext = ctx.getExternalContext();
+ for (Map.Entry<String, String> cur :
+ resource.getResponseHeaders().entrySet()) {
+ extContext.setResponseHeader(cur.getKey(), cur.getValue());
+ }
+
+ }
+
+ private ByteBuffer allocateByteBuffer() {
+
+ int size;
+ try {
+ size = Integer.parseInt(webconfig.getOptionValue(ResourceBufferSize));
+ } catch (NumberFormatException nfe) {
+ if (LOGGER.isLoggable(Level.WARNING)) {
+ LOGGER.log(Level.WARNING,
+ "jsf.application.resource.invalid_resource_buffer_size",
+ new Object[] {
+ webconfig.getOptionValue(ResourceBufferSize),
+ ResourceBufferSize.getQualifiedName(),
+ ResourceBufferSize.getDefaultValue()
+ });
+ }
+ size = Integer.parseInt(ResourceBufferSize.getDefaultValue());
+ }
+ return ByteBuffer.allocate(size);
+
+ }
+}
+
Added: branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/URLBuilder.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/URLBuilder.java (rev 0)
+++ branches/sandbox/3.3.X_JSF2/framework/test/src/main/java/org/ajax4jsf/tests/URLBuilder.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -0,0 +1,323 @@
+package org.ajax4jsf.tests;
+
+import com.sun.faces.el.ELUtils;
+import com.sun.faces.util.Util;
+
+import javax.faces.context.FacesContext;
+import javax.faces.application.Application;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>The <strong>UrlBuilder</strong> provides a convenient way to assemble a URL. It
+ * follows the standard Builder Pattern. A seed URL is provided, which is broken
+ * into parts to allow for dynamic assembly. When the URL is to be build, a call
+ * to createUrl() assembles the parts into a relative URL. This class should
+ * be extended if the developer wishes to have it deal with absolute URLs.</p>
+ *
+ * <p>Note that this class is optimized to parse the query string lazily so as
+ * to avoid unnecessary work if the seed URL differs little from the URL to be
+ * built.</p>
+ */
+class UrlBuilder {
+ public static final String QUERY_STRING_SEPARATOR = "?";
+ public static final String PARAMETER_PAIR_SEPARATOR = "&";
+ public static final String PARAMETER_NAME_VALUE_SEPARATOR = "=";
+ public static final String FRAGMENT_SEPARATOR = "#";
+ public static final String DEFAULT_ENCODING = "UTF-8";
+
+ private static final List<String> NULL_LIST = Arrays.asList((String) null);
+
+ private StringBuilder url;
+ private String path;
+ private String queryString;
+ private String fragment;
+ private Map<String, List<String>> parameters;
+ private String encoding;
+ private FacesContext ctx;
+ private Application app;
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ public UrlBuilder(String url, String encoding) {
+ if (url == null || url.trim().length() == 0) {
+ throw new IllegalArgumentException("Url cannot be empty");
+ }
+ this.url = new StringBuilder(url.length() * 2);
+ extractSegments(url);
+ this.encoding = encoding;
+ // PERF TL lookup per-instance
+ ctx = FacesContext.getCurrentInstance();
+ app = ctx.getApplication();
+ }
+
+
+ public UrlBuilder(String url) {
+ this(url, DEFAULT_ENCODING);
+ }
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ public UrlBuilder addParameters(String name, List<String> values) {
+ if (name == null || name.trim().length() == 0) {
+ throw new IllegalArgumentException("Parameter name cannot be empty");
+ }
+ parseQueryString();
+ addValuesToParameter(name.trim(), values, true);
+
+ return this;
+ }
+
+
+ public UrlBuilder addParameters(Map<String, List<String>> params) {
+ if (params != null && !params.isEmpty()) {
+ parseQueryString();
+ for (Map.Entry<String, List<String>> entry : params.entrySet()) {
+ if (entry.getKey() == null || entry.getKey().trim().length() == 0) {
+ throw new IllegalArgumentException("Parameter name cannot be empty");
+ }
+ List<String> values = entry.getValue();
+ evaluateExpressions(values);
+ addValuesToParameter(entry.getKey().trim(), values, true);
+ }
+ }
+
+ return this;
+ }
+
+
+ public UrlBuilder setPath(String path) {
+ if (path == null || path.trim().length() == 0) {
+ throw new IllegalArgumentException("Path cannot be empty");
+ }
+ this.path = path;
+ return this;
+ }
+
+
+ /**
+ * Setting a query string consecutively will replace all but the last one. Otherwise,
+ * the name/value pairs in the query string contribute to the parameters already established.
+ */
+ public UrlBuilder setQueryString(String queryString) {
+ this.queryString = queryString;
+ cleanQueryString();
+ return this;
+ }
+
+
+ /**
+ * The fragment is appended at the end of the url after a hash mark. It represents
+ * the fragement of the document that should be brought into focus when the document
+ * is rendered. Setting the fragment replaces the previous value.
+ */
+ public UrlBuilder setFragment(String fragment) {
+ this.fragment = fragment;
+ cleanFragment();
+ return this;
+ }
+
+
+ public String createUrl() {
+ appendPath();
+ appendQueryString();
+ appendFragment();
+ return url.toString();
+ }
+
+
+ // ------------------------------------------------------- Protected Methods
+
+
+ protected String getPath() {
+ return path;
+ }
+
+
+ protected Map<String, List<String>> getParameters() {
+ parseQueryString();
+ return parameters;
+ }
+
+
+ protected void parseQueryString() {
+ if (parameters == null) {
+ parameters = new LinkedHashMap<String, List<String>>();
+ }
+
+ // if query string is null, then it has been parsed into parameters
+ if (queryString == null) {
+ return;
+ }
+
+ String[] pairs = Util.split(queryString, PARAMETER_PAIR_SEPARATOR);
+ for (String pair : pairs) {
+ String[] nameAndValue = Util.split(pair, PARAMETER_NAME_VALUE_SEPARATOR);
+ // ignore malformed pair
+ if (nameAndValue.length != 2
+ || nameAndValue[0].trim().length() == 0) {
+ continue;
+ }
+
+ addValueToParameter(nameAndValue[0], nameAndValue[1], false);
+ }
+
+ queryString = null;
+ }
+
+
+ protected void appendPath() {
+ url.append(path);
+ }
+
+
+ protected void appendQueryString() {
+ if (parameters != null) {
+ // parse residual query string
+ parseQueryString();
+ String nextSeparatorChar = QUERY_STRING_SEPARATOR;
+ for (Map.Entry<String, List<String>> param : parameters.entrySet()) {
+ for (String value : param.getValue()) {
+ url.append(nextSeparatorChar);
+ url.append(param.getKey());
+ url.append(PARAMETER_NAME_VALUE_SEPARATOR);
+ if (encoding != null) {
+ try {
+ url.append(URLEncoder.encode(value, encoding));
+ } catch (UnsupportedEncodingException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ else {
+ url.append(value);
+ }
+ nextSeparatorChar = PARAMETER_PAIR_SEPARATOR;
+ }
+ }
+ }
+ else if (queryString != null) {
+ url.append(QUERY_STRING_SEPARATOR).append(queryString);
+ }
+ }
+
+
+ protected void appendFragment() {
+ if (fragment != null) {
+ url.append(FRAGMENT_SEPARATOR).append(fragment);
+ }
+ }
+
+
+ protected void extractSegments(String url) {
+ int fragmentIndex = url.indexOf(FRAGMENT_SEPARATOR);
+ if (fragmentIndex != -1) {
+ fragment = url.substring(fragmentIndex + 1);
+ cleanFragment();
+ url = url.substring(0, fragmentIndex);
+ }
+
+ int queryStringIndex = url.indexOf(QUERY_STRING_SEPARATOR);
+ if (queryStringIndex != -1) {
+ queryString = url.substring(queryStringIndex + 1);
+ cleanQueryString();
+ path = url.substring(0, queryStringIndex);
+ }
+ else {
+ path = url;
+ }
+ }
+
+
+ protected void addValueToParameter(String name, String value, boolean replace) {
+ List<String> values = new ArrayList<String>(value == null ? 0 : 1);
+ if (value != null) {
+ values.add(value);
+ }
+ addValuesToParameter(name, values, replace);
+ }
+
+
+ protected void addValuesToParameter(String name, List<String> valuesRef, boolean replace) {
+ List<String> values = new ArrayList<String>();
+ if (valuesRef != null) {
+ values.addAll(valuesRef);
+ values.removeAll(NULL_LIST);
+ }
+
+ if (replace) {
+ parameters.put(name, values);
+ }
+ else {
+ List<String> currentValues = parameters.get(name);
+ if (currentValues == null) {
+ currentValues = new ArrayList<String>(1);
+ parameters.put(name, currentValues);
+ }
+ currentValues.addAll(values);
+ }
+ }
+
+
+ // --------------------------------------------------------- Private Methods
+
+
+ private void evaluateExpressions(List<String> values) {
+ if (!values.isEmpty()) {
+ for (int i = 0, len = values.size(); i < len; i++) {
+ String value = values.get(i);
+ if (value != null) {
+ value = value.trim();
+ if (ELUtils.isExpression(value)) {
+ value = app.evaluateExpressionGet(ctx,
+ value,
+ String.class);
+ }
+ values.set(i, value);
+ }
+ }
+ }
+ }
+
+
+ private void cleanFragment() {
+ if (fragment != null) {
+ String f = fragment;
+ f = f.trim();
+ if (f.startsWith(FRAGMENT_SEPARATOR)) {
+ f = f.substring(1);
+ }
+
+ if (f.length() == 0) {
+ f = null;
+ }
+
+ fragment = f;
+ }
+ }
+
+
+ private void cleanQueryString() {
+ if (queryString != null) {
+ String q = queryString;
+ q = q.trim();
+ if (q.startsWith(QUERY_STRING_SEPARATOR)) {
+ q = q.substring(1);
+ }
+
+ if (q.length() == 0) {
+ q = null;
+ }
+ queryString = q;
+ }
+ }
+
+}
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/framework/test/src/test/resources/WEB-INF/web.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/framework/test/src/test/resources/WEB-INF/web.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/framework/test/src/test/resources/WEB-INF/web.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -10,7 +10,6 @@
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
-
<filter>
<description>Convert HTML to XML</description>
<display-name>Filter</display-name>
Modified: branches/sandbox/3.3.X_JSF2/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -93,8 +93,8 @@
<module>cdk</module>
<module>framework</module>
<module>ui</module>
- <module>extensions</module>
- <module>docs</module>
+ <!--<module>extensions</module>-->
+ <!--<module>docs</module>-->
<module>ui/assembly</module>
<module>samples</module>
<!--
@@ -315,26 +315,6 @@
</reporting>
</profile>
<profile>
- <id>jsf2</id>
- <properties>
- <jsf.api.groupId>com.sun.faces</jsf.api.groupId>
- <jsf.impl.groupId>com.sun.faces</jsf.impl.groupId>
- <jsf.api.version>2.0.1</jsf.api.version>
- <jsf.impl.version>2.0.1</jsf.impl.version>
- </properties>
-
- </profile>
-<profile>
- <id>jsf1.2</id>
- <properties>
- <jsf.api.groupId>javax.faces</jsf.api.groupId>
- <jsf.impl.groupId>javax.faces</jsf.impl.groupId>
- <jsf.api.version>1.2_12</jsf.api.version>
- <jsf.impl.version>1.2_12</jsf.impl.version>
- </properties>
-
- </profile>
- <profile>
<id>beet</id>
<activation>
<property>
Modified: branches/sandbox/3.3.X_JSF2/samples/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/samples/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/samples/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -8,6 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces</groupId>
<artifactId>samples</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RichFaces Components Examples</name>
<url>http://labs.jboss.com/jbossrichfaces/samples</url>
@@ -66,14 +67,9 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>${project.version}</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.14</version>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.0</version>
@@ -180,17 +176,6 @@
<version>2.1</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_12</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_12</version>
- <scope>runtime</scope>
- </dependency>
</dependencies>
</profile>
<profile>
@@ -235,17 +220,6 @@
<version>2.0</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_12</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_12</version>
- <scope>runtime</scope>
- </dependency>
</dependencies>
</profile>
<profile>
@@ -281,17 +255,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_12</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_12</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>1.0</version>
@@ -306,6 +269,39 @@
</dependencies>
</profile>
<profile>
+ <id>jsf2</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0.1</version>
+ <scope>provided</scope>
+ </dependency><dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>2.0.1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+<profile>
+ <id>jsf1.2</id>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_12</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_12</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
<id>jboss42</id>
<build>
<defaultGoal>jetty:run</defaultGoal>
@@ -334,18 +330,6 @@
<version>2.0</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_12</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_12</version>
- <scope>provided</scope>
- </dependency>
</dependencies>
</profile>
<profile>
@@ -371,7 +355,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>${project.version}</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>javax.faces</groupId>
@@ -492,12 +476,12 @@
</profile>
</profiles>
<modules>
- <module>skins</module>
+ <!--<module>skins</module>
<module>laguna</module>
<module>glassX</module>
- <module>darkX</module>
+ <module>darkX</module>-->
<module>richfaces-demo</module>
- <module>themes</module>
- <module>violetRays</module>
+ <!--<module>themes</module>-->
+ <!--<module>violetRays</module>-->
</modules>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -1,14 +1,10 @@
<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/maven-v4_0_0.xsd">
- <parent>
- <artifactId>samples</artifactId>
- <groupId>org.richfaces</groupId>
- <version>3.3.3-SNAPSHOT</version>
- </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.samples</groupId>
<artifactId>richfaces-demo</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
<packaging>war</packaging>
<name>richfaces-demo Maven Webapp</name>
@@ -45,7 +41,7 @@
<artifactItem>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
- <version>${project.version}</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/richfaces</outputDirectory>
@@ -181,21 +177,19 @@
<version>2.0</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_12</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_12</version>
- <scope>runtime</scope>
- </dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>2.0.1</version>
+ </dependency><dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>2.0.1</version>
+ </dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
@@ -207,24 +201,9 @@
<version>1.4.2</version>
</dependency>
<dependency>
- <groupId>org.richfaces.samples</groupId>
- <artifactId>laguna</artifactId>
- <version>3.3.3-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.samples</groupId>
- <artifactId>glassX</artifactId>
- <version>3.3.3-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.samples</groupId>
- <artifactId>darkX</artifactId>
- <version>3.3.3-SNAPSHOT</version>
- </dependency>
- <dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.uwyn</groupId>
@@ -258,12 +237,6 @@
<artifactId>nekohtml</artifactId>
<version>0.9.5</version>
<scope>runtime</scope>
- <exclusions>
- <exclusion>
- <artifactId>xerces</artifactId>
- <groupId>xerces</groupId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -310,18 +283,8 @@
<groupId>javax.servlet</groupId>
</exclusion>
</exclusions>
- </dependency>
+ </dependency>
<dependency>
- <groupId>org.richfaces.samples</groupId>
- <artifactId>themes</artifactId>
- <version>3.3.3-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.samples</groupId>
- <artifactId>violetRays</artifactId>
- <version>3.3.3-SNAPSHOT</version>
- </dependency>
- <dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
Modified: branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -60,7 +60,12 @@
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>DEFAULT</param-value>
</context-param>
+ <context-param>
+ <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
<listener>
<listener-class>
org.jboss.seam.servlet.SeamListener
Modified: branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml
===================================================================
--- branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -15,7 +15,7 @@
<rich:tab label="Extended Data Model" name="dataModel">
<ui:include src="/richfaces/dataTable/extended-data-model.xhtml"/>
</rich:tab>
- <rich:tab label="Modifiable Data Model" name="modifiableDataModel">
+ <rich:tab actionListener="#{conversation.start()}" label="Modifiable Data Model" name="modifiableDataModel">
<ui:include src="/richfaces/dataTable/modifiableModel.xhtml"/>
</rich:tab>
<rich:tab label="Edit Table with ModalPanel" name="editDataTable">
Modified: branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/templates/include/components-group.xhtml
===================================================================
--- branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/templates/include/components-group.xhtml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/templates/include/components-group.xhtml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -7,16 +7,16 @@
<ui:composition>
<table border="0" cellpadding="0" cellspacing="1">
<tbody>
- <a4j:repeat var="component" value="#{components}">
- <tr class="#{component.current?'active':'unactive'}" onmouseover="this.className='active'" onmouseout="this.className='#{component.current?'active':'unactive'}'">
- <td class="ico"><div style="width: 16px;height: 16px;"><h:graphicImage value="#{component.iconImage}" width="16" height="16" alt="" border="0" /><h:graphicImage value="/images/icons/ico_new_item.gif" rendered="#{component.newComponent}" style="position:relative; top:-6px; left:10px;" alt="" width="10" height="10"/></div></td>
- <td class="text #{component.newComponent?'bold':''}" width="100%">
- <h:outputLink style="display:block;height:20px" value="#{component.contextRelativeDemoLocation}">
+ <a4j:repeat var="component2" value="#{components}">
+ <tr class="#{component2.current?'active':'unactive'}" onmouseover="this.className='active'" onmouseout="this.className='#{component2.current?'active':'unactive'}'">
+ <td class="ico"><div style="width: 16px;height: 16px;"><h:graphicImage value="#{component2.iconImage}" width="16" height="16" alt="" border="0" /><h:graphicImage value="/images/icons/ico_new_item.gif" rendered="#{component2.newComponent}" style="position:relative; top:-6px; left:10px;" alt="" width="10" height="10"/></div></td>
+ <td class="text #{component2.newComponent?'bold':''}" width="100%">
+ <h:outputLink style="display:block;height:20px" value="#{component2.contextRelativeDemoLocation}">
<span style="display:block;padding-top:3px;text-decoration : none; color : #000000;">
- #{component.name}
+ #{component2.name}
</span>
- <f:param value="#{component.id}" name="c"/>
- <f:param value="#{component.activeTab}" name="tab"/>
+ <f:param value="#{component2.id}" name="c"/>
+ <f:param value="#{component2.activeTab}" name="tab"/>
</h:outputLink>
</td>
</tr>
Modified: branches/sandbox/3.3.X_JSF2/ui/assembly/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/assembly/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/assembly/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -7,6 +7,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
<name>RichFaces JSF components library</name>
<packaging>jar</packaging>
@@ -105,7 +106,7 @@
<plugin>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-javascript-plugin</artifactId>
- <version>${project.version}</version>
+ <version>3.3.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
Modified: branches/sandbox/3.3.X_JSF2/ui/beanValidator/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/beanValidator/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/beanValidator/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -46,7 +46,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputSecret.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputSecret.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputSecret.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -76,7 +76,7 @@
}
}
- private static boolean isEmpty(Object value) {
+ public static boolean isEmpty(Object value) {
if (value == null) {
return true;
Modified: branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputText.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputText.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputText.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -77,7 +77,7 @@
}
- private static boolean isEmpty(Object value) {
+ public static boolean isEmpty(Object value) {
if (value == null) {
return true;
Modified: branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputTextarea.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputTextarea.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputTextarea.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -77,7 +77,7 @@
}
- private static boolean isEmpty(Object value) {
+ public static boolean isEmpty(Object value) {
if (value == null) {
return (true);
Modified: branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/test/java/org/richfaces/component/BeanValidatorComponentTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/test/java/org/richfaces/component/BeanValidatorComponentTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/test/java/org/richfaces/component/BeanValidatorComponentTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -63,6 +63,7 @@
form.setId("form");
facesContext.getViewRoot().getChildren().add(form);
input = (HtmlInputText)application.createComponent(HtmlInputText.COMPONENT_TYPE);
+ input.getAttributes().put("onchange", "return true;");
validator = (UIAjaxValidator)application.createComponent(UIAjaxValidator.COMPONENT_TYPE);
validator.setId("validator");
Modified: branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/test/java/org/richfaces/component/GraphValidatorComponentTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/test/java/org/richfaces/component/GraphValidatorComponentTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/beanValidator/src/test/java/org/richfaces/component/GraphValidatorComponentTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -51,6 +51,7 @@
validator.setId("validator");
input = (UIInput) application.createComponent(UIInput.COMPONENT_TYPE);
input.setId("input");
+ input.getAttributes().put("onchange", "return true;");
validator.getChildren().add(input);
form.getChildren().add(validator);
messages = (UIMessages) application
Modified: branches/sandbox/3.3.X_JSF2/ui/calendar/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/calendar/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/calendar/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -45,7 +45,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
Modified: branches/sandbox/3.3.X_JSF2/ui/colorPicker/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/colorPicker/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/colorPicker/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -49,7 +49,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>${project.version}</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Modified: branches/sandbox/3.3.X_JSF2/ui/columns/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/columns/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/columns/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -43,7 +43,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>${project.version}</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/columns/src/main/config/component/columns.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/columns/src/main/config/component/columns.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/columns/src/main/config/component/columns.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -17,7 +17,6 @@
<classname>
org.richfaces.taglib.ColumnsTag
</classname>
- <test/>
</tag>
<taghandler generate="false">
<classname>org.richfaces.taglib.ColumnsHandler</classname>
Modified: branches/sandbox/3.3.X_JSF2/ui/columns/src/test/java/org/richfaces/jsp/tag/ColumnsJspTagTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/columns/src/test/java/org/richfaces/jsp/tag/ColumnsJspTagTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/columns/src/test/java/org/richfaces/jsp/tag/ColumnsJspTagTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -35,6 +35,7 @@
import javax.faces.component.UIComponent;
import javax.faces.webapp.UIComponentClassicTagBase;
+import org.ajax4jsf.tests.AbstractJspTestCase;
import org.ajax4jsf.tests.MockPageContext;
import org.ajax4jsf.tests.MockValueExpression;
import org.apache.shale.test.base.AbstractJsfTestCase;
@@ -48,7 +49,7 @@
* @author Andrey Markavtsov
*
*/
-public class ColumnsJspTagTest extends AbstractJsfTestCase {
+public class ColumnsJspTagTest extends AbstractJspTestCase {
/** Jsp tag to be tested */
private ColumnsTag tag;
@@ -159,13 +160,14 @@
* @see junit.framework.TestCase#setUp()
*/
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
-
+
facesContext.getApplication().addComponent("org.richfaces.Column",
"org.richfaces.component.html.HtmlColumn");
tag = new ColumnsTag();
+ tag.setPageContext(pageContext);
initTag();
initParentTag();
@@ -177,7 +179,7 @@
* @see junit.framework.TestCase#tearDown()
*/
@Override
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
// TODO Auto-generated method stub
super.tearDown();
this.tag = null;
Modified: branches/sandbox/3.3.X_JSF2/ui/combobox/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/combobox/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/combobox/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -51,7 +51,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/componentControl/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/componentControl/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/componentControl/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -50,7 +50,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/componentControl/src/test/java/org/richfaces/component/ComponentControlTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/componentControl/src/test/java/org/richfaces/component/ComponentControlTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/componentControl/src/test/java/org/richfaces/component/ComponentControlTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -68,6 +68,7 @@
input = new UIInput();
input.setId("input");
input.setValue("value");
+ input.getAttributes().put("onchange", "return true;");
form.getChildren().add(input);
componentControl = (UIComponentControl) application.createComponent(UIComponentControl.COMPONENT_TYPE);
Modified: branches/sandbox/3.3.X_JSF2/ui/contextMenu/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/contextMenu/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/contextMenu/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -51,7 +51,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/core/src/main/config/component/actionParameter.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/core/src/main/config/component/actionParameter.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/core/src/main/config/component/actionParameter.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -34,7 +34,7 @@
<superclass>
org.ajax4jsf.taglib.html.jsp.ActionParamTag
</superclass>
- <test/>
+
<description>
<![CDATA[
A combination of the functionality of two JSF tags,
@@ -52,6 +52,7 @@
<br />
]]>
</description>
+ <test/>
</tag>
<taghandler generate="false">
<classname>org.ajax4jsf.taglib.html.facelets.ActionParamHandler</classname>
Modified: branches/sandbox/3.3.X_JSF2/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/core/src/test/java/org/ajax4jsf/component/QueueRendererTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -66,7 +66,9 @@
form = (UIForm) application.createComponent(UIForm.COMPONENT_TYPE);
form.setId("theform");
- form.getChildren().add(application.createComponent(UIInput.COMPONENT_TYPE));
+ UIComponent createComponent = application.createComponent(UIInput.COMPONENT_TYPE);
+ createComponent.getAttributes().put("onchange", "return true;");
+ form.getChildren().add(createComponent);
children.add(form);
}
Modified: branches/sandbox/3.3.X_JSF2/ui/core/src/test/java/org/ajax4jsf/component/UIAjaxFormTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/core/src/test/java/org/ajax4jsf/component/UIAjaxFormTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/core/src/test/java/org/ajax4jsf/component/UIAjaxFormTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -63,6 +63,7 @@
}
};
child.setId("input");
+ child.getAttributes().put("onchange", "return true;");
child.addValidator(new TestAjaxFormValidator());
childInvoked = 0;
child.setId("child");
Added: branches/sandbox/3.3.X_JSF2/ui/core/src/test/java/org/ajax4jsf/component/URLBuilder.java
===================================================================
Modified: branches/sandbox/3.3.X_JSF2/ui/core/src/test/resources/org/ajax4jsf/component/queue-ajax-form.xhtml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/core/src/test/resources/org/ajax4jsf/component/queue-ajax-form.xhtml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/core/src/test/resources/org/ajax4jsf/component/queue-ajax-form.xhtml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -17,25 +17,25 @@
<a4j:queue oncomplete="window.testResults.viewDefault = true"/>
<a4j:form ajaxSubmit="true" id="viewDefault">
- <h:commandButton value="view default queue" id="link" />
+ <h:commandButton onclick="return true;" value="view default queue" id="link" />
</a4j:form>
<a4j:queue oncomplete="window.testResults.viewNamed = true" name="viewNamed" />
<a4j:form ajaxSubmit="true" eventsQueue="viewNamed" id="viewNamed">
- <h:commandButton value="view named queue" id="link" />
+ <h:commandButton onclick="return true;" value="view named queue" id="link" />
</a4j:form>
<a4j:form ajaxSubmit="true" id="formDefault">
<a4j:queue oncomplete="window.testResults.formDefault = true" />
- <h:commandButton value="form default queue" id="link" />
+ <h:commandButton onclick="return true;" value="form default queue" id="link" />
</a4j:form>
<a4j:form ajaxSubmit="true" eventsQueue="formQueue" id="formNamed">
<a4j:queue oncomplete="window.testResults.formNamed = true" name="formQueue" />
- <h:commandButton value="form named queue" id="link" />
+ <h:commandButton onclick="return true;" value="form named queue" id="link" />
</a4j:form>
</f:view>
</body>
Modified: branches/sandbox/3.3.X_JSF2/ui/dataFilterSlider/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/dataFilterSlider/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/dataFilterSlider/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -45,7 +45,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/datascroller/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/datascroller/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/datascroller/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/dropdown-menu/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/dropdown-menu/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/dropdown-menu/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/editor/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/editor/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/editor/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -62,7 +62,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/extendedDataTable/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/extendedDataTable/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/extendedDataTable/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -64,7 +64,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/fileUpload/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/fileUpload/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/fileUpload/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -51,7 +51,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/functions/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/functions/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/functions/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -37,7 +37,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>${project.version}</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/hotKey/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/hotKey/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/hotKey/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -50,7 +50,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/hotKey/src/test/java/org/richfaces/component/HotKeyComponentTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/hotKey/src/test/java/org/richfaces/component/HotKeyComponentTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/hotKey/src/test/java/org/richfaces/component/HotKeyComponentTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -153,12 +153,12 @@
UIComponent input = application.createComponent(UIInput.COMPONENT_TYPE);
input.setId("i1");
-
+ input.getAttributes().put("onchange", "return true;");
facesContext.getViewRoot().getChildren().add(input);
input = application.createComponent(UIInput.COMPONENT_TYPE);
input.setId("i2");
-
+ input.getAttributes().put("onchange", "return true;");
this.hotKey.getParent().getChildren().add(input);
String scriptBody = processScriptBody();
Modified: branches/sandbox/3.3.X_JSF2/ui/inplaceInput/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/inplaceInput/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/inplaceInput/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -51,7 +51,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/inplaceSelect/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/inplaceSelect/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/inplaceSelect/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -51,12 +51,12 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-api</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/layout/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/layout/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/layout/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -48,7 +48,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Modified: branches/sandbox/3.3.X_JSF2/ui/menu-components/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/menu-components/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/menu-components/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/message/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/message/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/message/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -45,7 +45,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/message/src/test/java/org/richfaces/renderer/RichMessageRendererTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/message/src/test/java/org/richfaces/renderer/RichMessageRendererTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/message/src/test/java/org/richfaces/renderer/RichMessageRendererTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -77,24 +77,28 @@
input1 = (HtmlInputText)application.createComponent("javax.faces.HtmlInputText");
input1.setId("input1");
+ input1.getAttributes().put("onchange", "return true;");
text1 = (HtmlOutputText)application.createComponent("javax.faces.HtmlOutputText");
text1.setValue("Error");
input2 = (HtmlInputText)application.createComponent("javax.faces.HtmlInputText");
input2.setId("input2");
+ input2.getAttributes().put("onchange", "return true;");
text2 = (HtmlOutputText)application.createComponent("javax.faces.HtmlOutputText");
text2.setValue("Warning");
input3 = (HtmlInputText)application.createComponent("javax.faces.HtmlInputText");
input3.setId("input3");
+ input3.getAttributes().put("onchange", "return true;");
text3 = (HtmlOutputText)application.createComponent("javax.faces.HtmlOutputText");
text3.setValue("Fatal");
input4 = (HtmlInputText)application.createComponent("javax.faces.HtmlInputText");
input4.setId("input4");
+ input4.getAttributes().put("onchange", "return true;");
text4 = (HtmlOutputText)application.createComponent("javax.faces.HtmlOutputText");
text4.setValue("Info");
Modified: branches/sandbox/3.3.X_JSF2/ui/message/src/test/java/org/richfaces/renderer/RichMessagesRendererTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/message/src/test/java/org/richfaces/renderer/RichMessagesRendererTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/message/src/test/java/org/richfaces/renderer/RichMessagesRendererTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -64,6 +64,7 @@
input1 = (HtmlInputText)application.createComponent("javax.faces.HtmlInputText");
input1.setId("input1");
+ input1.getAttributes().put("onchange", "return true;");
output1 = (HtmlOutputText)application.createComponent("javax.faces.HtmlOutputText");
output1.setId("output1");
@@ -71,6 +72,7 @@
input2 = (HtmlInputText)application.createComponent("javax.faces.HtmlInputText");
input2.setId("input2");
+ input2.getAttributes().put("onchange", "return true;");
output2 = (HtmlOutputText)application.createComponent("javax.faces.HtmlOutputText");
output2.setId("output2");
@@ -78,6 +80,7 @@
input3 = (HtmlInputText)application.createComponent("javax.faces.HtmlInputText");
input3.setId("input3");
+ input3.getAttributes().put("onchange", "return true;");
output3 = (HtmlOutputText)application.createComponent("javax.faces.HtmlOutputText");
output3.setId("output3");
@@ -85,6 +88,7 @@
input4 = (HtmlInputText)application.createComponent("javax.faces.HtmlInputText");
input4.setId("input4");
+ input4.getAttributes().put("onchange", "return true;");
output4 = (HtmlOutputText)application.createComponent("javax.faces.HtmlOutputText");
output4.setId("output4");
Modified: branches/sandbox/3.3.X_JSF2/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -530,7 +530,14 @@
data.trimToSize();
return data;
}
-
+
+ public void resetValue() {
+ this.setValue(null);
+ this.setSubmittedValue(null);
+ this.setLocalValueSet(false);
+ this.setValid(true);
+ }
+
public abstract ItemState getItemState();
public interface ItemState {
Modified: branches/sandbox/3.3.X_JSF2/ui/panel/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/panel/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/panel/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -45,7 +45,8 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT
+ </version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/panelmenu/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/panelmenu/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/panelmenu/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/pickList/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/pickList/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/pickList/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -53,13 +53,13 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-api</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
Modified: branches/sandbox/3.3.X_JSF2/ui/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -82,12 +82,6 @@
</profile>
<profile>
<id>jsf2</id>
- <properties>
- <jsf.api.groupId>com.sun.faces</jsf.api.groupId>
- <jsf.impl.groupId>com.sun.faces</jsf.impl.groupId>
- <jsf.api.version>2.0.1</jsf.api.version>
- <jsf.impl.version>2.0.1</jsf.impl.version>
- </properties>
<dependencies>
<dependency>
<groupId>com.sun.faces</groupId>
@@ -104,12 +98,6 @@
</profile>
<profile>
<id>jsf1.2</id>
- <properties>
- <jsf.api.groupId>javax.faces</jsf.api.groupId>
- <jsf.impl.groupId>javax.faces</jsf.impl.groupId>
- <jsf.api.version>1.2_12</jsf.api.version>
- <jsf.impl.version>1.2_12</jsf.impl.version>
- </properties>
<dependencies>
<dependency>
<groupId>javax.faces</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/progressBAR/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/progressBAR/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/progressBAR/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -45,7 +45,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/scrollableDataTable/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/scrollableDataTable/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/scrollableDataTable/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -70,7 +70,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
Modified: branches/sandbox/3.3.X_JSF2/ui/simpleTogglePanel/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/simpleTogglePanel/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/simpleTogglePanel/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -126,6 +126,7 @@
input = (UIInput)application.createComponent(UIInput.COMPONENT_TYPE);
input.setValue("");
input.setId("opened");
+ input.getAttributes().put("onchange", "return true;");
stp1.getChildren().add(input);
command = new HtmlCommandLink();
Modified: branches/sandbox/3.3.X_JSF2/ui/spacer/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/spacer/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/spacer/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/state/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/state/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/state/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -37,7 +37,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -254,7 +254,7 @@
* @return
* @see javax.faces.application.Application#getConverterTypes()
*/
- public Iterator<Class> getConverterTypes() {
+ public Iterator<Class<?>> getConverterTypes() {
return parent.getConverterTypes();
}
Modified: branches/sandbox/3.3.X_JSF2/ui/suggestionbox/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/suggestionbox/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/suggestionbox/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -89,6 +89,7 @@
input = new UIInput();
input.setId("text");
+ input.getAttributes().put("onchange", "return true;");
form.getChildren().add(input);
sb = (UISuggestionBox)application.createComponent("org.richfaces.SuggestionBox");
Modified: branches/sandbox/3.3.X_JSF2/ui/tabPanel/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/tabPanel/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/tabPanel/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/togglePanel/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/togglePanel/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/togglePanel/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/toolBar/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/toolBar/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/toolBar/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/toolBar/src/test/java/org/richfaces/component/ToolBarComponentTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -75,19 +75,23 @@
UICommand button = (UICommand) application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
button.setValue("Change");
+ button.getAttributes().put("onclick", "return true;");
toolBar.getChildren().add(button);
button = (UICommand) application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
button.setValue("Change");
+ button.getAttributes().put("onclick", "return true;");
toolBar.getChildren().add(button);
UIToolBarGroup toolBarGroup = (UIToolBarGroup) application.createComponent("org.richfaces.ToolBarGroup");
toolBarGroup.setItemSeparator("disc");
button = (HtmlCommandButton) application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
button.setValue("Change");
+ button.getAttributes().put("onclick", "return true;");
toolBarGroup.getChildren().add(button);
button = (HtmlCommandButton) application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
button.setValue("Change");
+ button.getAttributes().put("onclick", "return true;");
toolBarGroup.getChildren().add(button);
toolBar.getChildren().add(toolBarGroup);
@@ -95,9 +99,11 @@
toolBarGroup.setItemSeparator("grid");
button = (HtmlCommandButton) application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
button.setValue("Change");
+ button.getAttributes().put("onclick", "return true;");
toolBarGroup.getChildren().add(button);
button = (HtmlCommandButton) application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
button.setValue("Change");
+ button.getAttributes().put("onclick", "return true;");
toolBarGroup.getChildren().add(button);
toolBar.getChildren().add(toolBarGroup);
@@ -105,9 +111,11 @@
toolBarGroup.setItemSeparator("line");
button = (HtmlCommandButton) application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
button.setValue("Change");
+ button.getAttributes().put("onclick", "return true;");
toolBarGroup.getChildren().add(button);
button = (HtmlCommandButton) application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
button.setValue("Change");
+ button.getAttributes().put("onclick", "return true;");
toolBarGroup.getChildren().add(button);
toolBar.getChildren().add(toolBarGroup);
}
Modified: branches/sandbox/3.3.X_JSF2/ui/tooltip/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/tooltip/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/tooltip/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2009-11-13 13:21:50 UTC (rev 15876)
@@ -133,7 +133,7 @@
}
};
input.setId("input");
-
+ input.getAttributes().put("onchange", "return true;");
form.getChildren().add(input);
command = new HtmlCommandLink();
Modified: branches/sandbox/3.3.X_JSF2/ui/treeModel/pom.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/treeModel/pom.xml 2009-11-12 18:13:33 UTC (rev 15875)
+++ branches/sandbox/3.3.X_JSF2/ui/treeModel/pom.xml 2009-11-13 13:21:50 UTC (rev 15876)
@@ -45,7 +45,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3-SNAPSHOT</version>
+ <version>3.3.3-jsf2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
15 years, 1 month
JBoss Rich Faces SVN: r15875 - root/examples-sandbox/trunk/components/tables/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-11-12 13:13:33 -0500 (Thu, 12 Nov 2009)
New Revision: 15875
Added:
root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml
Log:
RF-7852 ExtendedDataTable sample
Added: root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml (rev 0)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/extendedtable.xhtml 2009-11-12 18:13:33 UTC (rev 15875)
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+<!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:rich="http://richfaces.org/rich">
+ <f:view contentType="text/html"/>
+
+ <h:head>
+ <title>Richfaces ExtendedDataTable</title>
+ </h:head>
+
+ <h:body>
+ <h:form id="form1">
+ <rich:extendedDataTable />
+ </h:form>
+ </h:body>
+</html>
15 years, 1 month