JBoss Rich Faces SVN: r11533 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-12-03 13:38:11 -0500 (Wed, 03 Dec 2008)
New Revision: 11533
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
Log:
reopened https://jira.jboss.org/jira/browse/RF-5195
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml 2008-12-03 18:37:51 UTC (rev 11532)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml 2008-12-03 18:38:11 UTC (rev 11533)
@@ -11,9 +11,9 @@
}
</style>
<h:form>
- <a4j:jsFunction name="submit" reRender="result"/>
<h:panelGrid columns="2" width="100%" columnClasses="column,column">
- <rich:editor configuration="#{editorBean.currentConfiguration}" id="editor" width="400" viewMode = "#{editorBean.viewMode}" value="#{editorBean.value}" onchange="submit">
+ <rich:editor configuration="#{editorBean.currentConfiguration}" id="editor" width="400" viewMode = "#{editorBean.viewMode}" value="#{editorBean.value}">
+ <a4j:support event="onchange" reRender="result" ajaxSingle="true" requestDelay="1000" rendered="#{editorBean.liveUpdatesEnabled}"/>
</rich:editor>
<rich:panel>
@@ -24,24 +24,30 @@
<h:outputText value="Select Editor Theme"/>
<h:selectOneRadio value="#{editorBean.currentConfiguration}" layout="pageDirection">
<f:selectItems value="#{editorBean.configurations}"/>
- <a4j:support event="onchange" reRender="editor" />
+ <a4j:support event="onchange" reRender="editor"/>
</h:selectOneRadio>
<h:outputText value="Toggle Modes"/>
<h:selectOneRadio value="#{editorBean.viewMode}" layout="pageDirection">
<f:selectItem itemLabel="WYSIWYG mode" itemValue="visual"/>
<f:selectItem itemLabel="Simple Text Area" itemValue="source"/>
- <a4j:support event="onchange" reRender="editor" />
+ <a4j:support event="onchange" reRender="editor"/>
</h:selectOneRadio>
+ <h:outputText value="Toggle Preview: " />
+ <h:selectBooleanCheckbox value="#{editorBean.liveUpdatesEnabled}" >
+ <a4j:support event="onchange" reRender="editor, result"/>
+ </h:selectBooleanCheckbox>
</h:panelGrid>
</rich:panel>
</h:panelGrid>
- <rich:panel id="result">
- <f:facet name="header">
- <h:outputText value="Preview"/>
- </f:facet>
- <h:outputText escape="false" value="#{editorBean.value}"/>
- </rich:panel>
+ <a4j:outputPanel layout="block" id="result">
+ <rich:panel rendered="#{editorBean.liveUpdatesEnabled}">
+ <f:facet name="header">
+ <h:outputText value="Preview"/>
+ </f:facet>
+ <h:outputText escape="false" value="#{editorBean.value}"/>
+ </rich:panel>
+ </a4j:outputPanel>
</h:form>
</ui:composition>
17 years, 6 months
JBoss Rich Faces SVN: r11532 - trunk/test-applications/seleniumTest/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 13:37:51 -0500 (Wed, 03 Dec 2008)
New Revision: 11532
Modified:
trunk/test-applications/seleniumTest/richfaces/pom.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 18:24:27 UTC (rev 11531)
+++ trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-03 18:37:51 UTC (rev 11532)
@@ -85,4 +85,16 @@
</plugin>
</plugins>
</build>
+ <repositories>
+ <repository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <id>snapshots.jboss.org</id>
+ <url>http://snapshots.jboss.org/maven2</url>
+ </repository>
+ </repositories>
</project>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r11531 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 13:24:27 -0500 (Wed, 03 Dec 2008)
New Revision: 11531
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 18:14:29 UTC (rev 11530)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 18:24:27 UTC (rev 11531)
@@ -2,6 +2,11 @@
<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.0-SNAPSHOT</version>
+ </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>seleniumTest</groupId>
<artifactId>seleniumTest</artifactId>
@@ -37,49 +42,10 @@
<enabled>false</enabled>
</releases>
</repository>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>maven-repository.dev.java.net</id>
- <name>Java.net Repository for Maven</name>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
-
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- </repository>
- <repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>snapshots.jboss.org</id>
- <url>http://snapshots.jboss.org/maven2</url>
- </repository>
</repositories>
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>0.3.1</version>
@@ -217,44 +183,6 @@
</modules>
<dependencies>
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.14</version>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>el-impl</groupId>
- <artifactId>el-impl</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_10</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>1.2_10</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.8</version>
17 years, 6 months
JBoss Rich Faces SVN: r11530 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-12-03 13:14:29 -0500 (Wed, 03 Dec 2008)
New Revision: 11530
Modified:
trunk/docs/userguide/en/src/main/docbook/included/editor.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-426
Configuration attribute is documented
Modified: trunk/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-03 18:14:29 UTC (rev 11529)
+++ trunk/docs/userguide/en/src/main/docbook/included/editor.xml 2008-12-03 18:14:29 UTC (rev 11530)
@@ -196,8 +196,49 @@
</itemizedlist>
- <para></para>
+ <para>
+ You also might want to add some custom plug-ins to your editor.
+ You can read about how to create a plug-in <ulink url="http://wiki.moxiecode.com/index.php/TinyMCE:Creating_Plugin">here</ulink>.
+ </para>
+ <para>
+ Adding a custom plug-in also requires a few steps to take. Though the procedure is very similar to adding a configuration file.
+
+ </para>
+
+ <para>This is what you need to add a plug-in:</para>
+
+ <itemizedlist>
+ <listitem><para>Create a .properties file and put the name of the plug-in and a path to it there. The file can contain multiple plug-ins declarations. Your .properties file should be like this. </para>
+ <programlisting role="XML"><![CDATA[...
+pluginName=/mytinymceplugins/plugin1Name/editor_plugin.js
+...]]></programlisting>
+
+ </listitem>
+ <listitem>
+ <para>Use the <property>"customPlugins"</property> attribute to specify the .properties file with a plug-in name and a path to it.</para>
+ <para>Example:</para>
+ <para>If your .properties file is named "myPlugins", then your will have this code on the page.</para>
+ <programlisting role="XML"><![CDATA[...
+<rich:editor theme="advanced" customPlugins="myPlugins" plugins="pluginName">
+...]]></programlisting>
+
+ </listitem>
+
+ <note><title>Note:</title>
+
+ <para>
+
+Some plug-ins which available for download could have some dependencies to TinyMCE scripts.
+For example, dialog pop-ups requires tiny_mce_popup.js.
+Taking into consideration that developer will not plug our custom plugins to the RF jar with editor component
+(as opposite to standard tinyMCE plugins creation, which means that plugins will be put into tinyMCE corersponding directory) -
+ the developer should manually add needed tinyMCE scripts to some folder and correct the js includes.
+ </para>
+ </note>
+
+ </itemizedlist>
+
</section>
@@ -213,58 +254,7 @@
<!-- 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>
-
-
-
+
@@ -282,7 +272,7 @@
<property>skin parameters.</property>
</emphasis></para>
<para>There are two ways to redefine the appearance of all <emphasis role="bold">
- <property><rich:fileUpload></property>
+ <property><rich:editor></property>
</emphasis> components at once: <itemizedlist>
<listitem>
<para>Redefine the corresponding skin
@@ -291,7 +281,7 @@
<listitem>
<para> Add to your style sheets style classes used
by a <emphasis role="bold">
- <property><rich:fileUpload></property>
+ <property><rich:editor></property>
</emphasis> component</para>
</listitem>
</itemizedlist>
@@ -301,531 +291,29 @@
<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..."
+ url="http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf?c=editor"
>Here</ulink> you can see an example of <emphasis
role="bold">
- <property><rich:fileUpload></property>
+ <property><rich:editor></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-->
+</section>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r11529 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-12-03 13:14:29 -0500 (Wed, 03 Dec 2008)
New Revision: 11529
Modified:
trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml
Log:
RF-5097:fileUpload component description update
Modified: trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml 2008-12-03 17:25:50 UTC (rev 11528)
+++ trunk/docs/userguide/en/src/main/docbook/included/fileUpload.xml 2008-12-03 18:14:29 UTC (rev 11529)
@@ -1,366 +1,334 @@
<?xml version="1.0" encoding="UTF-8"?>
<section>
- <sectioninfo>
- <keywordset>
- <keyword>rich:fileUpload</keyword>
- <keyword>fileUpload</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.FileUpload</entry>
- </row>
- <row>
- <entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlFileUpload</entry>
- </row>
- <row>
- <entry>component-family</entry>
- <entry>org.richfaces.component.FileUpload</entry>
- </row>
- <row>
- <entry>renderer-type</entry>
- <entry>org.richfaces.renderkit.html.FileUploadRenderer</entry>
- </row>
- <row>
- <entry>tag-class</entry>
- <entry>org.richfaces.taglib.FileUploadTag</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>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:fileUpload</keyword>
+ <keyword>fileUpload</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.FileUpload</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.richfaces.component.html.HtmlFileUpload</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.richfaces.component.FileUpload</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.richfaces.renderkit.html.FileUploadRenderer</entry>
+ </row>
+ <row>
+ <entry>tag-class</entry>
+ <entry>org.richfaces.taglib.FileUploadTag</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[...
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload />
...]]></programlisting>
- </section>
- <section>
- <title>Creating the Component Dynamically Using Java</title>
+ </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.HtmlFileUpload;
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlFileUpload;
...
HtmlFileUpload myFileUpload = new HtmlFileUpload();
...]]></programlisting>
- </section>
- <section>
- <title>Details of Usage</title>
- <para>The <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis> component consists of two parts:<itemizedlist>
- <listitem>
- <para>
- <property>List of files</property> which
- contains the list of currently chosen
- files to upload with possibility to
- manage every file </para>
- </listitem>
- <listitem>
- <para>
- <property>Component controls</property>
- - the bar with controls for managing the
- whole component </para>
- </listitem>
- </itemizedlist>
- </para>
+ </section>
+ <section>
+ <title>Details of Usage</title>
+ <para>The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component consists of two parts:<itemizedlist>
+ <listitem>
+ <para>
+ <property>List of files</property> which contains the list of currently
+ chosen files to upload with possibility to manage every file </para>
+ </listitem>
+ <listitem>
+ <para>
+ <property>Component controls</property> - the bar with controls for managing
+ the whole component </para>
+ </listitem>
+ </itemizedlist>
+ </para>
- <para> There are two places where uploaded files are stored: </para>
- <itemizedlist>
- <listitem>
- <para> In the temporary folder (depends on OS) if the value
- of the <code>createTempFile</code> parameter in
- <property>Ajax4jsf Filter</property>
- section is "true" (by Default) </para>
- <programlisting role="XML"><![CDATA[...
+ <para> There are two places where uploaded files are stored: </para>
+ <itemizedlist>
+ <listitem>
+ <para> In the temporary folder (depends on OS) if the value of the
+ <code>createTempFile</code> parameter in <property>Ajax4jsf
+ Filter</property> section is "true" (by Default) </para>
+ <programlisting role="XML"><![CDATA[...
<init-param>
<param-name>createTempFiles</param-name>
<param-value>true</param-value>
</init-param>
...]]></programlisting>
- </listitem>
- <listitem>
- <para> In the RAM if the value of the
- <code>createTempFile</code> parameter in
- <property>Ajax4jsf Filter</property>
- section is "false". This is a
- better way for storing small-sized files. </para>
- </listitem>
- </itemizedlist>
+ </listitem>
+ <listitem>
+ <para> In the RAM if the value of the <code>createTempFile</code> parameter in
+ <property>Ajax4jsf Filter</property> section is "false".
+ This is a better way for storing small-sized files. </para>
+ </listitem>
+ </itemizedlist>
- <para> The <emphasis>
- <property>"uploadData"</property>
- </emphasis> attribute defines the collection of files uploaded. See
- the example below. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para> The <emphasis>
+ <property>"uploadData"</property>
+ </emphasis> attribute defines the collection of files uploaded. See the example below. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload uploadData="#{bean.data}"/>
...]]></programlisting>
- <para>The <emphasis>
- <property>"fileUploadedListener"</property>
- </emphasis> is called at server side after every file uploaded and
- used for the saving files from temporary folder or RAM. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para>The <emphasis>
+ <property>"fileUploadedListener"</property>
+ </emphasis> is called at server side after every file uploaded and used for the saving
+ files from temporary folder or RAM. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload uploadData="#{bean.data}" fileUploadListener="#{bean.listener}"/>
...]]></programlisting>
- <para>
- The following methods of processing the uploaded files are:
- </para>
- <itemizedlist>
- <listitem>
- <para>
- <code>isMultiUpload()</code>. It returns "true" if several files have been uploaded
- </para>
- </listitem>
- <listitem>
- <para>
- <code>getUploadItems()</code>. It returns the list of the uploaded files.
- If one file was uploaded, the <code>getUploadItems()</code> method will return the list consisting of one file
- </para>
- </listitem>
- <listitem>
- <para>
- <code>getUploadItem()</code>. It returns the whole list in case of uploading one file only. If several files were uploaded, the <code>getUploadItem()</code> method will return the first element of the uploaded files list.
- </para>
- </listitem>
- </itemizedlist>
- <para> Automatically files uploading could be performed by means of the <emphasis>
- <property> "immediateUpload"</property>
- </emphasis> attribute. If the value of this attribute is
- "true" files are uploaded automatically once they
- have been added into the list. All next files in the list are uploaded
- automatically one by one. If you cancel uploading process next files
- aren't started to upload till you press the
- "Upload" button or clear the list. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para> The following methods of processing the uploaded files are: </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <code>isMultiUpload()</code>. It returns "true" if several
+ files have been uploaded </para>
+ </listitem>
+ <listitem>
+ <para>
+ <code>getUploadItems()</code>. It returns the list of the uploaded files. If one
+ file was uploaded, the <code>getUploadItems()</code> method will return the list
+ consisting of one file </para>
+ </listitem>
+ <listitem>
+ <para>
+ <code>getUploadItem()</code>. It returns the whole list in case of uploading one
+ file only. If several files were uploaded, the <code>getUploadItem()</code>
+ method will return the first element of the uploaded files list. </para>
+ </listitem>
+ </itemizedlist>
+ <para> Automatically files uploading could be performed by means of the <emphasis>
+ <property> "immediateUpload"</property>
+ </emphasis> attribute. If the value of this attribute is "true" files
+ are uploaded automatically once they have been added into the list. All next files in
+ the list are uploaded automatically one by one. If you cancel uploading process next
+ files aren't started to upload till you press the "Upload"
+ button or clear the list. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload uploadData="#{bean.data}" fileUploadListener="#{bean.listener}" immediateUpload="true"/>
...]]></programlisting>
- <para> The <emphasis>
- <property> "autoclear"</property>
- </emphasis> attribute is used to remove automatically files from the
- list after upload completed. See the simple example below. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para> The <emphasis>
+ <property> "autoclear"</property>
+ </emphasis> attribute is used to remove automatically files from the list after upload
+ completed. See the simple example below. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload uploadData="#{bean.data}" autoclear="true"/>
...]]></programlisting>
+ <para> Each file in list waiting for upload has link "Cancel" opposite its name.
+ Clicking this link invokes JS API <code>remove()</code> function, which gets <code>$('id').component.entries[i]</code> as a parameter
+ and removes the particular file from list and from the queue for upload.
+ After a file has been uploaded the link "Cancel" changes to "Clear".
+ Clicking "Clear" invokes <code>clear()</code> JS API function, which also gets ID of the particular entry and removes it from the list.
+ Uploaded to server file itself is kept untouched.
+ </para>
+ <!--RESTRICTIONS-->
- <!--RESTRICTIONS-->
-
- <para> The <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis> component provides following restrictions: </para>
- <itemizedlist>
- <listitem>
- <para> On <property> file types</property>, use <emphasis>
- <property>
- "acceptedTypes"</property>
- </emphasis> attribute to define file types
- accepted by component. In the example below only
- files with "html" and
- "jpg" extensions are accepted to
- upload. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para> The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component provides following restrictions: </para>
+ <itemizedlist>
+ <listitem>
+ <para> On <property> file types</property>, use <emphasis>
+ <property> "acceptedTypes"</property>
+ </emphasis> attribute to define file types accepted by component. In the example
+ below only files with "html" and "jpg"
+ extensions are accepted to upload. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload acceptedTypes="html, jpg"/>
...]]></programlisting>
- </listitem>
- <listitem>
- <para> On <property> file size</property>, use the
- <code>maxRequestSize</code>
- parameter(value in bytes) inside
- <property>Ajax4jsf Filter</property>
- section in <property>web.xml</property>: </para>
- <programlisting role="XML"><![CDATA[...
+ </listitem>
+ <listitem>
+ <para> On <property> file size</property>, use the <code>maxRequestSize</code>
+ parameter(value in bytes) inside <property>Ajax4jsf Filter</property> section in
+ <property>web.xml</property>: </para>
+ <programlisting role="XML"><![CDATA[...
<init-param>
<param-name>maxRequestSize</param-name>
<param-value>1000000</param-value>
</init-param>
...]]></programlisting>
- </listitem>
- <listitem>
- <para> On <property>max files quantity</property>, use the <emphasis>
- <property>
- "maxFilesQuantity"</property>
- </emphasis> attribute to define max number of
- files allowed to be uploaded. After a number of
- files in the list equals to the value of this
- attribute "Add" button is
- disabled and nothing could be uploaded even if you
- clear the whole list. In order to upload files
- again you should rerender the component. As it
- could be seen in the example below, only 2 files
- are accepted for uploading. </para>
+ </listitem>
+ <listitem>
+ <para> On <property>max files quantity</property>, use the <emphasis>
+ <property> "maxFilesQuantity"</property>
+ </emphasis> attribute to define max number of files allowed to be uploaded.
+ After a number of files in the list equals to the value of this attribute
+ "Add" button is disabled and nothing could be uploaded even if
+ you clear the whole list. In order to upload files again you should rerender the
+ component. As it could be seen in the example below, only 2 files are accepted
+ for uploading. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload maxFilesQuantity="2"/>
...]]></programlisting>
- <para> This is the result: </para>
- <figure>
- <title><emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis>with <emphasis>
- <property>
- "maxFilesQuantity"</property>
- </emphasis> attribute</title>
- <mediaobject>
- <imageobject>
- <imagedata
- fileref="images/fileUpload2.png"
- />
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
+ <para> This is the result: </para>
+ <figure>
+ <title><emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis>with <emphasis>
+ <property> "maxFilesQuantity"</property>
+ </emphasis> attribute</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
- <para id="fileUploadEventAttributes">The <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis> component provides a number of specific event attributes: </para>
- <itemizedlist>
+ <para id="fileUploadEventAttributes">The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component provides a number of specific event attributes: </para>
+ <itemizedlist>
- <listitem>
- <para> The <emphasis>
- <property>
- "onadd"</property>
- </emphasis>a event handler called on an add file
- operation </para>
- </listitem>
+ <listitem>
+ <para> The <emphasis>
+ <property> "onadd"</property>
+ </emphasis>a event handler called on an add file operation </para>
+ </listitem>
- <listitem>
- <para> The <emphasis>
- <property>
- "onupload"</property>
- </emphasis> which gives you a possibility to
- cancel the upload at client side </para>
- </listitem>
- <listitem>
- <para> The <emphasis>
- <property>
- "onuploadcomplete"</property>
- </emphasis> which is called after all files from
- the list are uploaded </para>
- </listitem>
- <listitem>
- <para> The <emphasis>
- <property>
- "onuploadcanceled"</property>
- </emphasis> which is called after upload has been
- canceled via cancel control </para>
- </listitem>
- <listitem>
- <para> The <emphasis>
- <property>
- "onerror"</property>
- </emphasis> which is called if the file upload was
- interrupted according to any errors </para>
- </listitem>
- </itemizedlist>
+ <listitem>
+ <para> The <emphasis>
+ <property> "onupload"</property>
+ </emphasis> which gives you a possibility to cancel the upload at client side
+ </para>
+ </listitem>
+ <listitem>
+ <para> The <emphasis>
+ <property> "onuploadcomplete"</property>
+ </emphasis> which is called after all files from the list are uploaded </para>
+ </listitem>
+ <listitem>
+ <para> The <emphasis>
+ <property> "onuploadcanceled"</property>
+ </emphasis> which is called after upload has been canceled via cancel control
+ </para>
+ </listitem>
+ <listitem>
+ <para> The <emphasis>
+ <property> "onerror"</property>
+ </emphasis> which is called if the file upload was interrupted according to any
+ errors </para>
+ </listitem>
+ </itemizedlist>
- <!--Flash Module-->
- <para> The <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis> component has an embedded Flash module that adds extra
- functionality to the component. The module is enabled with <emphasis>
- <property> "allowFlash"</property>
- </emphasis> attribute set to "true". </para>
- <para>These are the additional features that the Flash module provides:</para>
+ <!--Flash Module-->
+ <para> The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component has an embedded Flash module that adds extra functionality to the
+ component. The module is enabled with <emphasis>
+ <property> "allowFlash"</property>
+ </emphasis> attribute set to "true". </para>
+ <para>These are the additional features that the Flash module provides:</para>
- <itemizedlist>
- <listitem>
- <para>Multiple files choosing;</para>
- </listitem>
- <listitem>
- <para>Permitted file types are specified in the
- "Open File" dialog
- window;</para>
- </listitem>
- <listitem>
- <para>A number of additional entry object properties are
- also available, which can be found <link
- linkend="objectProperties">here</link>.
- </para>
- </listitem>
- </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>Multiple files choosing;</para>
+ </listitem>
+ <listitem>
+ <para>Permitted file types are specified in the "Open File" dialog
+ window;</para>
+ </listitem>
+ <listitem>
+ <para>A number of additional entry object properties are also available, which can
+ be found <link linkend="objectProperties">here</link>. </para>
+ </listitem>
+ </itemizedlist>
- <para>Apart from uploading files to the sever without using AJAX, the Flash
- module provides a number of useful API functions that can be used to
- obtain information about the uploaded file. </para>
+ <para>Apart from uploading files to the sever without using AJAX, the Flash module provides
+ a number of useful API functions that can be used to obtain information about the
+ uploaded file. </para>
- <para>There are 2 ways to obtain the data stored in the FileUploadEntry object. </para>
+ <para>There are 2 ways to obtain the data stored in the FileUploadEntry object. </para>
- <itemizedlist>
- <listitem>
- <para>By means of JavaScript on the client side. Use the
- following syntax for that
- <code>entries[i].propertyName</code>.
- For example <code>entries[0].state</code> will
- return the state of the file the is being
- processed or has just been processed.</para>
- </listitem>
+ <itemizedlist>
+ <listitem>
+ <para>By means of JavaScript on the client side. Use the following syntax for that
+ <code>entries[i].propertyName</code>. For example
+ <code>entries[0].state</code> will return the state of the file the is being
+ processed or has just been processed.</para>
+ </listitem>
- <listitem>
- <para>The properties of <code>FileUploadEntry</code> object
- can be retrieved using the
- <code>entry.propertyName</code>
- expression in the specific event attributes. For
- example,
- <code>onupload="alert(event.memo.entry.fileName);"
- </code> will display a message with the name of
- the file at the very moment when upload operation
- starts. A full list of properties can be found
- <link
- linkend="objectPropertiesWithAttributes"
- >here</link>.</para>
- </listitem>
+ <listitem>
+ <para>The properties of <code>FileUploadEntry</code> object can be retrieved using
+ the <code>entry.propertyName</code> expression in the specific event attributes.
+ For example,
+ <code>onupload="alert(event.memo.entry.fileName);" </code>
+ will display a message with the name of the file at the very moment when upload
+ operation starts. A full list of properties can be found <link
+ linkend="objectPropertiesWithAttributes">here</link>.</para>
+ </listitem>
- </itemizedlist>
- <para>The given bellow code sample demonstrates how the properties can be used.
- Please study it carefully. </para>
- <programlisting role="XML"><![CDATA[...
+ </itemizedlist>
+ <para>The given bellow code sample demonstrates how the properties can be used. Please study
+ it carefully. </para>
+ <programlisting role="XML"><![CDATA[...
<head>
<script>
function _onaddHandler (e) {
@@ -379,61 +347,53 @@
- <para> Moreover, embedded Flash module provides a smoother representation of
- progress bar during the uploading process: the polling is performed is
- not by AJAX, but my means of the flash module. </para>
- <figure>
- <title> Uploading using Flash module <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis>
- </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/flash_fileUpload.png"/>
- </imageobject>
- </mediaobject>
- </figure>
+ <para> Moreover, embedded Flash module provides a smoother representation of progress bar
+ during the uploading process: the polling is performed is not by AJAX, but my means of
+ the flash module. </para>
+ <figure>
+ <title> Uploading using Flash module <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis>
+ </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/flash_fileUpload.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
- <para>However, the Flash module doens't perform any visual
- representation of the component.</para>
+ <para>However, the Flash module doens't perform any visual representation of the
+ component.</para>
- <!--End of Flash Module-->
+ <!--End of Flash Module-->
- <para> In order to customize the information regarding the ongoing process you
- could use <emphasis>
- <property>"label"</property>
- </emphasis> facet with the following macrosubstitution: <itemizedlist>
- <listitem>
- <para>
- <code> {B}</code>, <code>{KB}</code>,
- <code>{MB}</code> contains the
- size of file uploaded in bytes,
- kilobytes, megabytes respectively
- </para>
- </listitem>
- <listitem>
- <para>
- <code>{_B}</code>, <code>{_KB}</code>,
- <code>{_MB}</code> contains
- the remain file size to upload in bytes,
- kilobytes, megabytes respectively
- </para>
- </listitem>
- <listitem>
- <para>
- <code>{ss}</code>, <code>{mm}</code>,
- <code>{hh}</code> contains
- elapsed time in seconds, minutes and
- hours respectively </para>
- </listitem>
- </itemizedlist>
+ <para> In order to customize the information regarding the ongoing process you could use <emphasis>
+ <property>"label"</property>
+ </emphasis> facet with the following macrosubstitution: <itemizedlist>
+ <listitem>
+ <para>
+ <code> {B}</code>, <code>{KB}</code>, <code>{MB}</code> contains the size of
+ file uploaded in bytes, kilobytes, megabytes respectively </para>
+ </listitem>
+ <listitem>
+ <para>
+ <code>{_B}</code>, <code>{_KB}</code>, <code>{_MB}</code> contains the
+ remain file size to upload in bytes, kilobytes, megabytes respectively
</para>
+ </listitem>
+ <listitem>
+ <para>
+ <code>{ss}</code>, <code>{mm}</code>, <code>{hh}</code> contains elapsed
+ time in seconds, minutes and hours respectively </para>
+ </listitem>
+ </itemizedlist>
+ </para>
- <!--
+ <!--
There is a number of facets providing for this component:
<emphasis>
<property> "header"</property></emphasis>
@@ -444,134 +404,127 @@
<property> "label"</property></emphasis>. could be used to provide displaying the progress of uploading.
-->
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload uploadData="#{bean.data}" fileUploadListener="#{bean.listener}">
<f:facet name="label">
<h:outputText value="{_KB}KB from {KB}KB uploaded --- {mm}:{ss}" />
</f:facet>
</rich:fileUpload>
...]]></programlisting>
- <para>This is the result:</para>
- <figure>
- <title>
- <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis> with <emphasis>
- <property> "label"</property>
- </emphasis> facet </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/fileUpload3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
+ <para>This is the result:</para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> with <emphasis>
+ <property> "label"</property>
+ </emphasis> facet </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
- <para>You could define labels of the <property>component controls</property>
- with the help of <emphasis>
- <property> "addControlLabel"</property>
- </emphasis>, <emphasis>
- <property>
- "clearAllControlLabel"</property>
- </emphasis>, <emphasis>
- <property> "clearControlLabel"</property>
- </emphasis>, <emphasis>
- <property>
- "stopEntryControlLabel"</property>
- </emphasis>, <emphasis>
- <property> "uploadControlLabel"</property>
- </emphasis> attributes. See the following example. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para>You could define labels of the <property>component controls</property> with the help
+ of <emphasis>
+ <property> "addControlLabel"</property>
+ </emphasis>, <emphasis>
+ <property> "clearAllControlLabel"</property>
+ </emphasis>, <emphasis>
+ <property> "clearControlLabel"</property>
+ </emphasis>, <emphasis>
+ <property> "stopEntryControlLabel"</property>
+ </emphasis>, <emphasis>
+ <property> "uploadControlLabel"</property>
+ </emphasis> attributes. See the following example. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload addControlLabel="Add file..." clearAllControlLabel="Clear all" clearControlLabel="Clear"
stopEntryControlLabel="Stop process" uploadControlLabel="Upload file"/>
...]]></programlisting>
- <para> This is the result: </para>
- <figure>
- <title>
- <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis> with labels </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/fileUpload4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para> The <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis> component allows to use sizes attributes: </para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>
- <property>
- "listHeight"</property>
- </emphasis> attribute specify height for list of
- files in pixels </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>
- <property>
- "listWidth"</property>
- </emphasis> attribute specify width for list of
- files in pixels </para>
- </listitem>
- </itemizedlist>
+ <para> This is the result: </para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> with labels </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para> The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component allows to use sizes attributes: </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>
+ <property> "listHeight"</property>
+ </emphasis> attribute specify height for list of files in pixels </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>
+ <property> "listWidth"</property>
+ </emphasis> attribute specify width for list of files in pixels </para>
+ </listitem>
+ </itemizedlist>
- <para> In order to disable the whole component you could use the <emphasis>
- <property> "disabled"</property>
- </emphasis> attribute. See the following example. </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para> In order to disable the whole component you could use the <emphasis>
+ <property> "disabled"</property>
+ </emphasis> attribute. See the following example. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload disabled="true"/>
...]]></programlisting>
- <para>This is the result:</para>
- <figure>
- <title>
- <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis>with <emphasis>
- <property> "disabled"</property>
- </emphasis> attribute </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/fileUpload5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>It's possible to handle events for fileUpload using JavaScript
- code. A simplest example of usage JavaScript API is placed below:</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para>This is the result:</para>
+ <figure>
+ <title>
+ <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis>with <emphasis>
+ <property> "disabled"</property>
+ </emphasis> attribute </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/fileUpload5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>It's possible to handle events for fileUpload using JavaScript code. A
+ simplest example of usage JavaScript API is placed below:</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload id="upload" disabled="false"/>
<h:commandButton onclick="${rich:component('upload')}.disable();" value="Disable" />
...]]></programlisting>
- <para>
- <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis> component also provides a number of JavaScript property,
- that can be used to process uploaded files, file states etc. The given
- below example illustrates how the <code>entries[0].state</code>
- property can be used to get access to the file state. Full list of
- JavaScript properties can be found <link linkend="objectProperties"
- >below</link>. </para>
+ <para>
+ <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component also provides a number of JavaScript property, that can be used to
+ process uploaded files, file states etc. The given below example illustrates how the
+ <code>entries[0].state</code> property can be used to get access to the file state.
+ Full list of JavaScript properties can be found <link linkend="objectProperties"
+ >below</link>. </para>
- <programlisting role="XML"><![CDATA[...
+ <programlisting role="XML"><![CDATA[...
<rich:fileUpload fileUploadListener="#{fileUploadBean.listener}"
maxFilesQuantity="#{fileUploadBean.uploadsAvailable}"
- reRender="table" id="upload"
+ id="upload"
immediateUpload="#{fileUploadBean.autoUpload}"
acceptedTypes="jpg, gif, png, bmp">
<a4j:support event="onuploadcomplete" reRender="info" />
@@ -580,1051 +533,834 @@
...]]></programlisting>
- <para>The <emphasis role="bold">
- <property><rich:fileUpload></property>
- </emphasis> component allows to use internationalization method to
- redefine and localize the labels. You could use application resource
- bundle and define <code>RICH_FILE_UPLOAD_CANCEL_LABEL</code>,
- <code>RICH_FILE_UPLOAD_STOP_LABEL</code>,
- <code>RICH_FILE_UPLOAD_ADD_LABEL</code>,
- <code>RICH_FILE_UPLOAD_UPLOAD_LABEL</code>,
- <code>RICH_FILE_UPLOAD_CLEAR_LABEL</code>,
- <code>RICH_FILE_UPLOAD_CLEAR_ALL_LABEL</code>,
- <code>RICH_FILE_UPLOAD_PROGRESS_LABEL</code>,
- <code>RICH_FILE_UPLOAD_SIZE_ERROR_LABLE</code>,
- <code>RICH_FILE_UPLOAD_TRANSFER_ERROR_LABLE</code>,
- <code>RICH_FILE_UPLOAD_ENTRY_STOP_LABEL</code>,
- <code>RICH_FILE_UPLOAD_ENTRY_CLEAR_LABEL</code>,
- <code>RICH_FILE_UPLOAD_ENTRY_CANCEL_LABEL</code> there. </para>
+ <para>The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component allows to use internationalization method to redefine and localize
+ the labels. You could use application resource bundle and define
+ <code>RICH_FILE_UPLOAD_CANCEL_LABEL</code>,
+ <code>RICH_FILE_UPLOAD_STOP_LABEL</code>, <code>RICH_FILE_UPLOAD_ADD_LABEL</code>,
+ <code>RICH_FILE_UPLOAD_UPLOAD_LABEL</code>,
+ <code>RICH_FILE_UPLOAD_CLEAR_LABEL</code>,
+ <code>RICH_FILE_UPLOAD_CLEAR_ALL_LABEL</code>,
+ <code>RICH_FILE_UPLOAD_PROGRESS_LABEL</code>,
+ <code>RICH_FILE_UPLOAD_SIZE_ERROR_LABLE</code>,
+ <code>RICH_FILE_UPLOAD_TRANSFER_ERROR_LABLE</code>,
+ <code>RICH_FILE_UPLOAD_ENTRY_STOP_LABEL</code>,
+ <code>RICH_FILE_UPLOAD_ENTRY_CLEAR_LABEL</code>,
+ <code>RICH_FILE_UPLOAD_ENTRY_CANCEL_LABEL</code> there. </para>
- <para> The <emphasis role="bold"><property><rich:fileUpload></property></emphasis> component could work together with Seam framework.
- <ulink url="http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/...">Here</ulink>
- you can see how to configure filter for this framework in web.xml file in order to handle <emphasis role="bold"><property><rich:fileUpload></property></emphasis> requests.
- </para>
- <para>To make <property><rich:fileUpload></property> component work properly with MyFaces extensions,
- the order in which filters are defined and mapped in web.xml, is important.
- See <ulink url="http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/...">corresponding FAQ chapter</ulink>.
- </para>
+ <para> The <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> component could work together with Seam framework. <ulink
+ url="http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/..."
+ >Here</ulink> you can see how to configure filter for this framework in web.xml file
+ in order to handle <emphasis role="bold">
+ <property><rich:fileUpload></property>
+ </emphasis> requests. </para>
+ <para>To make <property><rich:fileUpload></property> component work properly
+ with MyFaces extensions, the order in which filters are defined and mapped in web.xml,
+ is important. See <ulink
+ url="http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/..."
+ >corresponding FAQ chapter</ulink>. </para>
- </section>
- <!-- 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>
+ <!-- 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>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>
+ <row>
+ <entry>clear()</entry>
+ <entry>Removes all files from the list. The function can also get the <code>$('id').component.entries[i]</code> as a parameter to remove a particular file.</entry>
+ </row>
- <table id="objectProperties">
- <title>Client side object properties</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Property</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
+ <row>
+ <entry>disable()</entry>
+ <entry>Disables the component</entry>
+ </row>
- <row>
- <entry>entries</entry>
- <entry>Returns a array of all files in
- the list </entry>
- </row>
+ <row>
+ <entry>enable()</entry>
+ <entry>Enables the component</entry>
+ </row>
+ <row>
+ <entry>remove()</entry>
+ <entry>Cancels the request for uploading a file by removing this file from
+ upload list and upload queue. Gets <code>$('id').component.entries[i]</code> as a parameter.</entry>
+ </row>
+ <row>
+ <entry>stop()</entry>
+ <entry>Stops the uploading process</entry>
+ </row>
- <row>
- <entry>entries.length</entry>
- <entry>Returns the number of files in
- the list </entry>
- </row>
+ <row>
+ <entry>submitForm()</entry>
+ <entry>Submits form to server. All added files will be put to model and
+ event.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
- <row>
- <entry>entries[i].fileName</entry>
- <entry>Returns the file name, that is
- retrieved by the array index
- </entry>
- </row>
+ <table id="objectProperties">
+ <title>Client side object properties</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Property</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
- <row>
- <entry>entries[i].state </entry>
- <entry>Returns the file state. Possible
- states are <itemizedlist>
+ <row>
+ <entry>entries</entry>
+ <entry>Returns a array of all files in the list </entry>
+ </row>
- <listitem>
- <para>"initialized"
- -
- the
- file
- is
- added,
- corresponds
- to
- FileUploadEntry.INITIALIZED
- constant
- </para>
- </listitem>
- <listitem>
- <para>"progress"
- -
- the
- file
- is
- being
- uploaded,
- corresponds
- to
- FileUploadEntry.UPLOAD_IN_PROGRESS
- constant</para>
- </listitem>
- <listitem>
- <para>"ready"
- -
- uploading
- is
- in
- process,
- corresponds
- to
- FileUploadEntry.READY
- constant
- The
- file
- will
- be
- uploaded
- on
- queue
- order.</para>
- </listitem>
- <listitem>
- <para>"canceled"
- -
- uploading
- of
- the
- file
- is
- canceled,
- corresponds
- to
- FileUploadEntry.UPLOAD_CANCELED
- constant
- </para>
- </listitem>
- <listitem>
- <para>"done"
- -
- the
- file
- is
- uploaded
- successfully,
- corresponds
- to
- FileUploadEntry.UPLOAD_SUCCESS
- constant</para>
- </listitem>
- <listitem>
- <para>"transfer_error"
- -
- a
- file
- transfer
- error
- occurred,
- corresponds
- to
- FileUploadEntry.UPLOAD_TRANSFER_ERROR
- constant
- </para>
- </listitem>
- <listitem>
- <para>"size_error"
- -
- the
- file
- exceeded
- maximum
- size,
- corresponds
- to
- FileUploadEntry.UPLOAD_SIZE_ERROR
- constant</para>
- </listitem>
- </itemizedlist>
- </entry>
- </row>
+ <row>
+ <entry>entries.length</entry>
+ <entry>Returns the number of files in the list </entry>
+ </row>
+ <row>
+ <entry>entries[i].fileName</entry>
+ <entry>Returns the file name, that is retrieved by the array index </entry>
+ </row>
- <row>
- <entry>entries[i].size</entry>
- <entry> Returns the size of the file.
- Available in flash enabled
- version only</entry>
- </row>
- <row>
- <entry>entries[i].Type</entry>
- <entry>Returns the mime type of the
- file. Available in flash
- enabled version only</entry>
- </row>
- <row>
- <entry>entries[i].creator </entry>
- <entry>Returns the name of the author of
- the file. Available in flash
- enabled version only</entry>
- </row>
- <row>
- <entry>entries[i].creationDate</entry>
- <entry>Returns the date when the file
- was created. Available in
- flash enabled version
- only</entry>
- </row>
- <row>
- <entry>entries[i].modificationDate</entry>
- <entry>Returns the date of the last file
- modification. Available in
- flash enabled version
- only</entry>
- </row>
+ <row>
+ <entry>entries[i].state </entry>
+ <entry>Returns the file state. Possible states are <itemizedlist>
+ <listitem>
+ <para>"initialized" - the file is added,
+ corresponds to FileUploadEntry.INITIALIZED constant </para>
+ </listitem>
+ <listitem>
+ <para>"progress" - the file is being uploaded,
+ corresponds to FileUploadEntry.UPLOAD_IN_PROGRESS
+ constant</para>
+ </listitem>
+ <listitem>
+ <para>"ready" - uploading is in process,
+ corresponds to FileUploadEntry.READY constant The file will
+ be uploaded on queue order.</para>
+ </listitem>
+ <listitem>
+ <para>"canceled" - uploading of the file is
+ canceled, corresponds to FileUploadEntry.UPLOAD_CANCELED
+ constant </para>
+ </listitem>
+ <listitem>
+ <para>"done" - the file is uploaded
+ successfully, corresponds to FileUploadEntry.UPLOAD_SUCCESS
+ constant</para>
+ </listitem>
+ <listitem>
+ <para>"transfer_error" - a file transfer error
+ occurred, corresponds to
+ FileUploadEntry.UPLOAD_TRANSFER_ERROR constant </para>
+ </listitem>
+ <listitem>
+ <para>"size_error" - the file exceeded maximum
+ size, corresponds to FileUploadEntry.UPLOAD_SIZE_ERROR
+ constant</para>
+ </listitem>
- </tbody>
- </tgroup>
- </table>
+ </itemizedlist>
+ </entry>
+ </row>
- <table id="objectPropertiesWithAttributes">
- <title>Client side object properties available with specific <link
- linkend="fileUploadEventAttributes"> event
- attributes</link></title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Property</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
+ <row>
+ <entry>entries[i].size</entry>
+ <entry> Returns the size of the file. Available in flash enabled version
+ only</entry>
+ </row>
+ <row>
+ <entry>entries[i].Type</entry>
+ <entry>Returns the mime type of the file. Available in flash enabled version
+ only</entry>
+ </row>
+ <row>
+ <entry>entries[i].creator </entry>
+ <entry>Returns the name of the author of the file. Available in flash
+ enabled version only</entry>
+ </row>
+ <row>
+ <entry>entries[i].creationDate</entry>
+ <entry>Returns the date when the file was created. Available in flash
+ enabled version only</entry>
+ </row>
+ <row>
+ <entry>entries[i].modificationDate</entry>
+ <entry>Returns the date of the last file modification. Available in flash
+ enabled version only</entry>
+ </row>
- <row>
- <entry>entry.state </entry>
- <entry>Returns the file state. Possible
- states are <itemizedlist>
+ </tbody>
+ </tgroup>
+ </table>
- <listitem>
- <para>"initialized"
- -
- the
- file
- is
- added,
- corresponds
- to
- FileUploadEntry.INITIALIZED
- constant
- </para>
- </listitem>
- <listitem>
- <para>"progress"
- -
- the
- file
- is
- being
- uploaded,
- corresponds
- to
- FileUploadEntry.UPLOAD_IN_PROGRESS
- constant</para>
- </listitem>
- <listitem>
- <para>"ready"
- -
- uploading
- is
- in
- process,
- corresponds
- to
- FileUploadEntry.READY
- constant
- The
- file
- will
- be
- uploaded
- on
- queue
- order.</para>
- </listitem>
- <listitem>
- <para>"canceled"
- -
- uploading
- of
- the
- file
- is
- canceled,
- corresponds
- to
- FileUploadEntry.UPLOAD_CANCELED
- constant
- </para>
- </listitem>
- <listitem>
- <para>"done"
- -
- the
- file
- is
- uploaded
- successfully,
- corresponds
- to
- FileUploadEntry.UPLOAD_SUCCESS
- constant</para>
- </listitem>
- <listitem>
- <para>"transfer_error"
- -
- a
- file
- transfer
- error
- occurred,
- corresponds
- to
- FileUploadEntry.UPLOAD_TRANSFER_ERROR
- constant
- </para>
- </listitem>
- <listitem>
- <para>"size_error"
- -
- the
- file
- exceeded
- maximum
- size,
- corresponds
- to
- FileUploadEntry.UPLOAD_SIZE_ERROR
- constant</para>
- </listitem>
- </itemizedlist>
- </entry>
- </row>
- <row>
- <entry>entry.fileName </entry>
- <entry>Returns the file's name.
- This property works with all
- event handlers except for
- "onadd".
- </entry>
- </row>
+ <table id="objectPropertiesWithAttributes">
+ <title>Client side object properties available with specific <link
+ linkend="fileUploadEventAttributes"> event attributes</link></title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Property</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
- <row>
- <entry>entry.size</entry>
- <entry> Returns the size of the file.
- Available in flash enabled
- version only</entry>
- </row>
- <row>
- <entry>entry.Type</entry>
- <entry>Returns the mime type of the
- file. Available in flash
- enabled version only</entry>
- </row>
- <row>
- <entry>entry.creator </entry>
- <entry>Returns the name of the author of
- the file. Available in flash
- enabled version only</entry>
- </row>
- <row>
- <entry>entry.creationDate</entry>
- <entry>Returns the date when the file
- was created. Available in
- flash enabled version
- only</entry>
- </row>
- <row>
- <entry>entry.modificationDate</entry>
- <entry>Returns the date of the last file
- modification. Available in
- flash enabled version
- only</entry>
- </row>
+ <row>
+ <entry>entry.state </entry>
+ <entry>Returns the file state. Possible states are <itemizedlist>
+ <listitem>
+ <para>"initialized" - the file is added,
+ corresponds to FileUploadEntry.INITIALIZED constant </para>
+ </listitem>
+ <listitem>
+ <para>"progress" - the file is being uploaded,
+ corresponds to FileUploadEntry.UPLOAD_IN_PROGRESS
+ constant</para>
+ </listitem>
+ <listitem>
+ <para>"ready" - uploading is in process,
+ corresponds to FileUploadEntry.READY constant The file will
+ be uploaded on queue order.</para>
+ </listitem>
+ <listitem>
+ <para>"canceled" - uploading of the file is
+ canceled, corresponds to FileUploadEntry.UPLOAD_CANCELED
+ constant </para>
+ </listitem>
+ <listitem>
+ <para>"done" - the file is uploaded
+ successfully, corresponds to FileUploadEntry.UPLOAD_SUCCESS
+ constant</para>
+ </listitem>
+ <listitem>
+ <para>"transfer_error" - a file transfer error
+ occurred, corresponds to
+ FileUploadEntry.UPLOAD_TRANSFER_ERROR constant </para>
+ </listitem>
+ <listitem>
+ <para>"size_error" - the file exceeded maximum
+ size, corresponds to FileUploadEntry.UPLOAD_SIZE_ERROR
+ constant</para>
+ </listitem>
- </tbody>
- </tgroup>
- </table>
+ </itemizedlist>
+ </entry>
+ </row>
+ <row>
+ <entry>entry.fileName </entry>
+ <entry>Returns the file's name. This property works with all event
+ handlers except for "onadd". </entry>
+ </row>
- </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>
+ <row>
+ <entry>entry.size</entry>
+ <entry> Returns the size of the file. Available in flash enabled version
+ only</entry>
+ </row>
+ <row>
+ <entry>entry.Type</entry>
+ <entry>Returns the mime type of the file. Available in flash enabled version
+ only</entry>
+ </row>
+ <row>
+ <entry>entry.creator </entry>
+ <entry>Returns the name of the author of the file. Available in flash
+ enabled version only</entry>
+ </row>
+ <row>
+ <entry>entry.creationDate</entry>
+ <entry>Returns the date when the file was created. Available in flash
+ enabled version only</entry>
+ </row>
+ <row>
+ <entry>entry.modificationDate</entry>
+ <entry>Returns the date of the last file modification. Available in flash
+ enabled version only</entry>
+ </row>
- <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>
+ </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>
+ </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>
- <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>
+ <section>
+ <title>Skin Parameters Redefinition</title>
- <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>
+ <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>
- <section>
- <title>Definition of Custom Style Classes</title>
+ <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>
- <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>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>
- <table id="fileUploadCN">
- <title>Classes names that define a component representation</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>rich-fileupload-list-decor</entry>
- <entry>Defines styles for a wrapper
- <div> element of
- a fileUpload</entry>
- </row>
- <row>
- <entry>rich-fileupload-font</entry>
- <entry>Defines styles for a font of
- buttons and items</entry>
- </row>
- <row>
- <entry>rich-fileupload-toolbar-decor</entry>
- <entry>Defines styles for a
- toolbar</entry>
- </row>
- <row>
- <entry> rich-fileupload-list-overflow</entry>
- <entry>Defines styles for a list of
- files</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ </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>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>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>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>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>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>
+ <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>
- <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[...
+ <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 id="fileUploadCN">
+ <title>Classes names that define a component representation</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-fileupload-list-decor</entry>
+ <entry>Defines styles for a wrapper <div> element of a
+ fileUpload</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-font</entry>
+ <entry>Defines styles for a font of buttons and items</entry>
+ </row>
+ <row>
+ <entry>rich-fileupload-toolbar-decor</entry>
+ <entry>Defines styles for a toolbar</entry>
+ </row>
+ <row>
+ <entry> rich-fileupload-list-overflow</entry>
+ <entry>Defines styles for a list of files</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <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>
+ <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>
+ <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>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[...
+ <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"/>
+ <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>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>
+ <para>As it could be seen on the picture above, the font style for "Add"
+ button is changed.</para>
- </section>
+ </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>
+ <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-->
17 years, 6 months
JBoss Rich Faces SVN: r11528 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 12:25:50 -0500 (Wed, 03 Dec 2008)
New Revision: 11528
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 17:19:40 UTC (rev 11527)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 17:25:50 UTC (rev 11528)
@@ -65,7 +65,7 @@
<snapshots>
<enabled>true</enabled>
</snapshots>
- <id>repository.jboss.org</id>
+ <id>snapshots.jboss.org</id>
<url>http://snapshots.jboss.org/maven2</url>
</repository>
</repositories>
17 years, 6 months
JBoss Rich Faces SVN: r11527 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 12:19:40 -0500 (Wed, 03 Dec 2008)
New Revision: 11527
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 17:11:19 UTC (rev 11526)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 17:19:40 UTC (rev 11527)
@@ -38,12 +38,11 @@
</releases>
</repository>
<repository>
+ <releases />
<snapshots>
- <enabled>true</enabled>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
</snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
<id>maven-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/1</url>
@@ -51,6 +50,7 @@
</repository>
<repository>
+ <releases />
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
@@ -58,6 +58,16 @@
<id>repository.jboss.org</id>
<url>http://repository.jboss.org/maven2</url>
</repository>
+ <repository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <id>repository.jboss.org</id>
+ <url>http://snapshots.jboss.org/maven2</url>
+ </repository>
</repositories>
<build>
<plugins>
17 years, 6 months
JBoss Rich Faces SVN: r11526 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 12:11:19 -0500 (Wed, 03 Dec 2008)
New Revision: 11526
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 16:16:09 UTC (rev 11525)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 17:11:19 UTC (rev 11526)
@@ -38,11 +38,12 @@
</releases>
</repository>
<repository>
- <releases />
<snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
+ <enabled>true</enabled>
</snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
<id>maven-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/1</url>
@@ -50,7 +51,6 @@
</repository>
<repository>
- <releases />
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
17 years, 6 months
JBoss Rich Faces SVN: r11525 - trunk/test-applications/facelets/src/main/webapp/DataScroller.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-03 11:16:09 -0500 (Wed, 03 Dec 2008)
New Revision: 11525
Modified:
trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScrollerProperty.xhtml
Log:
remove findComponent form page
Modified: trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScrollerProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScrollerProperty.xhtml 2008-12-03 16:15:23 UTC (rev 11524)
+++ trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScrollerProperty.xhtml 2008-12-03 16:16:09 UTC (rev 11525)
@@ -62,16 +62,5 @@
<h:selectBooleanCheckbox value="#{dataScroller.selfSorted}">
<a4j:support event="onchange" reRender="dataTableId,dsID"></a4j:support>
</h:selectBooleanCheckbox>
- </h:panelGrid>
- <br />
- <br />
- <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
- <h:panelGrid columns="2">
- <rich:column>
- <a4j:commandLink value="getPage" reRender="findID"></a4j:commandLink>
- </rich:column>
- <rich:column>
- <h:outputText id="findID" value="#{rich:findComponent('dsID').page}" />
- </rich:column>
- </h:panelGrid>
+ </h:panelGrid>
</f:subview>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r11524 - trunk/test-applications/facelets/src/main/webapp/DataScroller.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-03 11:15:23 -0500 (Wed, 03 Dec 2008)
New Revision: 11524
Modified:
trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml
Log:
correction
Modified: trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml 2008-12-03 16:10:46 UTC (rev 11523)
+++ trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml 2008-12-03 16:15:23 UTC (rev 11524)
@@ -21,13 +21,13 @@
binding="#{dataScroller.htmlDatascroller}">
</rich:datascroller>
</f:facet>
- <rich:column sortBy="#{dT.data0}" filterBy="#{dT.data0}" filterEvent="onchange"
+ <rich:column sortBy="#{dT.str0}" filterBy="#{dT.str0}" filterEvent="onchange"
selfSorted="#{dataScroller.selfSorted}" sortOrder="#{dataScroller.sortOrder}" filterValue="#{dataScroller.filterValue}">
- <h:outputText value="#{dT.data0}" />
+ <h:outputText value="#{dT.str0}" />
</rich:column>
- <rich:column sortBy="#{dT.data1}" filterBy="#{dT.data1}" filterEvent="onchange"
+ <rich:column sortBy="#{dT.int0}" filterBy="#{dT.int0}" filterEvent="onchange"
sortOrder="#{dataScroller.sortOrder}">
- <h:outputText value="#{dT.data1} " />
+ <h:outputText value="#{dT.int0} " />
</rich:column>
</rich:dataTable>
<h:panelGrid id="dataScrollerActionID" columns="1">
17 years, 6 months
JBoss Rich Faces SVN: r11523 - trunk/test-applications/facelets/src/main/webapp/DataScroller.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-12-03 11:10:46 -0500 (Wed, 03 Dec 2008)
New Revision: 11523
Modified:
trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml
Log:
htmlDatascroller binding attribute
Modified: trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml 2008-12-03 15:09:42 UTC (rev 11522)
+++ trunk/test-applications/facelets/src/main/webapp/DataScroller/DataScroller.xhtml 2008-12-03 16:10:46 UTC (rev 11523)
@@ -3,7 +3,7 @@
<rich:dataTable id="dataTableId" value="#{dataScroller.dataTable}" sortMode="#{dataScroller.sortMode}"
var="dT" cellpadding="5px" rows="5" border="1" reRender="dsID">
<f:facet name="header">
- <rich:datascroller inactiveStyle="#{style.inactiveStyle}" inactiveStyleClass="#{style.inactiveStyleClass}"
+ <rich:datascroller inactiveStyle="test" inactiveStyleClass="#{style.inactiveStyleClass}"
selectedStyle="#{style.selectedStyle}" selectedStyleClass="#{style.selectedStyleClass}" style="#{style.style}"
styleClass="#{style.styleClass}" tableStyle="#{style.tableStyle}" tableStyleClass="#{style.tableStyleClass}"
fastControls="#{dataScroller.fastControls}" action="#{dataScroller.act}" actionListener="#{dataScroller.actListener}"
@@ -18,7 +18,7 @@
onmousedown="#{event.onmousedown}"
onmousemove="#{event.onmousemove}" onmouseout="#{event.onmouseout}"
onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}" id="dsID"
- binding="#{dataScroller.htmlDataScroller}">
+ binding="#{dataScroller.htmlDatascroller}">
</rich:datascroller>
</f:facet>
<rich:column sortBy="#{dT.data0}" filterBy="#{dT.data0}" filterEvent="onchange"
17 years, 6 months
JBoss Rich Faces SVN: r11522 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-03 10:09:42 -0500 (Wed, 03 Dec 2008)
New Revision: 11522
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
RF-5150
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-03 14:47:47 UTC (rev 11521)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-03 15:09:42 UTC (rev 11522)
@@ -39,10 +39,12 @@
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 calendarFooterId;
String ajaxSubmitId;
@@ -53,15 +55,31 @@
String resetActionId;
String testClientModeId;
+
+ String timeSelectionXpath;
+
+ String timeHoursSelectionId;
+
+ String timeMinutesSelectionId;
+
+ String timeSelectionOkButtonId;
+
+ String timeSelectionCancelButtonId;
void initIds(String parentId) {
calendarId = parentId + FORM_ID + "calendar";
calendarHeaderId = calendarId + "Header";
+ calendarFooterId = calendarId + "Footer";
+ timeSelectionXpath = "//td[@id='"+calendarFooterId+"']/table/tbody/tr/td[3]/div";
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";
+ timeHoursSelectionId = calendarId + "TimeHours";
+ timeMinutesSelectionId = calendarId + "TimeMinutes";
+ timeSelectionOkButtonId = calendarId + "TimeEditorButtonOk";
+ timeSelectionCancelButtonId = calendarId + "TimeEditorButtonCancel";
}
String getStatus() {
@@ -107,8 +125,60 @@
void switchToClientMode() {
clickCommandAndWait(testClientModeId);
}
+
+ void showTimeSelectionWindow() {
+ selenium.click(timeSelectionXpath);
+ }
+
+ @Test
+ public void testTimeSelection(Template template) {
+ renderPage(template, RESET_METHOD);
+ initIds(getParentId());
+
+
+ // Test time selection appearing
+ showTimeSelectionWindow();
+ AssertVisible(calendarId + "TimeEditorLayout", "Time selection dialog was not opened");
+ AssertVisible(timeHoursSelectionId, "'Hour' input was not displayed");
+ AssertVisible(timeMinutesSelectionId, "'Minutes' input was not displayed");
+ AssertVisible(timeSelectionOkButtonId, "Time selection 'OK' button was not displayed");
+ AssertVisible(timeSelectionCancelButtonId, "Time selection 'Cancel' button was not displayed");
+
+ // Test time selection applying
+ setValueById(timeHoursSelectionId, "10");
+ setValueById(timeMinutesSelectionId, "00");
+ clickById(timeSelectionOkButtonId);
+ AssertNotVisible(calendarId + "TimeEditorLayout", "Time selection dialog was not hidden after 'Ok' button clicked");
+
+ String time = selenium.getText(timeSelectionXpath);
+ if (!"10:00".equals(time)) {
+ Assert.fail("Time selected has not been applied. Expected [10:00]. But was + [" + time+ "]");
+ }
+
+ // Test time cancel button
+ showTimeSelectionWindow();
+
+ setValueById(timeHoursSelectionId, "18");
+ setValueById(timeMinutesSelectionId, "50");
+ clickById(timeSelectionCancelButtonId);
+ AssertNotVisible(calendarId + "TimeEditorLayout", "Time selection dialog was not hidden after 'Cancel' button clicked");
+
+ time = selenium.getText(timeSelectionXpath);
+ if (!"10:00".equals(time)) {
+ Assert.fail("Time applied after cancel button clicked. Expected [10:00]. But was + [" + time+ "]");
+ }
+
+ // Test time applying in server side
+
+ clickCommandAndWait(serverSubmitId);
+ time = selenium.getText(timeSelectionXpath);
+ if (!"10:00".equals(time)) {
+ Assert.fail("Time was not applied on server side. Expected [10:00]. But was + [" + time+ "]");
+ }
+
+ }
- @Test
+ //@Test
public void testListenersInAjaxMode(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
@@ -127,7 +197,7 @@
}
- @Test
+ //@Test
public void testListenersInClientMode(Template template) {
renderPage(template, RESET_METHOD);
initIds(getParentId());
17 years, 6 months
JBoss Rich Faces SVN: r11521 - in trunk/ui/core/src: test/java/org/ajax4jsf/renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-03 09:47:47 -0500 (Wed, 03 Dec 2008)
New Revision: 11521
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRenderer.java
trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRendererTest.java
Log:
https://jira.jboss.org/jira/browse/RF-4812
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRenderer.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRenderer.java 2008-12-03 14:41:13 UTC (rev 11520)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRenderer.java 2008-12-03 14:47:47 UTC (rev 11521)
@@ -36,9 +36,11 @@
import javax.faces.event.ActionEvent;
import org.ajax4jsf.Messages;
+import org.ajax4jsf.javascript.AjaxScript;
import org.ajax4jsf.javascript.JSFunction;
-import org.ajax4jsf.renderkit.RendererBase;
+import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.resource.InternetResource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -49,14 +51,20 @@
* @author shura
*
*/
-public class HtmlCommandLinkRenderer extends RendererBase {
+public class HtmlCommandLinkRenderer extends HeaderResourcesRendererBase {
private static final Log _log = LogFactory.getLog(HtmlCommandLinkRenderer.class);
private static final String[] LINK_EXCLUSIONS = {"onclick","target","href"};
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+
+ private InternetResource[] scripts = null;
+ private static final String FORM_SCRIPT = "/org/ajax4jsf/javascript/scripts/form.js";
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent)
*/
protected void doDecode(FacesContext context, UIComponent component) {
UIForm form = getUtils().getNestingForm(context,component);
@@ -216,4 +224,15 @@
writer.writeText(valueString,null);
}
}
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.renderkit.HeaderResourcesRendererBase#getScripts()
+ */
+ protected InternetResource[] getScripts() {
+ if (scripts == null) {
+ scripts = new InternetResource[1];
+ scripts[0] = getResource(FORM_SCRIPT);
+ }
+ return scripts;
+ }
}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRendererTest.java 2008-12-03 14:41:13 UTC (rev 11520)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRendererTest.java 2008-12-03 14:47:47 UTC (rev 11521)
@@ -21,16 +21,30 @@
package org.ajax4jsf.renderkit.html;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
import javax.faces.component.UIForm;
import javax.faces.component.html.HtmlCommandLink;
import javax.faces.component.html.HtmlForm;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
public class HtmlCommandLinkRendererTest extends AbstractAjax4JsfTestCase {
+ /** Set with required javascripts for Editor */
+ private static Set<String> javaScripts = new HashSet<String>();
+
+ static {
+ javaScripts.add("org/ajax4jsf/javascript/scripts/form.js");
+ }
+
private UIForm form = null;
private HtmlCommandLink link1 = null;
private HtmlCommandLink link2 = null;
@@ -92,5 +106,34 @@
assertNotNull(disabled);
assertEquals("disabled", disabled);
}
+
+ /**
+ * Method to test if required scripts is present on page
+ * @throws Exception
+ */
+ @SuppressWarnings("unchecked")
+ public void testLinkScripts() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ List scripts = page.getDocumentHtmlElement().getHtmlElementsByTagName(
+ "script");
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ String src = (String) srcIt.next();
+ found = srcAttr.contains(src);
+ if (found) {
+ break;
+ }
+ }
+ assertTrue(found);
+ }
+ }
+ }
+
}
17 years, 6 months
JBoss Rich Faces SVN: r11520 - in trunk/ui/inplaceSelect/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-03 09:41:13 -0500 (Wed, 03 Dec 2008)
New Revision: 11520
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
https://jira.jboss.org/jira/browse/RF-3233
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-12-03 14:40:36 UTC (rev 11519)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2008-12-03 14:41:13 UTC (rev 11520)
@@ -27,7 +27,6 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
import javax.faces.model.SelectItem;
import org.ajax4jsf.util.InputUtils;
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-12-03 14:40:36 UTC (rev 11519)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-12-03 14:41:13 UTC (rev 11520)
@@ -67,6 +67,23 @@
variables.setVariable("controlHoveredClass", controlHoveredClass);
String controlPressedClass = (String)component.getAttributes().get("controlPressedClass");
variables.setVariable("controlPressedClass", controlPressedClass);
+
+ String styleClass = (String)component.getAttributes().get("styleClass");
+ styleClass = styleClass != null ? styleClass.trim() : "";
+ variables.setVariable("styleClass", styleClass);
+
+ String changedClass = (String)component.getAttributes().get("changedClass");
+ changedClass = (changedClass != null ? changedClass.trim() : "") + styleClass;
+ variables.setVariable("changedClass", changedClass);
+
+ String viewClass = (String)component.getAttributes().get("viewClass");
+ viewClass = (viewClass != null ? viewClass.trim() : "") + styleClass;
+ variables.setVariable("viewClass", viewClass);
+
+ String editClass = (String)component.getAttributes().get("editClass");
+ editClass = (editClass != null ? editClass.trim() : "") + styleClass;
+ variables.setVariable("editClass", editClass);
+
String layout = (String)component.getAttributes().get("layout");
if (layout != null && layout.length() != 0) {
@@ -85,11 +102,11 @@
<jsp:scriptlet>
if (layout.equals("inline")) {
</jsp:scriptlet>
- <span id="#{clientId}" class="rich-inplace-select rich-inplace-select-view #{component.attributes['viewClass']}" x:passThruWithExclusions="id,styleClass,class" style="zoom: 1; #{component.attributes['style']}">
+ <span id="#{clientId}" class="rich-inplace-select rich-inplace-select-view #{viewClass}" x:passThruWithExclusions="id,styleClass,class" style="zoom: 1; #{component.attributes['style']}">
<jsp:scriptlet>
} else {
</jsp:scriptlet>
- <div id="#{clientId}" class="rich-inplace-select rich-inplace-select-view #{component.attributes['viewClass']}" x:passThruWithExclusions="id,styleClass,class" style="zoom: 1; #{component.attributes['style']}">
+ <div id="#{clientId}" class="rich-inplace-select rich-inplace-select-view #{viewClass}" x:passThruWithExclusions="id,styleClass,class" style="zoom: 1; #{component.attributes['style']}">
<jsp:scriptlet>
}
</jsp:scriptlet>
@@ -200,6 +217,8 @@
</div>
</div>
</div>
+
+
<script type="text/javascript">
@@ -211,9 +230,9 @@
},
component: {
- changed :{normal:'#{component.attributes["changedClass"]}',hovered:'#{component.attributes["changedHoverClass"]}'},
- view : {normal:'#{component.attributes["viewClass"]}',hovered:'#{component.attributes["viewHoverClass"]}'},
- editable:'#{component.attributes["editClass"]}'
+ changed :{normal:'#{changedClass}' ,hovered:'#{component.attributes["changedHoverClass"]}'},
+ view : {normal:'#{viewClass}',hovered:'#{component.attributes["viewHoverClass"]}'},
+ editable:'#{editClass}'
}
};
17 years, 6 months
JBoss Rich Faces SVN: r11519 - trunk/ui/inplaceInput/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-03 09:40:36 -0500 (Wed, 03 Dec 2008)
New Revision: 11519
Modified:
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
https://jira.jboss.org/jira/browse/RF-3233
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-12-03 14:33:56 UTC (rev 11518)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-12-03 14:40:36 UTC (rev 11519)
@@ -61,6 +61,22 @@
variables.setVariable("controlHoverClass", controlHoverClass);
String controlPressedClass = (String)component.getAttributes().get("controlPressedClass");
variables.setVariable("controlPressedClass", controlPressedClass);
+
+ String styleClass = (String)component.getAttributes().get("styleClass");
+ styleClass = styleClass != null ? styleClass.trim() : "";
+ variables.setVariable("styleClass", styleClass);
+
+ String changedClass = (String)component.getAttributes().get("changedClass");
+ changedClass = (changedClass != null ? changedClass.trim() : "") + styleClass;
+ variables.setVariable("changedClass", changedClass);
+
+ String viewClass = (String)component.getAttributes().get("viewClass");
+ viewClass = (viewClass != null ? viewClass.trim() : "") + styleClass;
+ variables.setVariable("viewClass", viewClass);
+
+ String editClass = (String)component.getAttributes().get("editClass");
+ editClass = (editClass != null ? editClass.trim() : "") + styleClass;
+ variables.setVariable("editClass", editClass);
String layout = (String)component.getAttributes().get("layout");
if (layout != null && layout.length() != 0) {
@@ -75,12 +91,12 @@
]]>
</jsp:scriptlet>
- <span id="#{clientId}" class='rich-inplace rich-inplace-view #{component.attributes["styleClass"]}'
+ <span id="#{clientId}" class='rich-inplace rich-inplace-view #{viewClass}'
x:passThruWithExclusions="id,styleClass,class" style="zoom: 1; #{component.attributes['style']}">
<jsp:scriptlet>
} else {
</jsp:scriptlet>
- <div id="#{clientId}" class='rich-inplace rich-inplace-view #{component.attributes["viewClass"]} #{component.attributes["styleClass"]}'
+ <div id="#{clientId}" class='rich-inplace rich-inplace-view #{viewClass}'
x:passThruWithExclusions="id,styleClass,class" style="zoom: 1; #{component.attributes['style']}">
<jsp:scriptlet>
}
@@ -168,14 +184,14 @@
var inplaceInputUserStyles = {
component:{
view :{
- normal:'#{component.attributes["viewClass"]}',
+ normal:'#{viewClass}',
hovered:'#{component.attributes["viewHoverClass"]}'
},
changed:{
- normal:'#{component.attributes["changedClass"]}',
+ normal:'#{changedClass}',
hovered:'#{component.attributes["changedHoverClass"]}'
},
- editable:'#{component.attributes["editClass"]}'
+ editable:'#{editClass}'
}
};
17 years, 6 months
JBoss Rich Faces SVN: r11518 - 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 09:33:56 -0500 (Wed, 03 Dec 2008)
New Revision: 11518
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-03 14:11:04 UTC (rev 11517)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-03 14:33:56 UTC (rev 11518)
@@ -123,7 +123,8 @@
}
config.setUserExtensions(new File(getClass().getClassLoader().getResource("script/selenium/user-extensions.js").toURI()));
config.setMultiWindow(false);
-
+ //TODO only for test
+ config.setPort(16334);
seleniumServer = new SeleniumServer(false, config);
seleniumServer.start();
}
@@ -218,7 +219,7 @@
* @return
*/
private DefaultSelenium createSeleniumClient(String url, String browser) {
- return new DefaultSelenium(host, 4444, browser, url);
+ return new DefaultSelenium(host, 16334, browser, url);
}
private static final Object MUTEX = new Object();
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 14:11:04 UTC (rev 11517)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml 2008-12-03 14:33:56 UTC (rev 11518)
@@ -1,18 +1,16 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="seleniumTest">
- <parameter name="loadStyleStrategy" value="DEFAULT"/>
- <parameter name="loadScriptStrategy" value="DEFAULT"/>
- <parameter name="filterPrefix" value="/faces/NONE/"/>
-
- <test name="FireFoxFunctionalTests">
+ <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="testValidators" />
- </methods-->
+ <methods>
+ <include name="testHTMLAttributes" />
+ </methods>
</class>
</classes>
</test>
</suite>
-
17 years, 6 months
JBoss Rich Faces SVN: r11517 - trunk/test-applications/seleniumTest/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 09:11:04 -0500 (Wed, 03 Dec 2008)
New Revision: 11517
Modified:
trunk/test-applications/seleniumTest/richfaces/pom.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 13:55:09 UTC (rev 11516)
+++ trunk/test-applications/seleniumTest/richfaces/pom.xml 2008-12-03 14:11:04 UTC (rev 11517)
@@ -61,14 +61,14 @@
${project.build.directory}/test-classes/testng/testng_default_default_neko.xml
</suiteXmlFile-->
<suiteXmlFile>
- ${project.build.directory}/test-classes/testng/local_testng.xml
+ src/test/testng/win/local_testng.xml
</suiteXmlFile>
</suiteXmlFiles>
- <properties>
+ <properties>
<property>
<name>listener</name>
<value>org.richfaces.TestAnnotationTransformer</value>
- </property>
+ </property>
</properties>
</configuration>
<executions>
17 years, 6 months
JBoss Rich Faces SVN: r11516 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-12-03 08:55:09 -0500 (Wed, 03 Dec 2008)
New Revision: 11516
Modified:
trunk/docs/userguide/en/src/main/docbook/included/queue.xml
Log:
RF-4664 - Descriptions of the attributes and the new information in the "Key attributes and ways of usage" section have been added;
Modified: trunk/docs/userguide/en/src/main/docbook/included/queue.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/queue.xml 2008-12-03 13:54:35 UTC (rev 11515)
+++ trunk/docs/userguide/en/src/main/docbook/included/queue.xml 2008-12-03 13:55:09 UTC (rev 11516)
@@ -56,12 +56,99 @@
<programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.HtmlQueue;
...
HtmlQueue myQueue = new HtmlQueue();
-...]]></programlisting>
+]]></programlisting>
</section>
<section>
<title>Key attributes and ways of usage</title>
-
+ <para>By means of the <emphasis role="bold"><property><a4j:queue></property></emphasis> component a user can create several types of queues associated with it.</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ A user can set a queue globally in "web.xml". You don't need set the queue on the page itself. The global queue can be used by all components. Example you can see below:
+ </para>
+ <programlisting role="XML"><![CDATA[<context-param>
+ <param-name>org.richfaces.queue.global.enabled</param-name>
+ <param-value>true</param-value>
+ </context-param>]]></programlisting>
+ <para>
+ The global queue can be disabled for specifically view's application.
+ </para>
+ <para>
+ In order to enable/disable a global queue see the following examples:
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:queue name="org.richfaces.global_queue" disabled="false"... />]]></programlisting>
+ <para>
+ or:
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:queue name="org.richfaces.global_queue" disabled="true"... />]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ A user can create separate queue for specific form with the help of the <emphasis role="bold"><property><a4j:form></property></emphasis> or <emphasis role="bold"><property><h:form></property></emphasis> tags.
+ It will be the global queue only for this form.
+ </para>
+ <para>
+ <emphasis role="bold">
+ Example:
+ </emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<h:form ... >
+ ...
+ <a4j:queue ... />
+ ...
+ </h:form>]]></programlisting>
+ <para>
+ or:
+ </para>
+ <para>
+ <emphasis role="bold">
+ Example:
+ </emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:form ... >
+ ...
+ <a4j:queue <a4j:queue name="fooQueue" ... />
+ ...
+</a4j:form>]]></programlisting>
+ <para>If you use <emphasis role="bold"><property><a4j:form></property></emphasis> tag, you can reference a named queue as the form's default.</para>
+ <para>
+ <emphasis role="bold">
+ Example:
+ </emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:form eventsQueue="fooQueue" ...>
+ ...
+ </a4j:form>]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>With the help of the <emphasis><property>"eventsQueue"</property></emphasis> attribute a user can reference a named queue from any <emphasis role="bold"><property>a4j</property></emphasis> or <emphasis role="bold"><property>rich</property></emphasis> component that supports this attribute.</para>
+ <para>
+ <emphasis role="bold">
+ Example:
+ </emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:queue name="fooQueue" ... />
+...
+<h:inputText value="#{foo2.bar1}">
+ <a:support id="onblur" event="onblur" reRender="bar21" eventsQueue="fooQueue"/>
+</h:inputText>
+
+<a4j:commandButton eventsQueue="fooQueue" ... >]]></programlisting>
+ <para>
+ As a result all requests generated through the onblur of the <emphasis><property><h:inputText></property></emphasis> component, and clicking of the <emphasis><property><h:commandButton></property></emphasis> will be funneled through the <code>"fooQueue"</code>.
+ </para>
+ <para>
+ If you have a try to reference a nonexistent queue a new named queue will be created with all default settings.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The <emphasis><property>"size"</property></emphasis> attribute help you to set the number of items allowed in the queue at one time.
+ </para>
+ <para>
+
+ </para>
</section>
<section>
17 years, 6 months
JBoss Rich Faces SVN: r11515 - trunk/ui/core/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-12-03 08:54:35 -0500 (Wed, 03 Dec 2008)
New Revision: 11515
Modified:
trunk/ui/core/src/main/config/component/queue.xml
Log:
RF-4664 - Descriptions of the attributes and the new information in the "Key attributes and ways of usage" section have been added;
Modified: trunk/ui/core/src/main/config/component/queue.xml
===================================================================
--- trunk/ui/core/src/main/config/component/queue.xml 2008-12-03 13:40:25 UTC (rev 11514)
+++ trunk/ui/core/src/main/config/component/queue.xml 2008-12-03 13:54:35 UTC (rev 11515)
@@ -31,53 +31,68 @@
<property>
<name>size</name>
<classname>int</classname>
+ <description>Defines the number of items allowed in the queue at one time.</description>
</property>
<property>
<name>name</name>
<classname>java.lang.String</classname>
+ <description>The optional name of this component</description>
<defaultvalue>""</defaultvalue>
</property>
<property >
<name>requestDelay</name>
<classname>int</classname>
+ <description>Attribute defines the time (in ms.) that the request will be wait in the queue before it is ready to send.
+ When the delay time is over, the request will be sent to the server or removed if the newest 'similar' request is in a queue already</description>
</property>
<property>
<name>ignoreDupResponses</name>
<classname>boolean</classname>
+ <description>Attribute allows to ignore an Ajax Response produced by a request if the newest 'similar' request is in a queue already.
+ ignoreDupResponses="true" does not cancel the request while it is processed on the server, but just allows to avoid unnecessary updates on the client side if the response isn't actual now</description>
</property>
<property>
<name>timeout</name>
<classname>int</classname>
+ <description>Response waiting time on a particular request. If a response is not received during this time, the request is aborted</description>
</property>
<property>
<name>disabled</name>
<classname>boolean</classname>
+ <description>If "true", disable this component on page.</description>
</property>
<property>
<name>onsubmit</name>
<classname>java.lang.String</classname>
+ <description>JavaScript code for call before submission of ajax event</description>
</property>
<property>
<name>onbeforedomupdate</name>
<classname>java.lang.String</classname>
+ <description>JavaScript code for call before DOM has been updated on client side</description>
</property>
<property>
<name>oncomplete</name>
<classname>java.lang.String</classname>
+ <description>JavaScript code for call after request completed on client side</description>
</property>
<property>
<name>onerror</name>
<classname>java.lang.String</classname>
+ <description>HTML: a script expression; event fires whenever an JavaScript error occurs</description>
</property>
<property>
<name>sizeExceededBehavior</name>
<classname>java.lang.String</classname>
+ <description>Defines the strategies of the queue's behavior if the number of the requests waiting in the queue is exceeded.
+ There are four strategies: dropNext (by default), dropNew, fireNext , fireNew.</description>
</property>
<property>
<name>onsizeexceeded</name>
<classname>java.lang.String</classname>
+ <description>A script expression; a size is exceed</description>
</property>
<property hidden="true">
17 years, 6 months
JBoss Rich Faces SVN: r11514 - trunk/test-applications/seleniumTest/richfaces/src/test/testng/win.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 08:40:25 -0500 (Wed, 03 Dec 2008)
New Revision: 11514
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml
Log:
RF-5197
only for test
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 13:29:52 UTC (rev 11513)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/testng/win/local_testng.xml 2008-12-03 13:40:25 UTC (rev 11514)
@@ -1,16 +1,18 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="seleniumTestDDNo">
- <test name="IEFunctionalTests">
+<suite name="seleniumTest">
+ <parameter name="loadStyleStrategy" value="DEFAULT"/>
+ <parameter name="loadScriptStrategy" value="DEFAULT"/>
+ <parameter name="filterPrefix" value="/faces/NONE/"/>
+
+ <test name="FireFoxFunctionalTests">
<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>
+ <!--methods>
+ <include name="testValidators" />
+ </methods-->
</class>
</classes>
</test>
</suite>
+
17 years, 6 months
JBoss Rich Faces SVN: r11513 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 08:29:52 -0500 (Wed, 03 Dec 2008)
New Revision: 11513
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 13:13:07 UTC (rev 11512)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 13:29:52 UTC (rev 11513)
@@ -206,6 +206,11 @@
<module>samples</module>
</modules>
<dependencies>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.14</version>
+ </dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
17 years, 6 months
JBoss Rich Faces SVN: r11512 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 08:13:07 -0500 (Wed, 03 Dec 2008)
New Revision: 11512
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:49:44 UTC (rev 11511)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 13:13:07 UTC (rev 11512)
@@ -207,6 +207,16 @@
</modules>
<dependencies>
<dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>el-impl</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
17 years, 6 months
JBoss Rich Faces SVN: r11511 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/calendar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-03 07:49:44 -0500 (Wed, 03 Dec 2008)
New Revision: 11511
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
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:
https://jira.jboss.org/jira/browse/RF-5153 started
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-03 12:42:14 UTC (rev 11510)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-03 12:49:44 UTC (rev 11511)
@@ -35,11 +35,11 @@
import org.richfaces.event.CurrentDateChangeEvent;
public class CalendarTestBean {
-
- public static final String valueChangeListener = "valueChangeListener";
-
- public static final String currentDateChangeListener = "currentDateChangeListener";
+ public static final String valueChangeListener = "valueChangeListener";
+
+ public static final String currentDateChangeListener = "currentDateChangeListener";
+
public static final String DATE_PATTERN = "MM/dd/yyyy HH:mm";
public static final Locale LOCALE = new Locale("US");
@@ -52,35 +52,35 @@
public static DateFormat DATE_FORMAT;
- // constructor for static fields
+ // constructor for static fields
static {
- setupDefaultConverter();
- setupDefaultDate();
+ setupDefaultConverter();
+ setupDefaultDate();
}
-
- private String datePattern ;
-
+
+ private String datePattern;
+
private Locale locale;
-
+
private TimeZone timeZone;
-
+
private Date selectedDate;
-
+
private String selectedDateString;
-
+
private CalendarDataModel model;
-
- private String mode = UICalendar.AJAX_MODE;
-
+
+ private String mode = UICalendar.AJAX_MODE;
+
private String status;
-
+
public CalendarTestBean() {
- selectedDate = DEFAULT_DATE;
- resetSelectedDateString();
-
- datePattern = DATE_PATTERN;
- locale = LOCALE;
- timeZone = TIME_ZONE;
+ selectedDate = DEFAULT_DATE;
+ resetSelectedDateString();
+
+ datePattern = DATE_PATTERN;
+ locale = LOCALE;
+ timeZone = TIME_ZONE;
}
public Date getSelectedDate() {
@@ -91,11 +91,11 @@
this.selectedDate = selectedDate;
resetSelectedDateString();
}
-
+
public void resetSelectedDateString() {
- setSelectedDateString(DATE_FORMAT.format(getSelectedDate()));
+ setSelectedDateString(DATE_FORMAT.format(getSelectedDate()));
}
-
+
public String getSelectedDateString() {
return selectedDateString;
}
@@ -121,112 +121,134 @@
}
public void setLocale(Locale locale) {
- this.locale = locale;
+ this.locale = locale;
}
public void setTimeZone(TimeZone timeZone) {
- this.timeZone = timeZone;
+ this.timeZone = timeZone;
}
-
+
public static Calendar getCalendar() {
- return Calendar.getInstance(CalendarTestBean.TIME_ZONE, CalendarTestBean.LOCALE);
+ return Calendar.getInstance(CalendarTestBean.TIME_ZONE, CalendarTestBean.LOCALE);
}
-
+
/**
* Setup the default date
*/
private static void setupDefaultDate() {
- DEFAULT_DATE = getDayInMay(10);
+ DEFAULT_DATE = getDayInMay(10);
}
-
+
public static Date getDayInMay(int dayOfMonth) {
- Calendar calendar = getCalendar();
- calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
- calendar.set(Calendar.MONTH, Calendar.MAY);
- calendar.set(Calendar.YEAR, 2008);
- calendar.set(Calendar.HOUR_OF_DAY, 18);
- calendar.set(Calendar.MINUTE, 25);
- calendar.set(Calendar.SECOND, 0);
- calendar.set(Calendar.MILLISECOND, 0);
-
- return calendar.getTime();
+ Calendar calendar = getCalendar();
+ calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
+ calendar.set(Calendar.MONTH, Calendar.MAY);
+ calendar.set(Calendar.YEAR, 2008);
+ calendar.set(Calendar.HOUR_OF_DAY, 18);
+ calendar.set(Calendar.MINUTE, 25);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ return calendar.getTime();
}
-
+
/**
* Setup the default converter
*/
- private static void setupDefaultConverter() {
- DEFAULT_CONVERTER = new DateTimeConverter();
+ private static void setupDefaultConverter() {
+ DEFAULT_CONVERTER = new DateTimeConverter();
- DEFAULT_CONVERTER.setPattern(DATE_PATTERN);
- DEFAULT_CONVERTER.setLocale(LOCALE);
- DEFAULT_CONVERTER.setTimeZone(TIME_ZONE);
-
- try {
- Method method = null;
- Method[] declaredMethods = DateTimeConverter.class.getDeclaredMethods();
- for (int i = 0; i < declaredMethods.length; i++) {
- if (declaredMethods[i].getName().equals("getDateFormat")) {
- method = declaredMethods[i];
- break;
- }
- }
- if (method != null) {
+ DEFAULT_CONVERTER.setPattern(DATE_PATTERN);
+ DEFAULT_CONVERTER.setLocale(LOCALE);
+ DEFAULT_CONVERTER.setTimeZone(TIME_ZONE);
- method.setAccessible(true);
- DATE_FORMAT = (DateFormat) method.invoke(DEFAULT_CONVERTER, DEFAULT_CONVERTER.getLocale());
- DATE_FORMAT.setTimeZone(DEFAULT_CONVERTER.getTimeZone());
- }
- } catch (Exception e) {
- // skip exception
- }
+ try {
+ Method method = null;
+ Method[] declaredMethods = DateTimeConverter.class.getDeclaredMethods();
+ for (int i = 0; i < declaredMethods.length; i++) {
+ if (declaredMethods[i].getName().equals("getDateFormat")) {
+ method = declaredMethods[i];
+ break;
+ }
+ }
+ if (method != null) {
+
+ method.setAccessible(true);
+ DATE_FORMAT = (DateFormat) method.invoke(DEFAULT_CONVERTER, DEFAULT_CONVERTER.getLocale());
+ DATE_FORMAT.setTimeZone(DEFAULT_CONVERTER.getTimeZone());
+ }
+ } catch (Exception e) {
+ // skip exception
+ }
}
-
+
public void valueChangeListener(ValueChangeEvent event) {
- status = getStatus() + valueChangeListener;
+ status = getStatus() + valueChangeListener;
}
-
+
public void currectDateChangeListener(CurrentDateChangeEvent event) {
- status = getStatus() + currentDateChangeListener;
+ status = getStatus() + currentDateChangeListener;
}
-
+
public String testClientMode() {
- mode = UICalendar.CLIENT_MODE;
- return null;
+ mode = UICalendar.CLIENT_MODE;
+ return null;
}
-
+
public void reset() {
- mode = UICalendar.AJAX_MODE;
- status = "";
- selectedDate = new Date();
+ mode = UICalendar.AJAX_MODE;
+ status = "";
+ selectedDate = new Date();
}
-
+
public String resetAction() {
- reset();
- return null;
+ reset();
+ return null;
}
- public String getStatus() {
- return status;
- }
+ public String getStatus() {
+ return status;
+ }
- public void setStatus(String status) {
- this.status = status;
- }
+ public void setStatus(String status) {
+ this.status = status;
+ }
- public String getMode() {
- return mode;
- }
+ public String getMode() {
+ return mode;
+ }
- public void setMode(String mode) {
- this.mode = mode;
- }
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
- public CalendarDataModel getModel() {
- return model;
- }
+ public CalendarDataModel getModel() {
+ return model;
+ }
- public void setModel(CalendarDataModel model) {
- this.model = model;
- }
+ public void setModel(CalendarDataModel model) {
+ this.model = model;
+ }
+
+ private Date currentDate = null;
+
+ /**
+ * Gets value of currentDate field.
+ *
+ * @return value of currentDate field
+ */
+ public Date getCurrentDate() {
+ return currentDate;
+ }
+
+ /**
+ * Set a new value for currentDate field.
+ *
+ * @param currentDate
+ * a new value for currentDate field
+ */
+ public void setCurrentDate(Date currentDate) {
+ this.currentDate = currentDate;
+ }
+
}
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-03 12:42:14 UTC (rev 11510)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-03 12:49:44 UTC (rev 11511)
@@ -32,203 +32,197 @@
public class CalendarTest extends SeleniumTestBase {
- static final String RESET_METHOD = "#{calendarBean.reset}";
+ static final String RESET_METHOD = "#{calendarBean.reset}";
- 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;
+ static final String FORM_ID = "_form:";
- 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";
- }
+ static final String CONTROLS_FORM_ID = "_controls:";
- String getStatus() {
- return getTextById(statusId);
- }
+ static final String availableDayCellClass = "rich-calendar-cell-size rich-calendar-cell rich-calendar-btn";
- 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);
- }
- }
-
- 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());
+ String calendarId;
- 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);
-
- }
+ String calendarHeaderId;
+ String ajaxSubmitId;
- // @Test
- public void testCalendarComponent(Template template) {
- renderPage(template);
+ String serverSubmitId;
- String containerId = getParentId() + "_form:";
- String calendarOpenedId = containerId + "calendar";
- String calendarCollapsedId = calendarOpenedId + "Popup";
- String calendarInputDate = calendarOpenedId + "InputDate";
- String calendarPopupButton = calendarCollapsedId + "Button";
- String outputPanel = containerId + "outputPanel";
+ String statusId;
- Assert.assertFalse(isVisibleById(calendarOpenedId),
- "Calendar window should NOT be visible on the component!");
+ String resetActionId;
- writeStatus("Mouse click on calendar InputDate field");
- clickById(calendarInputDate);
+ String testClientModeId;
- Assert.assertTrue(isVisibleById(calendarOpenedId),
- "Calendar window should 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 outside calendar");
- clickById(outputPanel);
+ String getStatus() {
+ return getTextById(statusId);
+ }
- Assert.assertFalse(isVisibleById(calendarOpenedId),
- "Calendar window should NOT be visible on the component!");
+ 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);
+ }
+ }
- writeStatus("Mouse click on calendar popup button");
- clickById(calendarPopupButton);
+ void changeDate() {
+ String weekNumId = calendarId + "WeekNum2";
+ selenium.click("//tr[@id='" + weekNumId + "']/td[@class='" + availableDayCellClass + "']");
+ }
- Assert.assertTrue(isVisibleById(calendarOpenedId),
- "Calendar window should be visible on the component!");
- }
+ void changeCurrentDate(boolean wait4ajax) {
+ selenium.click("//td[@id='" + calendarHeaderId + "']/table/tbody/tr/td/div");
+ if (wait4ajax) {
+ waitForAjaxCompletion();
+ }
+ }
- // @Test
- public void testSelectDateComponent(Template template) {
- renderPage(template);
+ void reset() {
+ clickCommandAndWait(resetActionId);
+ }
- Date newSelectedDate = CalendarTestBean.getDayInMay(15);
+ void switchToClientMode() {
+ clickCommandAndWait(testClientModeId);
+ }
- 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 testListenersInAjaxMode(Template template) {
+ renderPage(template, RESET_METHOD);
+ initIds(getParentId());
- 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!");
+ changeDate();
- 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!");
+ clickAjaxCommandAndWait(ajaxSubmitId);
+ assertListeners(CalendarTestBean.valueChangeListener);
- // click on 15th of May
- String newSelectedDateId = calendarOpenedId + "DayCell18";
- clickById(newSelectedDateId);
+ reset();
- writeStatus("Mouse click outside calendar");
- clickById(outputPanel);
+ changeCurrentDate(true);
+ changeDate();
+ clickAjaxCommandAndWait(ajaxSubmitId);
+ assertListeners(CalendarTestBean.valueChangeListener, CalendarTestBean.currentDateChangeListener);
- 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!");
- }
+ @Test
+ public void testListenersInClientMode(Template template) {
+ renderPage(template, RESET_METHOD);
+ initIds(getParentId());
+ switchToClientMode();
- public String getTestUrl() {
- return "pages/calendar/calendarTest.xhtml";
- }
+ changeDate();
+
+ clickCommandAndWait(serverSubmitId);
+ assertListeners(CalendarTestBean.valueChangeListener);
+
+ reset();
+ switchToClientMode();
+
+ changeCurrentDate(false);
+ changeDate();
+ clickCommandAndWait(serverSubmitId);
+ assertListeners(CalendarTestBean.valueChangeListener, CalendarTestBean.currentDateChangeListener);
+
+ }
+
+ // @Test
+ public void testCalendarComponent(Template template) {
+ renderPage(template);
+
+ 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 InputDate field");
+ clickById(calendarInputDate);
+
+ Assert.assertTrue(isVisibleById(calendarOpenedId), "Calendar window should be visible on the component!");
+
+ writeStatus("Mouse click outside calendar");
+ clickById(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!");
+ }
+
+ // @Test
+ public void testSelectDateComponent(Template template) {
+ renderPage(template);
+
+ Date newSelectedDate = CalendarTestBean.getDayInMay(15);
+
+ 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!");
+ }
+
+ public String getTestUrl() {
+ return "pages/calendar/calendarTest.xhtml";
+ }
}
17 years, 6 months
JBoss Rich Faces SVN: r11510 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 07:42:14 -0500 (Wed, 03 Dec 2008)
New Revision: 11510
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:39:53 UTC (rev 11509)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:42:14 UTC (rev 11510)
@@ -207,6 +207,18 @@
</modules>
<dependencies>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2_10</version>
17 years, 6 months
JBoss Rich Faces SVN: r11509 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 07:39:53 -0500 (Wed, 03 Dec 2008)
New Revision: 11509
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:35:40 UTC (rev 11508)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:39:53 UTC (rev 11509)
@@ -206,6 +206,17 @@
<module>samples</module>
</modules>
<dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_10</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_10</version>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
17 years, 6 months
JBoss Rich Faces SVN: r11508 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 07:35:40 -0500 (Wed, 03 Dec 2008)
New Revision: 11508
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:28:30 UTC (rev 11507)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:35:40 UTC (rev 11508)
@@ -62,6 +62,14 @@
<build>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>0.3.1</version>
17 years, 6 months
JBoss Rich Faces SVN: r11507 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 07:28:30 -0500 (Wed, 03 Dec 2008)
New Revision: 11507
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:23:06 UTC (rev 11506)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:28:30 UTC (rev 11507)
@@ -37,6 +37,27 @@
<enabled>false</enabled>
</releases>
</repository>
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>maven-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>http://download.java.net/maven/1</url>
+ <layout>legacy</layout>
+ </repository>
+
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.org</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
</repositories>
<build>
<plugins>
@@ -230,27 +251,4 @@
<version>1.4.2</version>
</dependency>
</dependencies>
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>maven-repository.dev.java.net</id>
- <name>Java.net Repository for Maven</name>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
-
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.org/maven2</url>
- </repository>
- </repositories>
</project>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r11506 - trunk/test-applications/seleniumTest.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-03 07:23:06 -0500 (Wed, 03 Dec 2008)
New Revision: 11506
Modified:
trunk/test-applications/seleniumTest/pom.xml
Log:
RF-5197
only for test
Modified: trunk/test-applications/seleniumTest/pom.xml
===================================================================
--- trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:10:22 UTC (rev 11505)
+++ trunk/test-applications/seleniumTest/pom.xml 2008-12-03 12:23:06 UTC (rev 11506)
@@ -230,4 +230,27 @@
<version>1.4.2</version>
</dependency>
</dependencies>
+ <repositories>
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>maven-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>http://download.java.net/maven/1</url>
+ <layout>legacy</layout>
+ </repository>
+
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.org</id>
+ <url>http://repository.jboss.org/maven2</url>
+ </repository>
+ </repositories>
</project>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r11504 - trunk/ui/editor/src/main/antlr.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-03 06:59:01 -0500 (Wed, 03 Dec 2008)
New Revision: 11504
Modified:
trunk/ui/editor/src/main/antlr/html-seamtext.g
Log:
https://jira.jboss.org/jira/browse/RF-5106
Modified: trunk/ui/editor/src/main/antlr/html-seamtext.g
===================================================================
--- trunk/ui/editor/src/main/antlr/html-seamtext.g 2008-12-03 11:41:26 UTC (rev 11503)
+++ trunk/ui/editor/src/main/antlr/html-seamtext.g 2008-12-03 11:59:01 UTC (rev 11504)
@@ -537,7 +537,7 @@
)
{
-
+
String plain = endCapture();
if(valueCollector == null) {
valueCollector = new StringBuilder();
@@ -546,6 +546,7 @@
}
|html
{
+
if(valueCollector != null) {
append(valueCollector.toString());
}
@@ -569,8 +570,11 @@
if(!isPlainHtmlRequired(name, htmlElementStack)) {
if (isFormattedHtmlSeamTextElement(name)) {
-
- if(isList(name)) {
+
+ if(isLink(name) && valueCollector != null) {
+ append(valueCollector.toString());
+ valueCollector = null;
+ }if(isList(name)) {
append(BLANK_LINE);
} else if (isListItem(name)) {
append(createSeamTextList(name, htmlElementStack));
17 years, 6 months
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>
17 years, 6 months
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
17 years, 6 months
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;
+ }
+
}
17 years, 6 months
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-->
17 years, 6 months
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
17 years, 6 months
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;
17 years, 6 months
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
17 years, 6 months
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)
17 years, 6 months
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) {
17 years, 6 months
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";
+ }
}
17 years, 6 months
JBoss Rich Faces SVN: r11493 - trunk/ui/editor/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-02 11:29:39 -0500 (Tue, 02 Dec 2008)
New Revision: 11493
Modified:
trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-5195
Modified: trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-12-02 16:20:19 UTC (rev 11492)
+++ trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-12-02 16:29:39 UTC (rev 11493)
@@ -326,22 +326,25 @@
+ ";\n", null);
}
if (component.getOninit() != null && component.getOninit().length() > 0) {
- writer.writeText("tinyMceParams.oninit = " + component.getOninit()
- + ";\n", null);
+ writer.writeText("tinyMceParams.oninit = function () {\n"
+ + component.getOninit() + "\n" + "};\n", null);
}
if (component.getOnsave() != null && component.getOnsave().length() > 0) {
- writer.writeText("tinyMceParams.save_callback = "
- + component.getOnsave() + ";\n", null);
+ writer.writeText(
+ "tinyMceParams.save_callback = function (element_id, html, body) {\n"
+ + component.getOnsave() + "\n" + "};\n", null);
}
if (component.getOnchange() != null
&& component.getOnchange().length() > 0) {
- writer.writeText("tinyMceParams.onchange_callback = "
- + component.getOnchange() + ";\n", null);
+ writer.writeText(
+ "tinyMceParams.onchange_callback = function (inst) {\n"
+ + component.getOnchange() + "\n" + "};\n", null);
}
if (component.getOnsetup() != null
&& component.getOnsetup().length() > 0) {
- writer.writeText("tinyMceParams.setup = " + component.getOnsetup()
- + ";\n", null);
+ writer.writeText("tinyMceParams.setup = function (ed) {\n"
+ + component.getOnsetup() + "\n" + "};\n", null);
+
}
if (component.getDialogType() != null
&& component.getDialogType().length() > 0) {
17 years, 6 months
JBoss Rich Faces SVN: r11492 - in trunk/samples/richfaces-demo/src/main: java/org/richfaces/demo/editor and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-12-02 11:20:19 -0500 (Tue, 02 Dec 2008)
New Revision: 11492
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties
Modified:
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/editor/EditorBean.java 2008-12-02 16:20:19 UTC (rev 11492)
@@ -0,0 +1,61 @@
+package org.richfaces.demo.editor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+public class EditorBean {
+
+ private String currentConfiguration = CONFIGS_PACKAGE + "simple";
+ private String viewMode = "visual";
+ private String value;
+ private boolean liveUpdatesEnabled=false;
+
+ private static final String CONFIGS_PACKAGE = "/org/richfaces/demo/editor/";
+ List<SelectItem> configurations = new ArrayList<SelectItem>();
+
+ public EditorBean() {
+ configurations.add(new SelectItem(CONFIGS_PACKAGE + "simple", "Simple"));
+ configurations.add(new SelectItem(CONFIGS_PACKAGE + "advanced", "Advanced"));
+ }
+
+ public String getCurrentConfiguration() {
+ return currentConfiguration;
+ }
+
+ public void setCurrentConfiguration(String currentConfiguration) {
+ this.currentConfiguration = currentConfiguration;
+ }
+
+ public List<SelectItem> getConfigurations() {
+ return configurations;
+ }
+
+ public String getViewMode() {
+ return viewMode;
+ }
+
+ public void setViewMode(String viewMode) {
+ this.viewMode = viewMode;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public boolean isLiveUpdatesEnabled() {
+ return liveUpdatesEnabled;
+ }
+
+ public void setLiveUpdatesEnabled(boolean liveUpdatesEnabled) {
+ this.liveUpdatesEnabled = liveUpdatesEnabled;
+ }
+
+
+
+}
Added: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties (rev 0)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/advanced.properties 2008-12-02 16:20:19 UTC (rev 11492)
@@ -0,0 +1,5 @@
+theme="advanced"
+theme_advanced_toolbar_location="top"
+theme_advanced_toolbar_align="center"
+plugins="preview,insertdatetime"
+theme_advanced_buttons3="hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
Added: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties (rev 0)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/editor/simple.properties 2008-12-02 16:20:19 UTC (rev 11492)
@@ -0,0 +1 @@
+theme="simple"
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-02 16:20:19 UTC (rev 11492)
@@ -403,6 +403,16 @@
<managed-bean-class>org.richfaces.demo.extendedDataTable.ExtendedTableBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>queueBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.queue.QueueBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>editorBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.editor.EditorBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
<navigation-case>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml 2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml 2008-12-02 16:20:19 UTC (rev 11492)
@@ -13,10 +13,14 @@
}
</style>
<h:form>
-
+ <script type="text/javascript">
+ function custom(){
+ alert(1);
+ }
+ </script>
<h:panelGrid id="panel" columns="2" columnClasses="ecol1, ecol2">
<a4j:outputPanel id="calendar" layout="block">
- <rich:calendar value="#{calendarBean.selectedDate}"
+ <rich:calendar value="#{calendarBean.selectedDate}" oncollapse="custom()"
locale="#{calendarBean.locale}"
popup="#{calendarBean.popup}"
datePattern="#{calendarBean.pattern}"
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml 2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/editor/examples/editor.xhtml 2008-12-02 16:20:19 UTC (rev 11492)
@@ -4,9 +4,44 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
+ <style>
+ .column{
+ width:50%;
+ vertical-align:top;
+ }
+ </style>
<h:form>
- <rich:editor>
+ <a4j:jsFunction name="submit" reRender="result"/>
+ <h:panelGrid columns="2" width="100%" columnClasses="column,column">
+ <rich:editor configuration="#{editorBean.currentConfiguration}" id="editor" width="400" viewMode = "#{editorBean.viewMode}" value="#{editorBean.value}" onchange="submit">
+ </rich:editor>
- </rich:editor>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Editor Settings"/>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="Select Editor Theme"/>
+ <h:selectOneRadio value="#{editorBean.currentConfiguration}" layout="pageDirection">
+ <f:selectItems value="#{editorBean.configurations}"/>
+ <a4j:support event="onchange" reRender="editor" />
+ </h:selectOneRadio>
+ <h:outputText value="Toggle Modes"/>
+ <h:selectOneRadio value="#{editorBean.viewMode}" layout="pageDirection">
+ <f:selectItem itemLabel="WYSIWYG mode" itemValue="visual"/>
+ <f:selectItem itemLabel="Simple Text Area" itemValue="source"/>
+ <a4j:support event="onchange" reRender="editor" />
+ </h:selectOneRadio>
+ </h:panelGrid>
+ </rich:panel>
+ </h:panelGrid>
+
+ <rich:panel id="result">
+ <f:facet name="header">
+ <h:outputText value="Preview"/>
+ </f:facet>
+ <h:outputText escape="false" value="#{editorBean.value}"/>
+ </rich:panel>
+
</h:form>
</ui:composition>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml 2008-12-02 16:07:06 UTC (rev 11491)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml 2008-12-02 16:20:19 UTC (rev 11492)
@@ -4,7 +4,21 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
+ <style>
+ .link{
+ width:40px;
+ height:40px;
+ }
+ </style>
<h:form>
- QUEUE SAMPLE
+ <rich:dataGrid value="#{queueBean.buttons}" var="button" columns="4">
+ <rich:paint2D cacheable="false" paint="#{queueBean.paint}" data="#{button.color}">
+ </rich:paint2D>
+ <ui:remove>
+ <h:panelGroup layout="block" style="background-color: #{button.color}" styleClass="link">
+ <h:outputText value="#{button.name}"/>
+ </h:panelGroup>
+ </ui:remove>
+ </rich:dataGrid>
</h:form>
</ui:composition>
17 years, 6 months
JBoss Rich Faces SVN: r11491 - trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-12-02 11:07:06 -0500 (Tue, 02 Dec 2008)
New Revision: 11491
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java
Log:
https://jira.jboss.org/jira/browse/RF-4473
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java 2008-12-02 16:03:29 UTC (rev 11490)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/AjaxActionsRule.java 2008-12-02 16:07:06 UTC (rev 11491)
@@ -22,7 +22,9 @@
package org.ajax4jsf.webapp.taglib;
import javax.faces.component.ActionSource;
+import javax.faces.component.ActionSource2;
import javax.faces.event.ActionEvent;
+import javax.faces.event.MethodExpressionActionListener;
import com.sun.facelets.FaceletContext;
import com.sun.facelets.el.LegacyMethodBinding;
@@ -30,6 +32,7 @@
import com.sun.facelets.tag.Metadata;
import com.sun.facelets.tag.MetadataTarget;
import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.util.FacesAPI;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
@@ -56,7 +59,23 @@
AjaxActionsRule.ACTION_SIG)));
}
}
+
+ final static class ActionMapper2 extends Metadata {
+ private final TagAttribute attr;
+
+ public ActionMapper2(TagAttribute attr) {
+ this.attr = attr;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((ActionSource2) instance).setActionExpression(this.attr
+ .getMethodExpression(ctx, String.class,
+ AjaxActionsRule.ACTION_SIG));
+ }
+
+ }
+
public final static class ActionListenerMapper extends Metadata {
private final TagAttribute attr;
@@ -73,7 +92,25 @@
}
}
+
+ final static class ActionListenerMapper2 extends Metadata {
+ private final TagAttribute attr;
+
+ public ActionListenerMapper2(TagAttribute attr) {
+ this.attr = attr;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((ActionSource2) instance)
+ .addActionListener(new MethodExpressionActionListener(
+ this.attr.getMethodExpression(ctx, null,
+ AjaxActionsRule.ACTION_LISTENER_SIG)));
+
+ }
+
+ }
+
public final static AjaxActionsRule instance = new AjaxActionsRule();
public AjaxActionsRule() {
@@ -83,14 +120,23 @@
public Metadata applyRule(String name, TagAttribute attribute,
MetadataTarget meta) {
if (meta.isTargetInstanceOf(ActionSource.class)) {
+ boolean elSupport = FacesAPI.getComponentVersion(meta.getTargetClass()) >= 12;
if ("action".equals(name)) {
- return new ActionMapper(attribute);
+ if (elSupport && meta.isTargetInstanceOf(ActionSource2.class)) {
+ return new ActionMapper2(attribute);
+ } else {
+ return new ActionMapper(attribute);
+ }
}
if ("actionListener".equals(name)) {
- return new ActionListenerMapper(attribute);
+ if (elSupport && meta.isTargetInstanceOf(ActionSource2.class)) {
+ return new ActionListenerMapper2(attribute);
+ } else {
+ return new ActionListenerMapper(attribute);
+ }
}
}
return null;
17 years, 6 months
JBoss Rich Faces SVN: r11490 - in trunk/test-applications/realworld: ejb/src/main/java/org/richfaces/realworld/service and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2008-12-02 11:03:29 -0500 (Tue, 02 Dec 2008)
New Revision: 11490
Added:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
trunk/test-applications/realworld/ejb/src/main/resources/import.sql
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
trunk/test-applications/realworld/web/src/main/webapp/readMessages.xhtml
Log:
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -89,7 +89,6 @@
private String changedName;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "album")
- @org.hibernate.annotations.Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
@org.hibernate.annotations.Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
private List<Image> images = new ArrayList<Image>();
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Message.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -17,10 +17,13 @@
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.NotNull;
+import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
@Entity
@Name("message")
@Table(name = "messages")
+(a)Scope(ScopeType.PAGE)
public class Message implements Serializable{
@Id
@@ -31,7 +34,15 @@
@Temporal(TemporalType.TIMESTAMP)
private Date date;
- @ManyToOne(fetch = FetchType.EAGER)
+ private boolean readed;
+
+ @Column(length = 256, nullable = false)
+ @NotNull
+ @NotEmpty
+ @Length(min=3)
+ private String theme;
+
+ @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "AUTHOR_ID", nullable = false, updatable = false)
@org.hibernate.annotations.ForeignKey(name = "FK_FROM_USERS_ID")
private User author;
@@ -83,4 +94,20 @@
this.owner = owner;
}
+ public boolean isReaded() {
+ return readed;
+ }
+
+ public void setReaded(boolean readed) {
+ this.readed = readed;
+ }
+
+ public String getTheme() {
+ return theme;
+ }
+
+ public void setTheme(String theme) {
+ this.theme = theme;
+ }
+
}
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -116,6 +116,10 @@
@org.hibernate.annotations.OrderBy(clause = "NAME asc")
private List<Album> childAlbums = new ArrayList<Album>();
+ @OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
+ @org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
+ @org.hibernate.annotations.OrderBy(clause = "Date desc")
+ private List<Message> messages = new ArrayList<Message>();
//private Address address;
/**
@@ -222,7 +226,33 @@
album.setOwner(null);
childAlbums.remove(album);
}
+
+ public void removeFriend(User friend) {
+ if (friend == null) {
+ throw new IllegalArgumentException("Null friend");
+ }
+ friends.remove(friend);
+ }
+
+ public void addMessage(Message message) {
+ if (message == null) {
+ throw new IllegalArgumentException("Null Message!");
+ }
+ if (message.getOwner() != null && !this.equals(message.getOwner())) {
+ message.getOwner().getMessages().remove(message);
+ }
+ message.setOwner(this);
+ messages.add(message);
+ }
+ public void removeMessage(Message message) {
+ if (message == null) {
+ throw new IllegalArgumentException("Null message");
+ }
+ message.setOwner(null);
+ messages.remove(message);
+ }
+
public String getConfirmPassword() {
return confirmPassword;
}
@@ -246,4 +276,12 @@
public void setSharedAlbums(List<Album> sharedAlbums) {
this.sharedAlbums = sharedAlbums;
}
+
+ public List<Message> getMessages() {
+ return messages;
+ }
+
+ public void setMessages(List<Message> messages) {
+ this.messages = messages;
+ }
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -9,11 +9,6 @@
public interface IImageAction {
- /* (non-Javadoc)
- * @see org.richfaces.realworld.service.IAlbumAction#addAlbum()
- */
- public abstract void addAlbum(Album album);
-
public abstract void deleteImage(Image image);
public abstract void editImage(Image image, boolean parentChanged);
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -0,0 +1,22 @@
+package org.richfaces.realworld.service;
+
+import javax.ejb.Remove;
+
+import org.jboss.seam.annotations.Destroy;
+import org.richfaces.realworld.domain.Comment;
+import org.richfaces.realworld.domain.Message;
+
+public interface IMessageAction {
+
+ public abstract void sendMessage(Message message);
+
+ public abstract void deleteMessage(Message message);
+
+ @Remove
+ public void remove();
+
+ @Destroy
+ public void destroy();
+
+ public void markAsReaded(Message message);
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -1,5 +1,8 @@
package org.richfaces.realworld.service;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Remove;
@@ -21,4 +24,7 @@
public void updateUser(User user);
public void resetUser(User user);
+ public List<User> getUsers(String suggest);
+ public long countNotReadedMessages(User user);
+ public void removeFromFriends(User owner, User removed);
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -20,18 +20,6 @@
public class ImageAction implements IImageAction {
@PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
EntityManager em;
-
- /* (non-Javadoc)
- * @see org.richfaces.realworld.service.IAlbumAction#addAlbum()
- */
- /* (non-Javadoc)
- * @see org.richfaces.realworld.service.IImageAction#addAlbum(org.richfaces.realworld.domain.Album)
- */
- public void addAlbum(Album album) {
- //em.persist(album);
- //user.addAlbum(album);
- //em.flush();
- }
/* (non-Javadoc)
* @see org.richfaces.realworld.service.IImageAction#deleteImage(org.richfaces.realworld.domain.Image)
@@ -64,14 +52,14 @@
}
public void editImage(Image image, boolean parentChanged) {
- em.merge(image);
+ image = em.merge(image);
if(parentChanged){
- String login = image.getAlbum().getOwner().getLogin();
+ Album albumPrevious = image.getAlbum();
+ String login = albumPrevious.getOwner().getLogin();
String albumName = image.getAlbumName();
- image.getAlbum().removeImage(image);
+ albumPrevious.removeImage(image);
Album album = (Album)em.createQuery("from Album a where a.name=:albumName and a.owner.login=:login").setParameter("albumName", albumName).setParameter("login", login).getSingleResult();
album.addImage(image);
- em.merge(album);
}
em.flush();
}
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -0,0 +1,57 @@
+package org.richfaces.realworld.service;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Name;
+import org.richfaces.realworld.domain.Comment;
+import org.richfaces.realworld.domain.Message;
+
+@Stateful
+@Name("messageAction")
+public class MessageAction implements IMessageAction {
+ @PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
+ EntityManager em;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IMessageAction#sendMessage(org.richfaces.realworld.domain.Message)
+ */
+ public void sendMessage(Message message){
+ em.persist(message);
+ em.flush();
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IMessageAction#deleteMessage(org.richfaces.realworld.domain.Message)
+ */
+ public void deleteMessage(Message message){
+ message = em.merge(message);
+ message.getOwner().removeMessage(message);
+ em.remove(message);
+ em.flush();
+ }
+
+ public void markAsReaded(Message message){
+ message.setReaded(true);
+ em.flush();
+ }
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#remove()
+ */
+ @Remove
+ public void remove(){
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#destroy()
+ */
+ @Destroy
+ public void destroy(){
+
+ }
+}
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -1,5 +1,6 @@
package org.richfaces.realworld.service;
+import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
@@ -38,6 +39,7 @@
.setParameter("username", username)
.setParameter("password", password)
.getSingleResult();
+ long result = countNotReadedMessages(user);
return user != null;
}
@@ -78,4 +80,19 @@
}
return true;
}
+
+ public List<User> getUsers(String suggest) {
+ List<User> users = em.createQuery("from User u where u.login like :login").setParameter("login", suggest + "%").setMaxResults(10).getResultList();
+ return users;
+ }
+
+ public long countNotReadedMessages(User user){
+ Long result = (Long)em.createQuery("SELECT count(u) FROM User u JOIN u.messages mg WHERE u.login=:login and mg.readed = false").setParameter("login", user.getLogin()).getSingleResult();
+ return result;
+ }
+
+ public void removeFromFriends(User owner, User removed) {
+ owner.removeFriend(removed);
+ em.flush();
+ }
}
\ No newline at end of file
Modified: trunk/test-applications/realworld/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-02 16:03:29 UTC (rev 11490)
@@ -73,7 +73,7 @@
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (21, 'Cool', 20);
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (1, '1985-01-08', 'Hello I am user', 1, 2);
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (2, '1985-01-08', 'Hello I am user2', 1, 3);
-INSERT INTO messages(message_id, date, message, author_id, owner_id) VALUES (1, '1985-01-08', 'Hello I am user', 2, 1);
+INSERT INTO messages(message_id, date, message, author_id, owner_id, readed, theme) VALUES (1, '1985-01-08', 'Hello I am user', 2, 1, false, 'Hello, amarkhel');
INSERT INTO shared_albums(album_id, user_id) VALUES(4, 1);
INSERT INTO shared_albums(album_id, user_id) VALUES(7, 1);
INSERT INTO user_friends(user1_id, user2_id) VALUES(1, 2);
\ No newline at end of file
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -1,6 +1,8 @@
package org.richfaces.realworld.tree;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
import javax.faces.model.SelectItem;
@@ -12,10 +14,13 @@
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.Message;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.fileupload.FileManager;
import org.richfaces.realworld.service.IAlbumAction;
import org.richfaces.realworld.service.IImageAction;
+import org.richfaces.realworld.service.IMessageAction;
+import org.richfaces.realworld.service.IUserAction;
@Name("treeActionManager")
@Scope(ScopeType.PAGE)
@@ -24,19 +29,27 @@
@In
private User user;
+ private long countUnreadedMessages;
+
@In(create=true, required=true)
private IAlbumAction albumAction;
@In(create=true, required=true)
+ private IMessageAction messageAction;
+
+ @In(create=true, required=true)
private IImageAction imageAction;
+ @In(create=true, required=true)
+ private IUserAction userAction;
+
@In(create=true, required=true) @Out
private Album album;
@In(create=true)
FileManager fileManager;
- @In TreeRootItem treeRoot;
+ @In(create=true) TreeRootItem treeRoot;
@In(create=true, required=true)
TreeSelectionManager treeSelectionManager;
@@ -52,6 +65,11 @@
}
+ public List<User> availableUsers(Object suggest){
+ List<User> suggestions = userAction.getUsers((String)suggest);
+ return suggestions;
+ }
+
public void editAlbum(Album album){
boolean nameChanged = !album.getName().equals(album.getChangedName());
if(nameChanged){
@@ -138,4 +156,16 @@
comment.setMessage("+1");
imageAction.addComment(comment);
}
+
+ public void sendMessage(Message message) {
+ messageAction.sendMessage(message);
+ }
+
+ public long getCountUnreadedMessages() {
+ return userAction.countNotReadedMessages(user);
+ }
+
+ public void removeFromFriends(User owner, User removed){
+ userAction.removeFromFriends(owner, removed);
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-12-02 16:03:29 UTC (rev 11490)
@@ -12,6 +12,7 @@
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.Message;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.tree.TreeActionManager;
@@ -23,6 +24,16 @@
private String actionName;
+ private boolean sendRequired;
+
+ private boolean searchRequired = false;
+
+ @In
+ private User user;
+
+ @Out(required=false)
+ private Message message;
+
@In(create=true, required=true) @Out
private Album album;
@@ -71,6 +82,54 @@
}
}
+ public void initModalPanelData( String actionName, boolean sendRequired, Message message){
+ this.actionName = actionName;
+ this.sendRequired = sendRequired;
+ this.message = new Message();
+ this.message.setTheme("Re:" + message.getTheme());
+ this.message.setAuthor(user);
+ this.message.setOwner(message.getAuthor());
+ this.message.setReaded(false);
+ this.searchRequired = false;
+ }
+
+ public void initModalPanelData( String actionName, boolean sendRequired, Message message, boolean userSearchRequired){
+ this.actionName = actionName;
+ this.sendRequired = sendRequired;
+ this.searchRequired = userSearchRequired;
+ this.message = new Message();
+ this.message.setAuthor(user);
+ this.message.setReaded(false);
+ }
+
+ public void initMessage(boolean sendRequired, Message message){
+ this.sendRequired = sendRequired;
+ this.message = message;
+ this.searchRequired = false;
+ }
+
+ public void initModalPanelData( String actionName, boolean sendRequired, User owner){
+ this.actionName = actionName;
+ this.sendRequired = sendRequired;
+ this.message = new Message();
+ this.message.setAuthor(user);
+ this.message.setOwner(owner);
+ this.message.setReaded(false);
+ this.searchRequired = false;
+ }
+
+ public void initModalPanelData( String actionName, boolean sendRequired, User owner, String theme, String message){
+ this.actionName = actionName;
+ this.sendRequired = sendRequired;
+ this.message = new Message();
+ this.message.setAuthor(user);
+ this.message.setOwner(owner);
+ this.message.setReaded(false);
+ this.message.setTheme(theme);
+ this.message.setMessage(message);
+ this.searchRequired = false;
+ }
+
public void initModalPanelData( String actionName, String caption, Comment comment, User user, Image image){
this.caption = caption;
this.actionName = actionName;
@@ -111,4 +170,25 @@
public void editImage(ActionEvent event){
treeActionManager.editImage(this.image);
}
+
+ public void sendMessage(ActionEvent event){
+ this.message.setDate(new Date());
+ treeActionManager.sendMessage(this.message);
+ }
+
+ public boolean isSendRequired() {
+ return sendRequired;
+ }
+
+ public void setSendRequired(boolean sendRequired) {
+ this.sendRequired = sendRequired;
+ }
+
+ public boolean isSearchRequired() {
+ return searchRequired;
+ }
+
+ public void setSearchRequired(boolean searchRequired) {
+ this.searchRequired = searchRequired;
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml 2008-12-02 15:41:49 UTC (rev 11489)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml 2008-12-02 16:03:29 UTC (rev 11490)
@@ -20,4 +20,8 @@
<tag-name>comment</tag-name>
<source>templates/addComment.xhtml</source>
</tag>
+ <tag>
+ <tag-name>message</tag-name>
+ <source>templates/message.xhtml</source>
+ </tag>
</facelet-taglib>
\ No newline at end of file
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/readMessages.xhtml
===================================================================
(Binary files differ)
17 years, 6 months
JBoss Rich Faces SVN: r11489 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-02 10:41:49 -0500 (Tue, 02 Dec 2008)
New Revision: 11489
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messageBase.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messages.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
Log:
RF-5126
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml 2008-12-02 15:33:41 UTC (rev 11488)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml 2008-12-02 15:41:49 UTC (rev 11489)
@@ -6,60 +6,18 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
-<ui:composition template="#{templateBean.template}">
- <ui:define name="style">
-
+<ui:composition template="messageBase.xhtml">
+ <ui:define name="message">
+ <rich:message id="message" for="inputText"
+ ajaxRendered="#{messageBean.ajaxRendered}"
+ showSummary="#{messageBean.showSummary}"
+ showDetail="#{messageBean.showDetail}"
+ rendered="#{messageBean.rendered}"
+ styleClass="noname"
+ style="color: blue; text-decoration: underline;"
+ >
+ <ui:insert name="facets" />
+ </rich:message>
</ui:define>
- <ui:define name="component">
- <h:form id="attrForm">
- <h:outputText value="rendered" />
- <h:selectBooleanCheckbox id="rendered" value="#{messageBean.rendered}">
- <a4j:support event="onchange" />
- </h:selectBooleanCheckbox>
- <h:outputText value="showSummary" />
- <h:selectBooleanCheckbox id="showSummary" value="#{messageBean.showSummary}">
- <a4j:support event="onchange" />
- </h:selectBooleanCheckbox>
- <h:outputText value="showDetail" />
- <h:selectBooleanCheckbox id="showDetail" value="#{messageBean.showDetail}">
- <a4j:support event="onchange" />
- </h:selectBooleanCheckbox>
- <h:outputText value="ajaxRendered" />
- <h:selectBooleanCheckbox id="ajaxRendered" value="#{messageBean.ajaxRendered}">
- <a4j:support event="onchange" />
- </h:selectBooleanCheckbox>
- </h:form>
- <h:form id="mainForm">
- <h:panelGroup id="panel">
- <h:inputText id="inputText" value="#{messageBean.string}" validator="#{messageBean.validate}"></h:inputText>
- <rich:message id="message" for="inputText"
- ajaxRendered="false"
- showSummary="#{messageBean.showSummary}"
- showDetail="#{messageBean.showDetail}"
- rendered="#{messageBean.rendered}"
- styleClass="noname"
- style="color: blue; text-decoration: underline;"
- >
- <f:facet name="fatalMarker">
- <h:outputText id="fatalMarker" value="fatalMarker"></h:outputText>
- </f:facet>
- <f:facet name="errorMarker">
- <h:outputText id="errorMarker" value="errorMarker"></h:outputText>
- </f:facet>
- <f:facet name="warnMarker">
- <h:outputText id="warnMarker" value="warnMarker"></h:outputText>
- </f:facet>
- <f:facet name="infoMarker">
- <h:outputText id="infoMarker" value="infoMarker"></h:outputText>
- </f:facet>
- <f:facet name="passedMarker">
- <h:outputText id="passedMarker" value="passedMarker"></h:outputText>
- </f:facet>
- </rich:message>
- </h:panelGroup>
- <a4j:commandButton id="submit" value="Submit" reRender="panel"></a4j:commandButton>
- <a4j:commandButton id="submitWithoutReRender" value="submitWithoutReRender"></a4j:commandButton>
- </h:form>
- </ui:define>
</ui:composition>
</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messageBase.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messageBase.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messageBase.xhtml 2008-12-02 15:41:49 UTC (rev 11489)
@@ -0,0 +1,56 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="component">
+ <h:form id="attrForm">
+ <h:outputText value="rendered" />
+ <h:selectBooleanCheckbox id="rendered" value="#{messageBean.rendered}">
+ <a4j:support event="onchange" />
+ </h:selectBooleanCheckbox>
+ <h:outputText value="showSummary" />
+ <h:selectBooleanCheckbox id="showSummary" value="#{messageBean.showSummary}">
+ <a4j:support event="onchange" />
+ </h:selectBooleanCheckbox>
+ <h:outputText value="showDetail" />
+ <h:selectBooleanCheckbox id="showDetail" value="#{messageBean.showDetail}">
+ <a4j:support event="onchange" />
+ </h:selectBooleanCheckbox>
+ <h:outputText value="ajaxRendered" />
+ <h:selectBooleanCheckbox id="ajaxRendered" value="#{messageBean.ajaxRendered}">
+ <a4j:support event="onchange" />
+ </h:selectBooleanCheckbox>
+ </h:form>
+ <h:form id="mainForm">
+ <h:panelGroup id="panel">
+ <h:inputText id="inputText" value="#{messageBean.string}" validator="#{messageBean.validate}"></h:inputText>
+ <ui:insert name="message" />
+ </h:panelGroup>
+ <a4j:commandButton id="submit" value="Submit" reRender="panel"></a4j:commandButton>
+ <a4j:commandButton id="submitWithoutReRender" value="submitWithoutReRender"></a4j:commandButton>
+ </h:form>
+ </ui:define>
+ <ui:define name="facets">
+ <f:facet name="fatalMarker">
+ <h:outputText id="fatalMarker" value="fatalMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="errorMarker">
+ <h:outputText id="errorMarker" value="errorMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="warnMarker">
+ <h:outputText id="warnMarker" value="warnMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="infoMarker">
+ <h:outputText id="infoMarker" value="infoMarker"></h:outputText>
+ </f:facet>
+ <f:facet name="passedMarker">
+ <h:outputText id="passedMarker" value="passedMarker"></h:outputText>
+ </f:facet>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messages.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messages.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/messages.xhtml 2008-12-02 15:41:49 UTC (rev 11489)
@@ -0,0 +1,23 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="messageBase.xhtml">
+ <ui:define name="message">
+ <rich:messages id="message"
+ ajaxRendered="#{messageBean.ajaxRendered}"
+ showSummary="#{messageBean.showSummary}"
+ showDetail="#{messageBean.showDetail}"
+ rendered="#{messageBean.rendered}"
+ styleClass="noname"
+ style="color: blue; text-decoration: underline;"
+ >
+ <ui:insert name="facets" />
+ </rich:messages>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AbstractMessageTest.java 2008-12-02 15:41:49 UTC (rev 11489)
@@ -0,0 +1,124 @@
+package org.richfaces.testng;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public abstract class AbstractMessageTest extends SeleniumTestBase {
+
+ protected String mainForm;
+
+ protected String inputText;
+
+ protected String message;
+
+ private String submit;
+
+ private String rendered;
+
+ private String showDetail;
+
+ private String showSummary;
+
+ protected String ajaxRendered;
+
+ protected String label;
+
+ protected void init(Template template) {
+ renderPage(template, "#{messageBean.init}");
+ mainForm = getParentId() + "mainForm";
+ inputText = mainForm + ":inputText";
+ message = mainForm + ":message";
+ submit = mainForm + ":submit";
+ String attrForm = getParentId() + "attrForm";
+ rendered = attrForm + ":rendered";
+ showDetail = attrForm + ":showDetail";
+ showSummary = attrForm + ":showSummary";
+ ajaxRendered = attrForm + ":ajaxRendered";
+ }
+
+ /**
+ * style and classes, standard HTML attributes are output to client
+ */
+ @Test
+ public void testHTMLAttributes(Template template) {
+ init(template);
+ Map<String, String> styleAttributes = new HashMap<String, String>();
+ styleAttributes.put("color", "blue");
+ styleAttributes.put("text-decoration", "underline");
+ assertClassNames(message,new String [] {"noname"}, "Component's rendering invalid", true);
+ assertStyleAttributes(message, styleAttributes);
+ }
+
+ /**
+ * showDetail and showSummary attributes work
+ */
+ @Test
+ public void testShowDetailAndShowSummary(Template template) {
+ init(template);
+ Assert.assertTrue(selenium.getText(label).length() == 0);
+ selenium.type(inputText, "fatal");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue("messageDetail".equals(selenium.getText(label)));
+ clickAjaxCommandAndWait(showSummary);
+ selenium.type(inputText, "fatal");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue("messageSummarymessageDetail".equals(selenium.getText(label)));
+ clickAjaxCommandAndWait(showDetail);
+ selenium.type(inputText, "fatal");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue("messageSummary".equals(selenium.getText(label)));
+
+ }
+
+ /**
+ * level selects message of respective level
+ */
+ @Test
+ public void testLevel(Template template) {
+ //TODO
+ Assert.fail("This test should be completed after resolving bug RF-5107.");
+ }
+
+ /**
+ * check markers rendering
+ */
+ @Test
+ public void testMarkers(Template template) {
+ init(template);
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":passedMarker"));
+ selenium.type(inputText, "fatal");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":fatalMarker"));
+ selenium.type(inputText, "error");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":errorMarker"));
+ selenium.type(inputText, "warn");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":warnMarker"));
+ selenium.type(inputText, "info");
+ clickAjaxCommandAndWait(submit);
+ Assert.assertTrue(selenium.isElementPresent(mainForm + ":infoMarker"));
+ }
+
+ /**
+ * component with rendered = false is not present on the page
+ */
+ @Test
+ public void testRendered(Template template) {
+ init(template);
+ init(template);
+ Assert.assertTrue(selenium.isElementPresent(message), "ListShuttle must be rendered.");
+
+ selenium.click(rendered);
+ waitForAjaxCompletion();
+ clickAjaxCommandAndWait(submit);
+
+ Assert.assertFalse(selenium.isElementPresent(message), "ListShuttle mustn't be rendered.");
+ }
+
+}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2008-12-02 15:33:41 UTC (rev 11488)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2008-12-02 15:41:49 UTC (rev 11489)
@@ -1,89 +1,19 @@
package org.richfaces.testng;
-import java.util.HashMap;
-import java.util.Map;
-
import org.ajax4jsf.template.Template;
-import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
-public class MessageTest extends SeleniumTestBase {
-
- private String mainForm;
- private String inputText;
-
- private String message;
-
- private String submit;
-
- private String rendered;
-
- private String showDetail;
+public class MessageTest extends AbstractMessageTest {
- private String showSummary;
-
- private String ajaxRendered;
-
- private void init(Template template) {
- renderPage(template, "#{messageBean.init}");
- mainForm = getParentId() + "mainForm";
- inputText = mainForm + ":inputText";
- message = mainForm + ":message";
- submit = mainForm + ":submit";
- String attrForm = getParentId() + "attrForm";
- rendered = attrForm + ":rendered";
- showDetail = attrForm + ":showDetail";
- showSummary = attrForm + ":showSummary";
- ajaxRendered = attrForm + ":ajaxRendered";
- }
-
- /**
- * style and classes, standard HTML attributes are output to client
- */
- @Test
- public void testHTMLAttributes(Template template) {
- init(template);
- Map<String, String> styleAttributes = new HashMap<String, String>();
- styleAttributes.put("color", "blue");
- styleAttributes.put("text-decoration", "underline");
- assertClassNames(message,new String [] {"noname"}, "Component's rendering invalid", true);
- assertStyleAttributes(message, styleAttributes);
+ @Override
+ protected void init(Template template) {
+ super.init(template);
+ label = "xpath=id('" + message + "')/span[2]";
}
-
- /**
- * showDetail and showSummary attributes work
- */
- @Test
- public void testShowDetailAndShowSummary(Template template) {
- init(template);
- String locator = "xpath=id('" + message + "')/span[2]";
- Assert.assertTrue(selenium.getText(locator).length() == 0);
- selenium.type(inputText, "fatal");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue("messageDetail".equals(selenium.getText(locator)));
- clickAjaxCommandAndWait(showSummary);
- selenium.type(inputText, "fatal");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue("messageSummarymessageDetail".equals(selenium.getText(locator)));
- clickAjaxCommandAndWait(showDetail);
- selenium.type(inputText, "fatal");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue("messageSummary".equals(selenium.getText(locator)));
-
- }
-
+
/**
- * level selects message of respective level
- */
- @Test
- public void testLevel(Template template) {
- //TODO
- Assert.fail("This test should be completed after resolving bug RF-5107.");
- }
-
- /**
* ajaxRendered message output first message for attached component by ajax request
*/
@Test
@@ -98,44 +28,7 @@
Assert.assertTrue(selenium.isElementPresent(mainForm + ":fatalMarker"));
}
- /**
- * check markers rendering
- */
- @Test
- public void testMarkers(Template template) {
- init(template);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":passedMarker"));
- selenium.type(inputText, "fatal");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":fatalMarker"));
- selenium.type(inputText, "error");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":errorMarker"));
- selenium.type(inputText, "warn");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":warnMarker"));
- selenium.type(inputText, "info");
- clickAjaxCommandAndWait(submit);
- Assert.assertTrue(selenium.isElementPresent(mainForm + ":infoMarker"));
- }
-
- /**
- * component with rendered = false is not present on the page
- */
- @Test
- public void testRendered(Template template) {
- init(template);
- init(template);
- Assert.assertTrue(selenium.isElementPresent(message), "ListShuttle must be rendered.");
-
- selenium.click(rendered);
- waitForAjaxCompletion();
- clickAjaxCommandAndWait(submit);
-
- Assert.assertFalse(selenium.isElementPresent(message), "ListShuttle mustn't be rendered.");
- }
-
- @Override
+ @Override
public String getTestUrl() {
return "pages/message/message.xhtml";
}
Added: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessagesTest.java 2008-12-02 15:41:49 UTC (rev 11489)
@@ -0,0 +1,17 @@
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+
+public class MessagesTest extends AbstractMessageTest {
+
+ @Override
+ protected void init(Template template) {
+ super.init(template);
+ label = "xpath=id('" + message + "')/dt[1]/span[2]";
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/message/messages.xhtml";
+ }
+}
17 years, 6 months
JBoss Rich Faces SVN: r11488 - Reports/3.3.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-12-02 10:33:41 -0500 (Tue, 02 Dec 2008)
New Revision: 11488
Added:
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA1.xls
Modified:
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.xls
Log:
Added: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA1.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA1.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.xls
===================================================================
(Binary files differ)
17 years, 6 months
JBoss Rich Faces SVN: r11487 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-02 10:07:57 -0500 (Tue, 02 Dec 2008)
New Revision: 11487
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tree/treeTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java
Log:
https://jira.jboss.org/jira/browse/RF-4836
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/tree/treeTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java 2008-12-02 14:26:19 UTC (rev 11486)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/TreeTest.java 2008-12-02 15:07:57 UTC (rev 11487)
@@ -27,10 +27,15 @@
private final static String INIT_DRAG_AND_DROP_TEST = "#{treeBean.initDragAndDropTest}";
private final static String DRAG_AND_DROP_TEST_URL = "pages/tree/dragAndDropTest.xhtml";
+ static final Map<String, String> styles = new HashMap<String, String>();
+
static {
params.put("parameter1", "value1");
params.put("parameter2", "value2");
params.put("parameter3", "value3");
+
+ styles.put("font-size", "13px");
+ styles.put("font-weight", "bold");
}
@Test
@@ -503,6 +508,22 @@
assertChildNodesCount(--aguileraSongs, "//*[@id='"+ compId + ":childs']/div[2]/div", "Song is not dropped back");
}
+ @Test
+ public void testStyleAndClassesAreOutputToClient(Template template) {
+ renderPage(template, TEAR_DOWN_METHOD);
+
+ writeStatus("Check style and classes are output to client");
+ String compId = getParentId() + "_form:tree";
+
+ assertClassNames(compId, new String[] { "noclass" }, "Class attribute was not output to client", true);
+ assertStyleAttributes(compId, styles);
+
+ writeStatus("Check css class of highlighted tree node");
+ String aNodeXpath = "//*[@id='"+ compId + ":childs']/table[1]/tbody/tr/td[3]";
+ selenium.mouseOver(aNodeXpath);
+ assertClassAttributeContains(aNodeXpath, "highlighted-class", "highlightedClass attribute was not output to client");
+ }
+
@Override
public void sendAjax() {
AutoTester tester = getAutoTester(this);
17 years, 6 months
JBoss Rich Faces SVN: r11486 - in trunk/ui/editor/src/main: java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-02 09:26:19 -0500 (Tue, 02 Dec 2008)
New Revision: 11486
Modified:
trunk/ui/editor/src/main/config/component/editor.xml
trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
Log:
Bug fixing(RF-5055)
Modified: trunk/ui/editor/src/main/config/component/editor.xml
===================================================================
--- trunk/ui/editor/src/main/config/component/editor.xml 2008-12-02 13:26:14 UTC (rev 11485)
+++ trunk/ui/editor/src/main/config/component/editor.xml 2008-12-02 14:26:19 UTC (rev 11486)
@@ -149,7 +149,7 @@
</description>
</property>
<property>
- <name>customplugins</name>
+ <name>customPlugins</name>
<classname>java.lang.String</classname>
<description>
Attribute defines property file name witch contains descriptors of custom plugins
Modified: trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-12-02 13:26:14 UTC (rev 11485)
+++ trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-12-02 14:26:19 UTC (rev 11486)
@@ -112,7 +112,7 @@
public abstract String getCustomPlugins();
- public abstract void setCustomPlugins(String customplugins);
+ public abstract void setCustomPlugins(String customPlugins);
public abstract void setSkin(String skin);
17 years, 6 months
JBoss Rich Faces SVN: r11485 - trunk/ui/suggestionbox/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-12-02 08:26:14 -0500 (Tue, 02 Dec 2008)
New Revision: 11485
Modified:
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
Log:
https://jira.jboss.org/jira/browse/RF-4594
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-12-02 12:05:48 UTC (rev 11484)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-12-02 13:26:14 UTC (rev 11485)
@@ -117,7 +117,7 @@
Name of the CSS class for a suggestion entry element.
(table row)
</description>
- <defaultvalue>"richfaces_suggestionEntry"</defaultvalue>
+ <defaultvalue>""</defaultvalue>
</property>
<property>
<name>rowClasses</name>
@@ -171,7 +171,7 @@
Name of the CSS class for a selected suggestion entry
element (table cell)
</description>
- <defaultvalue>"richfaces_suggestionSelectValue"</defaultvalue>
+ <defaultvalue>""</defaultvalue>
</property>
<property>
<name>param</name>
17 years, 6 months
JBoss Rich Faces SVN: r11484 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-02 07:05:48 -0500 (Tue, 02 Dec 2008)
New Revision: 11484
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
Log:
RF-5125
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml 2008-12-02 11:18:44 UTC (rev 11483)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/message/message.xhtml 2008-12-02 12:05:48 UTC (rev 11484)
@@ -37,6 +37,8 @@
showSummary="#{messageBean.showSummary}"
showDetail="#{messageBean.showDetail}"
rendered="#{messageBean.rendered}"
+ styleClass="noname"
+ style="color: blue; text-decoration: underline;"
>
<f:facet name="fatalMarker">
<h:outputText id="fatalMarker" value="fatalMarker"></h:outputText>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2008-12-02 11:18:44 UTC (rev 11483)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/MessageTest.java 2008-12-02 12:05:48 UTC (rev 11484)
@@ -1,5 +1,8 @@
package org.richfaces.testng;
+import java.util.HashMap;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
@@ -37,6 +40,19 @@
}
/**
+ * style and classes, standard HTML attributes are output to client
+ */
+ @Test
+ public void testHTMLAttributes(Template template) {
+ init(template);
+ Map<String, String> styleAttributes = new HashMap<String, String>();
+ styleAttributes.put("color", "blue");
+ styleAttributes.put("text-decoration", "underline");
+ assertClassNames(message,new String [] {"noname"}, "Component's rendering invalid", true);
+ assertStyleAttributes(message, styleAttributes);
+ }
+
+ /**
* showDetail and showSummary attributes work
*/
@Test
17 years, 6 months