JBoss Rich Faces SVN: r11503 - in trunk/test-applications/seleniumTest/richfaces: src/test/testng/win and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 06:41:26 -0500 (Wed, 03 Dec 2008)
New Revision: 11503
Modified:
trunk/test-applications/seleniumTest/richfaces/pom.xml
trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-03 11:29:01 UTC (rev 11502)
+++ trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-03 11:41:26 UTC (rev 11503)
@@ -56,9 +56,12 @@
</suiteXmlFile>
<suiteXmlFile>
${project.build.directory}/test-classes/testng/testng_default_default_none.xml
+ </suiteXmlFile>
+ <suiteXmlFile>
+ ${project.build.directory}/test-classes/testng/testng_default_default_neko.xml
</suiteXmlFile-->
<suiteXmlFile>
- ${project.build.directory}/test-classes/testng/testng_default_default_neko.xml
+ ${project.build.directory}/test-classes/testng/local_testng.xml
</suiteXmlFile>
</suiteXmlFiles>
<properties>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml 2008-12-03 11:29:01 UTC (rev 11502)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml 2008-12-03 11:41:26 UTC (rev 11503)
@@ -1,13 +1,16 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="seleniumTestDDNe">
- <parameter name="templates" value="SIMPLE,DATA_TABLE,MODAL_PANEL" />
- <test name="FireFoxFunctionalTestsDDNe">
- <parameter name="browser" value="*firefox" />
- <parameter name="loadStyleStrategy" value="DEFAULT" />
- <parameter name="loadScriptStrategy" value="DEFAULT" />
- <parameter name="filterPrefix" value="/faces/NEKO/" />
- <classes>
- <class name="org.richfaces.testng.InplaceInputTest" />
- </classes>
- </test>
+<suite name="seleniumTestDDNo">
+ <test name="IEFunctionalTests">
+ <parameter name="browser" value="*firefox"/>
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+ <classes>
+ <class name="org.richfaces.testng.MessageTest">
+ <methods>
+ <include name="testHTMLAttributes" />
+ </methods>
+ </class>
+ </classes>
+ </test>
</suite>
16 years
JBoss Rich Faces SVN: r11502 - Reports/3.3.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-12-03 06:29:01 -0500 (Wed, 03 Dec 2008)
New Revision: 11502
Added:
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA2.xls
Log:
Added: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA2.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA2.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years
JBoss Rich Faces SVN: r11501 - in trunk/framework/impl/src: test/java/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-02 19:10:47 -0500 (Tue, 02 Dec 2008)
New Revision: 11501
Added:
trunk/framework/impl/src/test/java/org/richfaces/json/
Modified:
trunk/framework/impl/src/main/java/org/richfaces/json/JSONArray.java
trunk/framework/impl/src/main/java/org/richfaces/json/JSONCollection.java
trunk/framework/impl/src/main/java/org/richfaces/json/JSONException.java
trunk/framework/impl/src/main/java/org/richfaces/json/JSONMap.java
trunk/framework/impl/src/main/java/org/richfaces/json/JSONObject.java
Log:
https://jira.jboss.org/jira/browse/RF-5040
Modified: trunk/framework/impl/src/main/java/org/richfaces/json/JSONArray.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/json/JSONArray.java 2008-12-02 19:29:06 UTC (rev 11500)
+++ trunk/framework/impl/src/main/java/org/richfaces/json/JSONArray.java 2008-12-03 00:10:47 UTC (rev 11501)
@@ -25,6 +25,7 @@
*/
import java.io.IOException;
+import java.io.Serializable;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
@@ -80,10 +81,14 @@
* @author JSON.org
* @version 2
*/
-public class JSONArray {
+public class JSONArray implements Serializable {
-
/**
+ *
+ */
+ private static final long serialVersionUID = -5128849901663778859L;
+
+ /**
* The arrayList where the JSONArray's properties are kept.
*/
private ArrayList myArrayList;
Modified: trunk/framework/impl/src/main/java/org/richfaces/json/JSONCollection.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/json/JSONCollection.java 2008-12-02 19:29:06 UTC (rev 11500)
+++ trunk/framework/impl/src/main/java/org/richfaces/json/JSONCollection.java 2008-12-03 00:10:47 UTC (rev 11501)
@@ -21,6 +21,7 @@
package org.richfaces.json;
+import java.io.Serializable;
import java.util.AbstractCollection;
import java.util.Iterator;
@@ -30,8 +31,13 @@
* created 15.12.2006
*
*/
-public class JSONCollection extends AbstractCollection {
+public class JSONCollection extends AbstractCollection implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3192118108278773579L;
+
private JSONArray array;
public JSONCollection() throws JSONException {
Modified: trunk/framework/impl/src/main/java/org/richfaces/json/JSONException.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/json/JSONException.java 2008-12-02 19:29:06 UTC (rev 11500)
+++ trunk/framework/impl/src/main/java/org/richfaces/json/JSONException.java 2008-12-03 00:10:47 UTC (rev 11501)
@@ -27,8 +27,17 @@
* @version 2
*/
public class JSONException extends Exception {
- private Throwable cause;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2464742309018240317L;
+
+ private Throwable cause;
+ public JSONException() {
+ super();
+ }
+
/**
* Constructs a JSONException with an explanatory message.
* @param message Detail about the reason for the exception.
Modified: trunk/framework/impl/src/main/java/org/richfaces/json/JSONMap.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/json/JSONMap.java 2008-12-02 19:29:06 UTC (rev 11500)
+++ trunk/framework/impl/src/main/java/org/richfaces/json/JSONMap.java 2008-12-03 00:10:47 UTC (rev 11501)
@@ -21,6 +21,7 @@
package org.richfaces.json;
+import java.io.Serializable;
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.Iterator;
@@ -32,10 +33,15 @@
* created 15.12.2006
*
*/
-public class JSONMap extends AbstractMap {
+public class JSONMap extends AbstractMap implements Serializable {
- final private JSONObject jsonObject;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2898468948832273123L;
+ private JSONObject jsonObject;
+
public JSONMap() throws JSONException {
super();
Modified: trunk/framework/impl/src/main/java/org/richfaces/json/JSONObject.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/json/JSONObject.java 2008-12-02 19:29:06 UTC (rev 11500)
+++ trunk/framework/impl/src/main/java/org/richfaces/json/JSONObject.java 2008-12-03 00:10:47 UTC (rev 11501)
@@ -25,6 +25,8 @@
*/
import java.io.IOException;
+import java.io.ObjectStreamException;
+import java.io.Serializable;
import java.io.Writer;
import java.lang.reflect.Field;
import java.util.Collection;
@@ -85,16 +87,30 @@
* @author JSON.org
* @version 2
*/
-public class JSONObject {
+public class JSONObject implements Serializable {
/**
+ *
+ */
+ private static final long serialVersionUID = -3779657348977645510L;
+
+ /**
* JSONObject.NULL is equivalent to the value that JavaScript calls null,
* whilst Java's null is equivalent to the value that JavaScript calls
* undefined.
*/
- private static final class Null {
+ private static final class Null implements Serializable {
/**
+ *
+ */
+ private static final long serialVersionUID = -1155578668810010644L;
+
+ protected Null() {
+ super();
+ }
+
+ /**
* There is only intended to be a single instance of the NULL object,
* so the clone method returns itself.
* @return NULL.
@@ -122,6 +138,11 @@
public String toString() {
return "null";
}
+
+ private Object readResolve() throws ObjectStreamException {
+ return NULL;
+ }
+
}
16 years
JBoss Rich Faces SVN: r11500 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-12-02 14:29:06 -0500 (Tue, 02 Dec 2008)
New Revision: 11500
Added:
trunk/docs/userguide/en/src/main/docbook/included/editor.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/editor.xml
Log:
chapter about rich:editor
https://jira.jboss.org/jira/browse/RF-5042
Added: trunk/docs/userguide/en/src/main/docbook/included/editor.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/editor.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/editor.desc.xml 2008-12-02 19:29:06 UTC (rev 11500)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section role="updated">
+ <sectioninfo>
+ <keywordset>
+ <keyword>editor</keyword>
+ <keyword>rich:editor</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component is used for creating a WYSIWYG editor on a page.
+ </para>
+ <figure>
+ <title><emphasis role="bold">
+ <property><rich:editor></property>
+ </emphasis> component</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editor1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+<section>
+ <title>Key Features</title>
+
+ <itemizedlist>
+
+ <listitem><para>Seam text support</para></listitem>
+ <listitem><para>Properties customization via configuration files</para></listitem>
+ <listitem><para>Possibility to use custom plug-ins</para></listitem>
+
+
+
+ </itemizedlist>
+
+</section>
+</section>
+
\ No newline at end of file
Added: trunk/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/editor.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-02 19:29:06 UTC (rev 11500)
@@ -0,0 +1,831 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:editor</keyword>
+ <keyword>editor</keyword>
+ </keywordset>
+ </sectioninfo>
+ <table>
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.component.editor</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.richfaces.component.html.Htmleditor</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.richfaces.component.editor</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.richfaces.renderkit.html.editorRenderer</entry>
+ </row>
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.richfaces.taglib.editorTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <section>
+ <title>Creating the Component with a Page Tag</title>
+ <para>To create the simplest variant on a page use the following syntax:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:editor />
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.Htmleditor;
+...
+Htmleditor myeditor = new Htmleditor();
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Details of Usage</title>
+
+<para>The <emphasis role="bold"> <property><rich:editor></property></emphasis> is fully
+ based on TinyMCE web based Javascript HTML WYSIWYG editor control and supports all of the features has.
+The rich:editor adjusts TinyMCE editor of JSF environment adding some functional capabilities.
+</para>
+
+
+ <para>The easiest way to place the <emphasis role="bold"> <property><rich:editor></property></emphasis>on a page is as follows:</para>
+
+
+ <programlisting role="XML"><![CDATA[
+ <rich:editor value="#{bean.editorValue}" />
+]]></programlisting>
+
+
+ <para>Implementation of <emphasis role="bold"> <property><rich:editor></property></emphasis> provides three ways to define the properties of the component:
+ </para>
+
+ <orderedlist>
+
+ <listitem><para>Using attributes;</para></listitem>
+ <listitem><para>Using using <f:param> JSF tag;</para></listitem>
+ <listitem><para>Using configuration files.</para></listitem>
+
+ </orderedlist>
+
+ <para>The most important properties are implemented as attributes and you can define them as any other attribute.
+ The attributes of the <emphasis role="bold"> <property><rich:editor></property></emphasis> component
+ match the corresponding properties of TinyMCE editor.</para>
+
+ <para>For example, a theme for the editor an be defined using the <property>"theme"</property> attribute like this: </para>
+
+ <programlisting role="XML"><![CDATA[
+<rich:editor value="#{bean.editorValue}" theme="advanced"/>
+]]></programlisting>
+
+ <para>
+ Apart from the attributes that define the editor's properties there are a some attributes that help handle events(custom event handlers).
+ </para>
+ <para>
+ All custom event handlers can be found in the table of attributes and you can use them the same way as standard HTML event handlers. For example, like this:
+ </para>
+
+
+ <para>Most configuration options that TinyMCE provides can be applied using <f:param> JSF tag.
+ The syntax is quite simple: the <property>"name"</property> attribute should contain the option,
+ the <property>"value"</property> attribute assigns some value to the option.</para>
+
+<para>For example, this code adds some buttons to the editor and positions the toolbar. </para>
+
+<programlisting role="XML"><![CDATA[...
+<rich:editor value="#{bean.editorValue}" theme="advanced" plugins="save,paste" >
+ <f:param name="theme_advanced_buttons1" value="bold,italic,underline, cut,copy,paste,pasteword"/>
+ <f:param name="theme_advanced_toolbar_location" value="top"/>
+ <f:param name="theme_advanced_toolbar_align" value="left"/>
+</rich:editor>
+...]]></programlisting>
+
+ <para>This is what you get as a result:</para>
+
+
+
+ <figure>
+ <title> Setting configuration options with <f:param>
+
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editor2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+ <para>The last way to configure the <emphasis role="bold"> <property><rich:editor></property></emphasis> is
+ to use configuration file (.properties)</para>
+
+ <para> This method is can easy your life if you need to configure multiple instances
+ of the <emphasis role="bold"> <property><rich:editor></property></emphasis>. </para>
+ <para>To implement this type of configuration you need to take a few steps:</para>
+
+ <itemizedlist>
+ <listitem><para>Create a configuration file (.properties) in the classpath folder and add some properties to it. Use standard syntax for the .properties files: <code>parameter=value</code>. Here is an example of configuration file:</para>
+ <programlisting role="XML"><![CDATA[
+theme="advanced"
+plugins="save,paste"
+theme_advanced_buttons1="bold,italic,underline, cut,copy,paste,pasteword"
+theme_advanced_toolbar_location="top"
+theme_advanced_toolbar_align="left"
+]]></programlisting>
+
+ </listitem>
+ <listitem><para>The properties stored in configuration file are passed to the
+ <emphasis role="bold"> <property><rich:editor></property></emphasis> via
+ <property>"configuration"</property>attribute which takes the name of the configuration file as a value (with out .properties extension). </para></listitem>
+ <para>For example, you named the configuration file "editorconfig", you would address it as follows:
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+<rich:editor value="#{bean.editorValue}" configuration="editorconfig"/>
+...]]></programlisting>
+
+
+ <listitem><para>
+ Alternately, you can use a EL-binding to define a configuration file. This way you can dynamically change the sets of configuration properties. </para>
+
+ <para> For example, you have two configuration files "configurationAdvanced" and "configurationSimple" and you want them to be
+ applied under some condition. </para>
+
+ <para>To do this you need to bind <property>"configuration"</property>attribute to the appropriate bean property like this . </para>
+
+<programlisting role="XML"><![CDATA[...
+<rich:editor value="#{bean.editorValue}" configuration="#{editor.property}" />
+...]]></programlisting>
+ <para>Your Java file should look like this.</para>
+
+ <programlisting role="JAVA"><![CDATA[...
+ String configuration;
+ if(some condition){//define some condition
+ configuration = "configurationAdvanced"; //the name on the file with advanced properties
+ }
+ else{
+ configuration= "configurationSimple"; //the name on the file with simplified properties
+
+ }
+...]]></programlisting>
+
+
+ </listitem>
+
+ </itemizedlist>
+
+
+ <para></para>
+
+ </section>
+
+
+
+
+ <!-- JavaScript API-->
+ <section>
+ <title>JavaScript API</title>
+
+
+
+ </section>
+ <!-- End of JavaScript API-->
+ <section>
+ <title>JavaScript API</title>
+ <table>
+ <title>JavaScript API</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Function</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>enable()</entry>
+ <entry>Enables the component</entry>
+ </row>
+ <row>
+ <entry>disable()</entry>
+ <entry>Disables the component</entry>
+ </row>
+ <row>
+ <entry>stop()</entry>
+ <entry>Stops the uploading
+ process</entry>
+ </row>
+ <row>
+ <entry>clear()</entry>
+ <entry>Removes all files from the list.
+ The function can also get the
+ $('id').component.entries[i]
+ as a parameter to remove a
+ particular file. </entry>
+ </row>
+ <row>
+ <entry> submitForm() </entry>
+ <entry> Submits form to server. All
+ added files will be put to
+ model and event. </entry>
+ </row>
+ <row>
+ <entry> beforeSubmit() </entry>
+ <entry> Sets up necessary request
+ parameters for file uploading
+ and submits form to server by
+ command button. This method
+ should be used together with
+ commands </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+
+
+
+
+
+
+
+
+
+ </section>
+ <!-- End of JavaScript API-->
+ <section>
+ <title>Look-and-Feel Customization</title>
+ <para>For skinnability implementation, the components use a <emphasis>
+ <property>style class redefinition method.</property>
+ </emphasis> Default style classes are mapped on <emphasis>
+ <property>skin parameters.</property>
+ </emphasis></para>
+ <para>There are two ways to redefine the appearance of all <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> components at once: <itemizedlist>
+ <listitem>
+ <para>Redefine the corresponding skin
+ parameters</para>
+ </listitem>
+ <listitem>
+ <para> Add to your style sheets style classes used
+ by a <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section>
+ <title>Skin Parameters Redefinition</title>
+
+ <table>
+ <title>Skin parameters redefinition for a component</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>tableBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a font</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
+ </row>
+ <row>
+ <entry>generalSizeFont</entry>
+ <entry>font-size</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a toolbar</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-bottom-color</entry>
+ </row>
+ <row>
+ <entry>tableBackgroundColor</entry>
+ <entry>border-top-color</entry>
+ </row>
+ <row>
+ <entry>tableBackgroundColor</entry>
+ <entry>border-left-color</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for items in the list</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-bottom-color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a "Cancel",
+ "Clear" links</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalLinkColor</entry>
+ <entry>color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a button border</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a highlighted button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>trimColor</entry>
+ <entry>background-color</entry>
+ </row>
+ <row>
+ <entry>selectControlColor</entry>
+ <entry>border-color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for a pressed button</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>selectControlColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>additionalBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Skin parameters redefinition for "Upload",
+ "Clean" buttons</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a disabled
+ "Start" button icon</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Skin parameters redefinition for a disabled
+ "Clear" button icon</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>tableBorderColor</entry>
+ <entry>color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section>
+ <title>Definition of Custom Style Classes</title>
+
+ <para>The following picture illustrates how CSS classes define styles for
+ component elements.</para>
+ <figure>
+ <title>Classes names</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload_cn.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <figure>
+ <title>Classes names</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload_cn2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+
+ <table>
+ <title>Classes names that define buttons representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-fileupload-button</entry>
+ <entry>Defines styles for a
+ buttons</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-button-border</entry>
+ <entry>Defines styles for a border of
+ buttons</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-button-light</entry>
+ <entry>Defines styles for a highlight of
+ button</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-button-press</entry>
+ <entry>Defines styles for a pressed
+ button</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-button-dis</entry>
+ <entry>Defines styles for a disabled
+ button</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-button-selection</entry>
+ <entry>Defines styles for
+ "Upload",
+ "Clean"
+ buttons</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Classes names that define the representation of the buttons'
+ icons</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-fileupload-ico</entry>
+ <entry>Defines styles for an
+ icon</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-ico-add</entry>
+ <entry>Defines styles for a
+ "Add" button
+ icon</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-ico-start</entry>
+ <entry>Defines styles for a
+ "Upload"
+ button icon</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-ico-stop</entry>
+ <entry>Defines styles for a
+ "Stop"
+ button icon</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-ico-clear</entry>
+ <entry>Defines styles for a
+ "Clear"
+ button icon</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-ico-add-dis</entry>
+ <entry>Defines styles for a disabled
+ "Add" button
+ icon</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-ico-start-dis</entry>
+ <entry>Defines styles for a disabled
+ "Upload"
+ button icon</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-ico-clear-dis</entry>
+ <entry>Defines styles for a disabled
+ "Clear"
+ button icon</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Classes names that define list items representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-fileupload-table-td</entry>
+ <entry>Defines styles for a wrapper
+ <td> element of
+ a list items</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-anc</entry>
+ <entry>Defines styles for
+ "Cancel",
+ "Stop",
+ "Clear"
+ links</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <para>In order to redefine styles for all <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> components on a page using CSS, it's enough to
+ create classes with the same names (possible classes could be found in
+ the tables <link linkend="fileUploadCN"> above</link>) and define
+ necessary properties in them. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
+.rich-fileupload-anc{
+ font-weight:bold;
+ text-decoration:none;
+}
+...]]></programlisting>
+
+ <para>This is the result:</para>
+
+ <figure>
+ <title>Redefinition styles with predefined classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload_pc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the example above the font weight and text decoration for
+ "Cancel" and "Clear" links are
+ changed.</para>
+
+ <para> Also it's possible to change styles of particular <emphasis
+ role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component. In this case you should create own style
+ classes and use them in the corresponding <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis>
+ <emphasis>
+ <property>styleClass</property>
+ </emphasis> attributes. An example is placed below: </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
+.myClass{
+ font-weight:bold;
+}
+...]]></programlisting>
+ <para> The <emphasis>
+ <property>"addButtonClass"</property>
+ </emphasis> attribute for <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> is defined as it's shown in the example below: </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<rich:fileUpload ... addButtonClass="myClass"/>
+]]></programlisting>
+
+ <para>This is the result:</para>
+ <figure>
+ <title>Redefinition styles with own classes and <emphasis>
+ <property>styleClass</property>
+ </emphasis> attributes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload_oc.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>As it could be seen on the picture above, the font style for
+ "Add" button is changed.</para>
+
+ </section>
+
+ <section>
+ <title>Relevant Resources Links</title>
+ <para><ulink
+ url="http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf?c=file..."
+ >Here</ulink> you can see an example of <emphasis
+ role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> usage and sources for the given example. </para>
+ </section>
+
+</section>
+<!--para>In order to encode form around <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component you could confine this area by <emphasis role="bold">
+ <property><h:form></property>
+ </emphasis>/<emphasis role="bold">
+ <property></h:form></property></emphasis> tags.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <h:form>
+ <rich:fileUpload uploadData="#{bean.data}" addControlLabel="myLabel" autoclear="true" maxFilesQuantity="2" fileUploadListener="#{bean.listener}"
+ acceptedTypes="html" immediateUpload="true"/>
+ <a4j:commandLink style="font-weight: bold; width: 200px;" value="Show files uploaded:" reRender="files_list">
+ <h:dataTable value="#{bean.fileList}" var="file" id="files_list" style="width: 500px">
+ <h:column>
+ <h:outputText value="#{file.fileName}"></h:outputText>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+ ...]]></programlisting>
+ <para>This is a result:</para>
+ <figure>
+ <title><emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis>at server-side</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload11.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure-->
16 years
JBoss Rich Faces SVN: r11499 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-12-02 14:28:35 -0500 (Tue, 02 Dec 2008)
New Revision: 11499
Added:
trunk/docs/userguide/en/src/main/resources/images/editor1.png
trunk/docs/userguide/en/src/main/resources/images/editor2.png
Log:
pictures for rich:editor
https://jira.jboss.org/jira/browse/RF-5042
Added: trunk/docs/userguide/en/src/main/resources/images/editor1.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/editor1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/editor2.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/editor2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years
JBoss Rich Faces SVN: r11498 - trunk/docs/userguide/en/src/main/docbook.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-12-02 14:27:37 -0500 (Tue, 02 Dec 2008)
New Revision: 11498
Modified:
trunk/docs/userguide/en/src/main/docbook/master.xml
Log:
added new component
https://jira.jboss.org/jira/browse/RF-5042
Modified: trunk/docs/userguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/master.xml 2008-12-02 19:27:11 UTC (rev 11497)
+++ trunk/docs/userguide/en/src/main/docbook/master.xml 2008-12-02 19:27:37 UTC (rev 11498)
@@ -57,6 +57,7 @@
<!ENTITY hotKey_table SYSTEM "../../../target/generated/hotKey.xml">
<!ENTITY coreComponents_table SYSTEM "../../../target/generated/a4j.xml">
<!ENTITY beanValidator_table SYSTEM "../../../target/generated/beanValidator.xml">
+ <!ENTITY editor_table SYSTEM "../../../target/generated/editor.xml">
]>
<book>
@@ -107,6 +108,7 @@
&contextMenu_table;
&dataFilterSlider_table;
&dataScroller_table;
+&editor_table;
&columns_table;
&dataTable_table;
&dnd_table;
16 years
JBoss Rich Faces SVN: r11497 - trunk/docs/userguide.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-12-02 14:27:11 -0500 (Tue, 02 Dec 2008)
New Revision: 11497
Modified:
trunk/docs/userguide/pom.xml
Log:
added new component
https://jira.jboss.org/jira/browse/RF-5042
Modified: trunk/docs/userguide/pom.xml
===================================================================
--- trunk/docs/userguide/pom.xml 2008-12-02 18:46:48 UTC (rev 11496)
+++ trunk/docs/userguide/pom.xml 2008-12-02 19:27:11 UTC (rev 11497)
@@ -97,6 +97,19 @@
</artifactItem>
+ <artifactItem>
+ <groupId>
+ org.richfaces.ui
+ </groupId>
+ <artifactId>
+ editor
+ </artifactId>
+ <version>
+ ${project.version}
+ </version>
+ </artifactItem>
+
+
<artifactItem>
<groupId>
org.richfaces.ui
16 years
JBoss Rich Faces SVN: r11496 - trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-02 13:46:48 -0500 (Tue, 02 Dec 2008)
New Revision: 11496
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
Log:
avoid test hanging in case of error occurred in IE
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
===================================================================
(Binary files differ)
16 years
JBoss Rich Faces SVN: r11495 - trunk/framework/impl/src/main/javascript.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-02 13:22:11 -0500 (Tue, 02 Dec 2008)
New Revision: 11495
Modified:
trunk/framework/impl/src/main/javascript/memory.js
Log:
https://jira.jboss.org/jira/browse/RF-5073
Modified: trunk/framework/impl/src/main/javascript/memory.js
===================================================================
--- trunk/framework/impl/src/main/javascript/memory.js 2008-12-02 17:09:06 UTC (rev 11494)
+++ trunk/framework/impl/src/main/javascript/memory.js 2008-12-02 18:22:11 UTC (rev 11495)
@@ -6,21 +6,30 @@
if (!window.RichFaces.Memory) {
window.RichFaces.Memory = {
- cleaners: {},
+ nodeCleaners: {},
+ componentCleaners: {},
addCleaner: function (name, cleaner) {
- this.cleaners[name] = cleaner;
+ this.nodeCleaners[name] = cleaner;
},
- applyCleaners: function (node, isAjax) {
- for (var name in this.cleaners) {
- this.cleaners[name](node, isAjax);
+ addComponentCleaner: function (name, cleaner, checker) {
+ this.componentCleaners[name] = {cleaner: cleaner, checker: checker};
+ },
+
+ applyCleaners: function (node, isAjax, componentNodes) {
+ for (var name in this.nodeCleaners) {
+ this.nodeCleaners[name](node, isAjax);
}
+ for (var name in this.componentCleaners) {
+ if (this.componentCleaners[name].checker(node, isAjax))
+ componentNodes.push(node);
+ }
},
- clean: function (oldNode, isAjax) {
+ _clean: function (oldNode, isAjax, componentNodes) {
if (oldNode) {
- this.applyCleaners(oldNode, isAjax);
+ this.applyCleaners(oldNode, isAjax, componentNodes);
//node.all is quicker than recursive traversing
//window doesn't have "all" attribute
@@ -31,20 +40,36 @@
var length = all.length;
for (var counter = 0; counter < length; counter++ ) {
- this.applyCleaners(all[counter], isAjax);
+ this.applyCleaners(all[counter], isAjax, componentNodes);
}
} else {
var node = oldNode.firstChild;
while (node) {
- this.clean(node, isAjax);
+ this._clean(node, isAjax, componentNodes);
node = node.nextSibling;
}
}
}
+ },
+
+ _cleanComponentNodes: function (oldNodes, isAjax) {
+ for (var i=0; i<oldNodes.length; i++) {
+ var node = oldNodes[i];
+ for (var name in this.componentCleaners) {
+ this.componentCleaners[name].cleaner(node, isAjax);
+ }
+ }
+ },
+
+ clean: function (oldNode, isAjax) {
+ var componentNodes = [];
+ this._clean(oldNode, isAjax, componentNodes);
+ this._cleanComponentNodes(componentNodes, isAjax);
+ componentNodes = null;
}
};
- window.RichFaces.Memory.addCleaner("richfaces", function(node, isAjax) {
+ window.RichFaces.Memory.addComponentCleaner("richfaces", function(node, isAjax) {
var component = node.component;
if (component) {
var destructorName = component["rich:destructor"];
@@ -56,6 +81,8 @@
}
}
}
+ }, function(node, isAjax) {
+ return (node.component && node.component["rich:destructor"]);
});
if (window.attachEvent) {
16 years
JBoss Rich Faces SVN: r11494 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/WEB-INF and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-02 12:09:06 -0500 (Tue, 02 Dec 2008)
New Revision: 11494
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarDataModel.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
RF-5148,RF-5149
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarDataModel.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarDataModel.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarDataModel.java 2008-12-02 17:09:06 UTC (rev 11494)
@@ -0,0 +1,76 @@
+/**
+ *
+ */
+package org.ajax4jsf.bean;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.richfaces.model.CalendarDataModelItem;
+
+/**
+ * @author Andrey Markavtsov
+ *
+ */
+public class CalendarDataModel implements org.richfaces.model.CalendarDataModel {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.model.CalendarDataModel#getData(java.util.Date[])
+ */
+ public CalendarDataModelItem[] getData(Date[] dateArray) {
+ CalendarDataModelItem[] items = new CalendarDataModelItemImpl[dateArray.length];
+ for (int i = 0;i < items.length; i++) {
+ items[i] = new CalendarDataModelItemImpl(dateArray[i]);
+ }
+ return items;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.model.CalendarDataModel#getToolTip(java.util.Date)
+ */
+ public Object getToolTip(Date date) {
+ return null;
+ }
+
+}
+
+class CalendarDataModelItemImpl implements CalendarDataModelItem {
+
+ int day;
+ Object data;
+
+ public CalendarDataModelItemImpl(Date date) {
+ Map<String, String> data = new HashMap<String, String>();
+ Calendar c = Calendar.getInstance();
+ c.setTime(date);
+ day = c.get(Calendar.DAY_OF_MONTH);
+ this.data = data;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public int getDay() {
+ return day;
+ }
+
+ public String getStyleClass() {
+ return null;
+ }
+
+ public Object getToolTip() {
+ return null;
+ }
+
+ public boolean hasToolTip() {
+ return false;
+ }
+
+ public boolean isEnabled() {
+ return true;
+ }
+
+}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-02 16:29:39 UTC (rev 11493)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-02 17:09:06 UTC (rev 11494)
@@ -29,8 +29,16 @@
import java.util.TimeZone;
import javax.faces.convert.DateTimeConverter;
+import javax.faces.event.ValueChangeEvent;
+import org.richfaces.component.UICalendar;
+import org.richfaces.event.CurrentDateChangeEvent;
+
public class CalendarTestBean {
+
+ public static final String valueChangeListener = "valueChangeListener";
+
+ public static final String currentDateChangeListener = "currentDateChangeListener";
public static final String DATE_PATTERN = "MM/dd/yyyy HH:mm";
@@ -60,6 +68,12 @@
private String selectedDateString;
+ private CalendarDataModel model;
+
+ private String mode = UICalendar.AJAX_MODE;
+
+ private String status;
+
public CalendarTestBean() {
selectedDate = DEFAULT_DATE;
resetSelectedDateString();
@@ -167,4 +181,52 @@
// skip exception
}
}
+
+ public void valueChangeListener(ValueChangeEvent event) {
+ status = getStatus() + valueChangeListener;
+ }
+
+ public void currectDateChangeListener(CurrentDateChangeEvent event) {
+ status = getStatus() + currentDateChangeListener;
+ }
+
+ public String testClientMode() {
+ mode = UICalendar.CLIENT_MODE;
+ return null;
+ }
+
+ public void reset() {
+ mode = UICalendar.AJAX_MODE;
+ status = "";
+ selectedDate = new Date();
+ }
+
+ public String resetAction() {
+ reset();
+ return null;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getMode() {
+ return mode;
+ }
+
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
+
+ public CalendarDataModel getModel() {
+ return model;
+ }
+
+ public void setModel(CalendarDataModel model) {
+ this.model = model;
+ }
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2008-12-02 16:29:39 UTC (rev 11493)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/faces-config.xml 2008-12-02 17:09:06 UTC (rev 11494)
@@ -186,8 +186,18 @@
<managed-bean-name>calendarBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.CalendarTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>model</property-name>
+ <property-class>org.ajax4jsf.bean.CalendarDataModel</property-class>
+ <value>#{calendarDataModel}</value>
+ </managed-property>
</managed-bean>
<managed-bean>
+ <managed-bean-name>calendarDataModel</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.bean.CalendarDataModel</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>formBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.bean.A4JFormTestBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/calendarTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-02 16:29:39 UTC (rev 11493)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-02 17:09:06 UTC (rev 11494)
@@ -32,81 +32,203 @@
public class CalendarTest extends SeleniumTestBase {
- @Test
- public void testCalendarComponent(Template template) {
- renderPage(template);
+ static final String RESET_METHOD = "#{calendarBean.reset}";
- String containerId = getParentId() + "_form:";
- String calendarOpenedId = containerId + "calendar";
- String calendarCollapsedId = calendarOpenedId + "Popup";
- String calendarInputDate = calendarOpenedId + "InputDate";
- String calendarPopupButton = calendarCollapsedId + "Button";
- String outputPanel = containerId + "outputPanel";
+ static final String FORM_ID = "_form:";
+ static final String CONTROLS_FORM_ID = "_controls:";
+
+ static final String availableDayCellClass = "rich-calendar-cell-size rich-calendar-cell rich-calendar-btn";
+
+ String calendarId;
+ String calendarHeaderId;
+ String ajaxSubmitId;
+ String serverSubmitId;
+ String statusId;
+ String resetActionId;
+ String testClientModeId;
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
+ void initIds(String parentId) {
+ calendarId = parentId + FORM_ID + "calendar";
+ calendarHeaderId = calendarId + "Header";
+ ajaxSubmitId = parentId + FORM_ID + "ajaxSubmit";
+ serverSubmitId = parentId + FORM_ID + "serverSubmit";
+ statusId = parentId + FORM_ID + "status";
+ resetActionId = parentId + CONTROLS_FORM_ID + "resetAction";
+ testClientModeId = parentId + CONTROLS_FORM_ID + "testClientMode";
+ }
- writeStatus("Mouse click on calendar InputDate field");
- clickById(calendarInputDate);
+ String getStatus() {
+ return getTextById(statusId);
+ }
+
+ void assertListeners(String... listener) {
+ String status = getStatus();
+ String s = status;
+ String sum = "";
+ for (String l : listener) {
+ if (status.indexOf(l) == -1) {
+ Assert.fail(l + " has been skipped");
+ } else {
+ s = s.replace(l, "");
+ }
+ sum += l;
+ }
+ if (s.length() > 0) {
+ Assert.fail("The following listener were called but shouldn't: "
+ + s);
+ }
+ if (!status.equals(sum)) {
+ Assert.fail("Order of listeners call is incorrect. Should be: "
+ + sum + ". But was : " + status);
+ }
+ }
- Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+ void changeDate() {
+ String weekNumId = calendarId + "WeekNum2";
+ selenium.click("//tr[@id='"+weekNumId+"']/td[@class='"+availableDayCellClass+"']");
+ }
+
+ void changeCurrentDate(boolean wait4ajax) {
+ selenium.click("//td[@id='"+calendarHeaderId+"']/table/tbody/tr/td/div");
+ if (wait4ajax) {
+ waitForAjaxCompletion();
+ }
+ }
+
+ void reset() {
+ clickCommandAndWait(resetActionId);
+ }
+
+ void switchToClientMode() {
+ clickCommandAndWait(testClientModeId);
+ }
+
+ @Test
+ public void testListenersInAjaxMode(Template template) {
+ renderPage(template, RESET_METHOD);
+ initIds(getParentId());
- writeStatus("Mouse click outside calendar");
- clickById(outputPanel);
+ changeDate();
+
+ clickAjaxCommandAndWait(ajaxSubmitId);
+ assertListeners(CalendarTestBean.valueChangeListener);
+
+ reset();
+
+ changeCurrentDate(true);
+ changeDate();
+ clickAjaxCommandAndWait(ajaxSubmitId);
+ assertListeners(CalendarTestBean.valueChangeListener, CalendarTestBean.currentDateChangeListener);
+
+ }
+
+
+ @Test
+ public void testListenersInClientMode(Template template) {
+ renderPage(template, RESET_METHOD);
+ initIds(getParentId());
+ switchToClientMode();
+
+ changeDate();
+
+ clickCommandAndWait(serverSubmitId);
+ assertListeners(CalendarTestBean.valueChangeListener);
+
+ reset();
+ switchToClientMode();
+
+ changeCurrentDate(false);
+ changeDate();
+ clickCommandAndWait(serverSubmitId);
+ assertListeners(CalendarTestBean.valueChangeListener, CalendarTestBean.currentDateChangeListener);
+
+ }
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
- writeStatus("Mouse click on calendar popup button");
- clickById(calendarPopupButton);
+ // @Test
+ public void testCalendarComponent(Template template) {
+ renderPage(template);
- Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
- }
+ String containerId = getParentId() + "_form:";
+ String calendarOpenedId = containerId + "calendar";
+ String calendarCollapsedId = calendarOpenedId + "Popup";
+ String calendarInputDate = calendarOpenedId + "InputDate";
+ String calendarPopupButton = calendarCollapsedId + "Button";
+ String outputPanel = containerId + "outputPanel";
- @Test
- public void testSelectDateComponent(Template template) {
- renderPage(template);
+ Assert.assertFalse(isVisibleById(calendarOpenedId),
+ "Calendar window should NOT be visible on the component!");
- Date newSelectedDate = CalendarTestBean.getDayInMay(15);
+ writeStatus("Mouse click on calendar InputDate field");
+ clickById(calendarInputDate);
- String containerId = getParentId() + "_form:";
- String calendarOpenedId = containerId + "calendar";
- String calendarCollapsedId = calendarOpenedId + "Popup";
- String calendarInputDate = calendarOpenedId + "InputDate";
- String calendarPopupButton = calendarCollapsedId + "Button";
- String outputPanel = containerId + "outputPanel";
+ Assert.assertTrue(isVisibleById(calendarOpenedId),
+ "Calendar window should be visible on the component!");
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
- writeStatus("Mouse click on calendar popup button");
- clickById(calendarPopupButton);
- Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+ writeStatus("Mouse click outside calendar");
+ clickById(outputPanel);
- String inputDateString = getValueById(calendarInputDate);
- Date readDate = null;
- try {
- readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
- } catch(ParseException parseException) {
- // skip exception
+ Assert.assertFalse(isVisibleById(calendarOpenedId),
+ "Calendar window should NOT be visible on the component!");
+
+ writeStatus("Mouse click on calendar popup button");
+ clickById(calendarPopupButton);
+
+ Assert.assertTrue(isVisibleById(calendarOpenedId),
+ "Calendar window should be visible on the component!");
}
- Assert.assertEquals(readDate, CalendarTestBean.DEFAULT_DATE, "Default date representation is wrong!");
- // click on 15th of May
- String newSelectedDateId = calendarOpenedId + "DayCell18";
- clickById(newSelectedDateId);
+ // @Test
+ public void testSelectDateComponent(Template template) {
+ renderPage(template);
- writeStatus("Mouse click outside calendar");
- clickById(outputPanel);
+ Date newSelectedDate = CalendarTestBean.getDayInMay(15);
- inputDateString = getValueById(calendarInputDate);
- try {
- readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
- } catch(ParseException parseException) {
- // skip exception
+ String containerId = getParentId() + "_form:";
+ String calendarOpenedId = containerId + "calendar";
+ String calendarCollapsedId = calendarOpenedId + "Popup";
+ String calendarInputDate = calendarOpenedId + "InputDate";
+ String calendarPopupButton = calendarCollapsedId + "Button";
+ String outputPanel = containerId + "outputPanel";
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId),
+ "Calendar window should NOT be visible on the component!");
+ writeStatus("Mouse click on calendar popup button");
+ clickById(calendarPopupButton);
+ Assert.assertTrue(isVisibleById(calendarOpenedId),
+ "Calendar window should be visible on the component!");
+
+ String inputDateString = getValueById(calendarInputDate);
+ Date readDate = null;
+ try {
+ readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
+ } catch (ParseException parseException) {
+ // skip exception
+ }
+ Assert.assertEquals(readDate, CalendarTestBean.DEFAULT_DATE,
+ "Default date representation is wrong!");
+
+ // click on 15th of May
+ String newSelectedDateId = calendarOpenedId + "DayCell18";
+ clickById(newSelectedDateId);
+
+ writeStatus("Mouse click outside calendar");
+ clickById(outputPanel);
+
+ inputDateString = getValueById(calendarInputDate);
+ try {
+ readDate = CalendarTestBean.DATE_FORMAT.parse(inputDateString);
+ } catch (ParseException parseException) {
+ // skip exception
+ }
+ Assert.assertEquals(readDate, newSelectedDate,
+ "Date representation after selecting 15.May.2008 is wrong!");
+
+ Assert.assertFalse(isVisibleById(calendarOpenedId),
+ "Calendar window should NOT be visible on the component!");
}
- Assert.assertEquals(readDate, newSelectedDate, "Date representation after selecting 15.May.2008 is wrong!");
- Assert.assertFalse(isVisibleById(calendarOpenedId), "Calendar window should NOT be visible on the component!");
- }
-
- public String getTestUrl() {
- return "pages/calendar/calendarTest.xhtml";
- }
+ public String getTestUrl() {
+ return "pages/calendar/calendarTest.xhtml";
+ }
}
16 years