JBoss Rich Faces SVN: r2106 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-08-07 11:46:38 -0400 (Tue, 07 Aug 2007)
New Revision: 2106
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml
trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml
trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml
Log:
added styles for attributes
Modified: trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml 2007-08-07 15:45:17 UTC (rev 2105)
+++ trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml 2007-08-07 15:46:38 UTC (rev 2106)
@@ -84,8 +84,15 @@
<section>
<title>Details of Usage</title>
- <para>All attributes except "value" are optional. The "value" attribute defines text to be
- represented. If you can use the "label" facet, you can even not use the "value" attribute.</para>
+ <para>All attributes except <emphasis>
+ <property>"value"</property>
+ </emphasis> are optional. The <emphasis>
+ <property>"value"</property>
+ </emphasis> attribute defines text to be represented. If you can use the <emphasis>
+ <property>"label"</property>
+ </emphasis> facet, you can even not use the <emphasis>
+ <property>"value"</property>
+ </emphasis> attribute.</para>
<para>Here is an example:</para>
@@ -100,8 +107,10 @@
...
</programlisting>
- <para>Use the "event" attribute to define an event for the represented element that triggers a
- menu appearance. An example of a menu appearance on a click can be seen below.</para>
+ <para>Use the <emphasis>
+ <property>"event"</property>
+ </emphasis> attribute to define an event for the represented element that triggers a menu
+ appearance. An example of a menu appearance on a click can be seen below.</para>
<para>
@@ -115,7 +124,10 @@
<para>The <emphasis role="bold">
<property><rich:dropDownMenu></property>
- </emphasis> "mode" attribute can be set to three possible parameters:</para>
+ </emphasis>
+ <emphasis>
+ <property>"mode"</property>
+ </emphasis> attribute can be set to three possible parameters:</para>
<itemizedlist>
<listitem>
@@ -131,8 +143,9 @@
</listitem>
</itemizedlist>
- <para>An AJAX form submission is performed, and specified elements in the "reRender" attribute
- are rerendered.</para>
+ <para>An AJAX form submission is performed, and specified elements in the <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute are rerendered.</para>
<itemizedlist>
<listitem>
@@ -140,18 +153,27 @@
</listitem>
</itemizedlist>
- <para>The "action" and "actionListener" item's attributes are ignored. Menu items don't fire any
- submits themselves. The behavior is fully defined by the components nested inside items.</para>
+ <para>The <emphasis>
+ <property>"action"</property>
+ </emphasis> and <emphasis>
+ <property>"actionListener"</property>
+ </emphasis> item's attributes are ignored. Menu items don't fire any submits themselves. The
+ behavior is fully defined by the components nested inside items.</para>
<note><title>Note:</title> As the <emphasis role="bold">
<property><rich:dropDownMenu></property>
</emphasis> component doesn't provide its own form, use it between <h:form> and
</h:form> tags.</note>
- <para>The "direction" and "jointPoint" attributes are used for defining aspects of menu
- appearance.</para>
+ <para>The <emphasis>
+ <property>"direction"</property>
+ </emphasis> and <emphasis>
+ <property>"jointPoint"</property>
+ </emphasis> attributes are used for defining aspects of menu appearance.</para>
- <para>Possible values for the "direction" attribute are:</para>
+ <para>Possible values for the <emphasis>
+ <property>"direction"</property>
+ </emphasis> attribute are:</para>
<itemizedlist>
<listitem>
@@ -175,7 +197,9 @@
</listitem>
</itemizedlist>
- <para>Possible values for the "jointPoint" attribute are:</para>
+ <para>Possible values for the <emphasis>
+ <property>"jointPoint"</property>
+ </emphasis> attribute are:</para>
<itemizedlist>
<listitem>
@@ -199,7 +223,13 @@
</listitem>
</itemizedlist>
- <para>By default, the "direction" and "jointPoint" attributes are set to "auto".</para>
+ <para>By default, the <emphasis>
+ <property>"direction"</property>
+ </emphasis> and <emphasis>
+ <property>"jointPoint"</property>
+ </emphasis> attributes are set to <emphasis>
+ <property>"auto"</property>
+ </emphasis>.</para>
<para>Here is an example:</para>
@@ -217,7 +247,7 @@
<para>This is the result:</para>
<figure>
- <title>Using the "direction" and "joinPoint" attributes</title>
+ <title>Using the "direction" and"joinPoint" attributes</title>
<mediaobject>
<imageobject>
@@ -227,7 +257,11 @@
</figure>
<para>You can correct an offset of the pop-up list relative to the label using the following
- attributes: "horizontalOffset" and "verticalOffset".</para>
+ attributes: <emphasis>
+ <property>"horizontalOffset"</property>
+ </emphasis> and <emphasis>
+ <property>"verticalOffset"</property>
+ </emphasis>.</para>
<para>Here is an example:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml 2007-08-07 15:45:17 UTC (rev 2105)
+++ trunk/docs/userguide/en/src/main/docbook/included/menuGroup.xml 2007-08-07 15:46:38 UTC (rev 2106)
@@ -2,51 +2,51 @@
<section>
<sectioninfo>
<keywordset>
- <keyword>menuGroup</keyword>
+ <keyword>menuGroup</keyword>
</keywordset>
</sectioninfo>
-
- <table>
- <title>Component identification parameters</title>
+
+ <table>
+ <title>Component identification parameters</title>
<tgroup cols="2">
<thead>
<row>
- <entry>Name</entry>
- <entry>Value</entry>
+ <entry>Name</entry>
+ <entry>Value</entry>
</row>
</thead>
<tbody>
- <row>
- <entry>component-type</entry>
- <entry>org.richfaces.MenuGroup</entry>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.MenuGroup</entry>
</row>
- <row>
+ <row>
<entry>component-class</entry>
<entry>oorg.richfaces.component.html.HtmlMenuGroup</entry>
</row>
- <row>
+ <row>
<entry>component-family</entry>
<entry>org.richfaces.DropDownMenu</entry>
</row>
- <row>
+ <row>
<entry>renderer-type</entry>
<entry>org.richfaces.MenuGroupRenderer</entry>
</row>
- <row>
+ <row>
<entry>tag-class</entry>
<entry>org.richfaces.taglib.MenuGroupTag</entry>
</row>
</tbody>
</tgroup>
</table>
-
+
<section>
- <title>Creating the Component with a Page Tag</title>
+ <title>Creating the Component with a Page Tag</title>
<para>Here is a simple example as it might be used in a page:</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
<programlisting role="xml"><![CDATA[...
<rich:dropDownMenu value="Active">
...
@@ -58,103 +58,134 @@
...
]]></programlisting>
</section>
-
+
<section>
<title>Creating the Component Dynamically Using Java</title>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
<programlisting role="java"><![CDATA[...
org.richfaces.component.html.HtmlMenuGroup myGroup = new org.richfaces.component.html.HtmlMenuGroup ();
...
]]></programlisting>
</section>
-
+
<section>
<title>Details of Usage</title>
- <para>
- The "value" attribute defines the text representation of a group element in the page.
- </para>
- <para>
- The "icon" attribute defines an icon for the component. The "iconDisabled" attribute defines an icon for when the group is disabled. Also you can use the "icon" and "iconDisabled" facets. If the facets are defined, the corresponding "icon" and "iconDisabled" attributes are ignored and the facets' contents are used as icons. This could be used for an item check box implementation.
- </para>
- <para>
- Here is an example:
- </para>
+ <para> The <emphasis>
+ <property>"value"</property>
+ </emphasis> attribute defines the text representation of a group element in the page. </para>
+ <para> The <emphasis>
+ <property>"icon"</property>
+ </emphasis> attribute defines an icon for the component. The <emphasis>
+ <property>"iconDisabled"</property>
+ </emphasis> attribute defines an icon for when the group is disabled. Also you can use
+ the <emphasis>
+ <property>"icon"</property>
+ </emphasis> and <emphasis>
+ <property>"iconDisabled"</property>
+ </emphasis> facets. If the facets are defined, the corresponding <emphasis>
+ <property>"icon"</property>
+ </emphasis> and <emphasis>
+ <property>"iconDisabled"</property>
+ </emphasis> attributes are ignored and the facets' contents are used as icons.
+ This could be used for an item check box implementation. </para>
+ <para> Here is an example: </para>
<programlisting role="xml"><![CDATA[...
<f:facet name="icon">
<h:selectBooleanCheckbox value="#{bean.property}"/>
</f:facet>
...
]]></programlisting>
- <para>
- The "iconFolder" and "iconFolderDisabled" attributes are defined for using icons as folder icons. The "iconFolder" and "iconFolderDisabled" facets use their contents as folder icon representations in place of the attribute values.
- </para>
- <para>
- The "direction" attribute is used to define which way to display the menu as shown in the example below:
- </para>
+ <para> The <emphasis>
+ <property>"iconFolder"</property>
+ </emphasis> and <emphasis>
+ <property>"iconFolderDisabled"</property>
+ </emphasis> attributes are defined for using icons as folder icons. The <emphasis>
+ <property>"iconFolder"</property>
+ </emphasis> and <emphasis>
+ <property>"iconFolderDisabled"</property>
+ </emphasis> facets use their contents as folder icon representations in place of the
+ attribute values. </para>
+ <para> The <emphasis>
+ <property>"direction"</property>
+ </emphasis> attribute is used to define which way to display the menu as shown in the
+ example below: </para>
<para>Possible values are:</para>
<itemizedlist>
- <listitem><para>left - down - a submenu is attached to the left side of the menu and is dropping down</para></listitem>
- <listitem><para>left - up - a submenu is attached to the left side of the menu and is dropping up</para></listitem>
- <listitem><para>right - down - a submenu is attached to the right side of the menu and is dropping down</para></listitem>
- <listitem><para>right - up - a submenu is attached to the right side of the menu and is dropping up</para></listitem>
- <listitem><para>auto - smart positioning activation</para></listitem>
+ <listitem>
+ <para>left - down - a submenu is attached to the left side of the menu and is
+ dropping down</para>
+ </listitem>
+ <listitem>
+ <para>left - up - a submenu is attached to the left side of the menu and is dropping
+ up</para>
+ </listitem>
+ <listitem>
+ <para>right - down - a submenu is attached to the right side of the menu and is
+ dropping down</para>
+ </listitem>
+ <listitem>
+ <para>right - up - a submenu is attached to the right side of the menu and is
+ dropping up</para>
+ </listitem>
+ <listitem>
+ <para>auto - smart positioning activation</para>
+ </listitem>
</itemizedlist>
- <para>
- By default, the "direction" attribute is set to "auto".
- </para>
- <para>
- Here is an example:
- </para>
+ <para> By default, the <emphasis>
+ <property>"direction"</property>
+ </emphasis> attribute is set to <emphasis>
+ <property>"auto"</property>
+ </emphasis>. </para>
+ <para> Here is an example: </para>
<programlisting role="xml"><![CDATA[...
<rich:menuGroup value="Active" direction="left-down"
<!--Nested menu components-->
</rich:menuGroup>
...
]]></programlisting>
- <para>
- This would be the result:
- </para>
+ <para> This would be the result: </para>
<figure>
- <title>Using the "direction" attribute</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/menuGroup2.png" />
- </imageobject>
- </mediaobject>
- </figure>
- </section>
+ <title>Using the "direction" attribute</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/menuGroup2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
- <section>
- <title>Look-and-Feel Customization</title>
- <para>
- For skinnability implementation, the components use a style class redefinition method. Default style classes are mapped on skin parameters.
- </para>
- <para>
- There are two ways to redefine the appearance of all menu groups at once:
- </para>
+ <section>
+ <title>Look-and-Feel Customization</title>
+ <para> For skinnability implementation, the components use a style class redefinition
+ method. Default style classes are mapped on skin parameters. </para>
+ <para> There are two ways to redefine the appearance of all menu groups at once: </para>
<itemizedlist>
- <listitem><para>Redefine corresponding skin parameters</para></listitem>
- <listitem><para>Add to user's styles heet style classes used by a menu group</para></listitem>
+ <listitem>
+ <para>Redefine corresponding skin parameters</para>
+ </listitem>
+ <listitem>
+ <para>Add to user's styles heet style classes used by a menu group</para>
+ </listitem>
</itemizedlist>
- </section>
- <section>
- <title>Skin parameters redefinition</title>
+ </section>
+ <section>
+ <title>Skin parameters redefinition</title>
<table>
- <title>Label Skin parameters redefinition</title>
+ <title>Label Skin parameters redefinition</title>
<tgroup cols="2">
<thead>
<row>
- <entry>Skin parameters for group</entry>
- <entry>CSS properties</entry>
+ <entry>Skin parameters for group</entry>
+ <entry>CSS properties</entry>
</row>
</thead>
<tbody>
<row>
- <entry>generalFamilyFont</entry>
- <entry>font-family</entry>
+ <entry>generalFamilyFont</entry>
+ <entry>font-family</entry>
</row>
<row>
<entry>generalSizeFont</entry>
@@ -164,9 +195,9 @@
</tgroup>
</table>
<table>
- <title>Label Skin parameters redefinition</title>
+ <title>Label Skin parameters redefinition</title>
<tgroup cols="2">
- <thead>
+ <thead>
<row>
<entry>Skin parameters for disabled group</entry>
<entry>CSS properties</entry>
@@ -180,11 +211,11 @@
</tbody>
</tgroup>
</table>
-
+
<table>
- <title>Label Skin parameters redefinition</title>
+ <title>Label Skin parameters redefinition</title>
<tgroup cols="2">
- <thead>
+ <thead>
<row>
<entry>Skin parameters for text label</entry>
<entry>CSS properties</entry>
@@ -197,84 +228,80 @@
</row>
</tbody>
</tgroup>
- </table>
-</section>
+ </table>
+ </section>
-<section>
- <title> Definition custom style classes </title>
- <para>
- The classes names that define group element appearance are in the screenshot.
- </para>
- <figure>
- <title>Classes names</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/menuGroup3.png" />
- </imageobject>
- </mediaobject>
- </figure>
- <table>
- <title>Classes names that define group element appearance.</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Rich-menu-group</entry>
- <entry>Defines the class for wrapping div element for the whole group</entry>
- </row>
- <row>
- <entry>Rich-menu-item-label</entry>
- <entry>Defines properties for the text</entry>
- </row>
- <row>
- <entry>Rich-menu-item-icon</entry>
- <entry>Defines properties for the left icon element</entry>
- </row>
- <row>
- <entry>Rich-menu-item-folder</entry>
- <entry>Defines properties for the right icon element</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>
- All listed elements except for the general one are defined for disabled mode.
- </para>
- <table>
- <title>Classes names for disabled mode</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Class name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>Rich-menu-item-label-disabled</entry>
- <entry>Defines properties for the text</entry>
- </row>
- <row>
- <entry>Rich-menu-item-icon-disabled</entry>
- <entry>Defines properties for the left icon element</entry>
- </row>
- <row>
- <entry>Rich-menu-item-folder-disabled</entry>
- <entry>Defines properties for the right icon element</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>
- In order to redefine the style for all menu groups on a page using CSS, it's enough to create classes with the same names and define the necessary properties in them.
- </para>
- <para>
- To change style aspects of particular panel menu groups define your own style classes in the corresponding menuGroup attributes.
- </para>
+ <section>
+ <title> Definition custom style classes </title>
+ <para> The classes names that define group element appearance are in the screenshot. </para>
+ <figure>
+ <title>Classes names</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/menuGroup3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <table>
+ <title>Classes names that define group element appearance.</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Rich-menu-group</entry>
+ <entry>Defines the class for wrapping div element for the whole
+ group</entry>
+ </row>
+ <row>
+ <entry>Rich-menu-item-label</entry>
+ <entry>Defines properties for the text</entry>
+ </row>
+ <row>
+ <entry>Rich-menu-item-icon</entry>
+ <entry>Defines properties for the left icon element</entry>
+ </row>
+ <row>
+ <entry>Rich-menu-item-folder</entry>
+ <entry>Defines properties for the right icon element</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para> All listed elements except for the general one are defined for disabled mode. </para>
+ <table>
+ <title>Classes names for disabled mode</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Rich-menu-item-label-disabled</entry>
+ <entry>Defines properties for the text</entry>
+ </row>
+ <row>
+ <entry>Rich-menu-item-icon-disabled</entry>
+ <entry>Defines properties for the left icon element</entry>
+ </row>
+ <row>
+ <entry>Rich-menu-item-folder-disabled</entry>
+ <entry>Defines properties for the right icon element</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para> In order to redefine the style for all menu groups on a page using CSS, it's
+ enough to create classes with the same names and define the necessary properties in
+ them. </para>
+ <para> To change style aspects of particular panel menu groups define your own style classes
+ in the corresponding menuGroup attributes. </para>
+ </section>
</section>
-</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml 2007-08-07 15:45:17 UTC (rev 2105)
+++ trunk/docs/userguide/en/src/main/docbook/included/menuItem.xml 2007-08-07 15:46:38 UTC (rev 2106)
@@ -1,52 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<section>
<sectioninfo>
- <keywordset>
- <keyword>menuItem</keyword>
+ <keywordset>
+ <keyword>menuItem</keyword>
</keywordset>
</sectioninfo>
-
- <table>
- <title>Component identification parameters</title>
+
+ <table>
+ <title>Component identification parameters</title>
<tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Value</entry>
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
</row>
</thead>
- <tbody>
- <row>
- <entry>component-type</entry>
- <entry>org.richfaces.MenuItem</entry>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.richfaces.MenuItem</entry>
</row>
- <row>
+ <row>
<entry>component-class</entry>
<entry>org.richfaces.component.html.HtmlMenuItem</entry>
</row>
- <row>
+ <row>
<entry>component-family</entry>
<entry>org.richfaces.DropDownMenu</entry>
</row>
- <row>
+ <row>
<entry>renderer-type</entry>
<entry>org.richfaces.MenuItemRenderer</entry>
</row>
- <row>
+ <row>
<entry>tag-class</entry>
<entry>org.richfaces.taglib.MenuItemTag</entry>
</row>
</tbody>
</tgroup>
</table>
-
+
<section>
- <title>Creating the Component with a Page Tag</title>
+ <title>Creating the Component with a Page Tag</title>
<para>Here is a simple example as it might be used in a page:</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
<programlisting role="xml"><![CDATA[...
<rich:dropDownMenu>
...
@@ -56,72 +56,89 @@
...
]]></programlisting>
</section>
-
+
<section>
<title>Creating the Component Dynamically Using Java</title>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
<programlisting role="java"><![CDATA[...
org.richfaces.component.html.HtmlMenuItem myItem = new org.richfaces.component.html.HtmlMenuItem ();
...]]></programlisting>
</section>
-
+
<section>
<title>Details of Usage</title>
- <para>
- The "value" attribute defines the text representation for an item element.
- </para>
- <para>
- There are two icon-related attributes. The "icon" attribute defines an icon. The "iconDisabled" attribute defines an icon for a disabled item. Also you can use the "icon" and "iconDisabled" facets. If the facets are defined, the corresponding "icon" and "iconDisabled" attributes are ignored and the facets content is shown as an icon. It could be used for an item check box implementation.
- </para>
- <para>
- Here is an example:
- </para>
+ <para> The <emphasis>
+ <property>"value"</property>
+ </emphasis> attribute defines the text representation for an item element. </para>
+ <para> There are two icon-related attributes. The <emphasis>
+ <property>"icon"</property>
+ </emphasis> attribute defines an icon. The <emphasis>
+ <property>"iconDisabled"</property>
+ </emphasis> attribute defines an icon for a disabled item. Also you can use the <emphasis>
+ <property>"icon"</property>
+ </emphasis> and <emphasis>
+ <property>"iconDisabled"</property>
+ </emphasis> facets. If the facets are defined, the corresponding <emphasis>
+ <property>"icon"</property>
+ </emphasis> and <emphasis>
+ <property>"iconDisabled"</property>
+ </emphasis> attributes are ignored and the facets content is shown as an icon. It could
+ be used for an item check box implementation. </para>
+ <para> Here is an example: </para>
<programlisting role="xml"><![CDATA[...
<f:facet name="icon">
<h:selectBooleanCheckbox value="#{bean.property}"/>
</f:facet>
...
]]></programlisting>
-
- <para>The <emphasis role="bold"><property><rich: menuItem></property></emphasis> "mode" attribute can be set to three
- possible parameters:</para>
- <itemizedlist>
- <listitem>
- <para>Server (default)</para>
- </listitem>
- </itemizedlist>
+ <para>The <emphasis role="bold">
+ <property><rich: menuItem></property>
+ </emphasis>
+ <emphasis>
+ <property>"mode"</property>
+ </emphasis> attribute can be set to three possible parameters:</para>
- <para>The standard form submission is performed and the page is completely
- refreshed.</para>
+ <itemizedlist>
+ <listitem>
+ <para>Server (default)</para>
+ </listitem>
+ </itemizedlist>
- <itemizedlist>
- <listitem>
- <para>Ajax</para>
- </listitem>
- </itemizedlist>
+ <para>The standard form submission is performed and the page is completely refreshed.</para>
- <para>An AJAX form submission is performed, and specified elements in the
- "reRender" attribute are rerendered.</para>
+ <itemizedlist>
+ <listitem>
+ <para>Ajax</para>
+ </listitem>
+ </itemizedlist>
- <itemizedlist>
- <listitem>
- <para>None</para>
- </listitem>
- </itemizedlist>
+ <para>An AJAX form submission is performed, and specified elements in the <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute are rerendered.</para>
- <para>The "action" and "actionListener" item's attributes are ignored.
- Menu items don't fire any submits themselves. The behavior is fully
- defined by the components nested inside items.</para>
- <para>
- For example, you can put any content into an item, but, in this case, you should set the "mode" attribute as "none".
- </para>
- <para>
- Here is an example:
- </para>
+ <itemizedlist>
+ <listitem>
+ <para>None</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>The <emphasis>
+ <property>"action"</property>
+ </emphasis> and <emphasis>
+ <property>"actionListener"</property>
+ </emphasis> item's attributes are ignored. Menu items don't fire any submits themselves.
+ The behavior is fully defined by the components nested inside items.</para>
+ <para> For example, you can put any content into an item, but, in this case, you should set
+ the <emphasis>
+ <property>"mode"</property>
+ </emphasis> attribute as <emphasis>
+ <property>"none"</property>
+ </emphasis>. </para>
+ <para> Here is an example: </para>
<programlisting role="xml"><![CDATA[...
<rich:dropDownMenu>
...
@@ -132,142 +149,139 @@
<rich:dropDownMenu>
...
]]></programlisting>
- <para>
- You can use the "disabled" attribute to set the item state.
- </para>
- <para>
- Here is an example:
- </para>
+ <para> You can use the <emphasis>
+ <property>"disabled"</property>
+ </emphasis> attribute to set the item state. </para>
+ <para> Here is an example: </para>
<programlisting role="xml"><![CDATA[...
<rich:dropDownMenu>
<rich:menuItem value="Disable" disabled="true"/>
<rich:dropDownMenu>
...
]]></programlisting>
- </section>
+ </section>
<section>
<title> Look-and-Feel Customization</title>
- <para>
- For skinnability implementation, the components use a style class redefinition method. Default style classes are mapped on skin parameters.
- </para>
- <para>
- There are two ways to redefine the appearance of all menuItems at once:
- </para>
- <itemizedlist>
- <listitem><para>Redefine the corresponding skin parameters</para></listitem>
- <listitem><para>Add to user's style sheets style classes used by a menuItem</para></listitem>
- </itemizedlist>
- </section>
- <section>
- <title>Skin parameters redefinition</title>
- <table>
- <title>Label skin parameters redefinition</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Skin parameters for item</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>Label skin parameters redefinition</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Skin parameters for hovered item</entry>
- <entry>CSS properties</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>tipBorderColor</entry>
- <entry>border-color</entry>
- </row>
- <row>
- <entry>tipBackgroundColor</entry>
- <entry>background-color</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table>
- <title>Label skin parameters redefinition</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Skin parameters for disabled item</entry>
- <entry>CSS properties</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>tabDisabledTextColor</entry>
- <entry>color</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <table>
- <title>Label skin parameters redefinition</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Skin parameters for text element label</entry>
- <entry>CSS properties</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>generalTextColor</entry>
- <entry>color</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ <para> For skinnability implementation, the components use a style class redefinition
+ method. Default style classes are mapped on skin parameters. </para>
+ <para> There are two ways to redefine the appearance of all menuItems at once: </para>
+ <itemizedlist>
+ <listitem>
+ <para>Redefine the corresponding skin parameters</para>
+ </listitem>
+ <listitem>
+ <para>Add to user's style sheets style classes used by a menuItem</para>
+ </listitem>
+ </itemizedlist>
</section>
-
<section>
+ <title>Skin parameters redefinition</title>
+ <table>
+ <title>Label skin parameters redefinition</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters for item</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>Label skin parameters redefinition</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters for hovered item</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>tipBorderColor</entry>
+ <entry>border-color</entry>
+ </row>
+ <row>
+ <entry>tipBackgroundColor</entry>
+ <entry>background-color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Label skin parameters redefinition</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters for disabled item</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>tabDisabledTextColor</entry>
+ <entry>color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table>
+ <title>Label skin parameters redefinition</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Skin parameters for text element label</entry>
+ <entry>CSS properties</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>generalTextColor</entry>
+ <entry>color</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section>
<title> Definition of Custom Style Classes </title>
- <para>
- In the screenshot, the classes names that define item element appearance are shown.
- </para>
+ <para> In the screenshot, the classes names that define item element appearance are shown. </para>
<figure>
- <title>Class names</title>
+ <title>Class names</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/menuItem2.png" />
+ <imagedata fileref="images/menuItem2.png"/>
</imageobject>
</mediaobject>
</figure>
<table>
- <title>Class names that define item element appearance.</title>
+ <title>Class names that define item element appearance.</title>
<tgroup cols="2">
<thead>
<row>
- <entry>Class name</entry>
- <entry>Description</entry>
+ <entry>Class name</entry>
+ <entry>Description</entry>
</row>
</thead>
<tbody>
<row>
- <entry>Rich-menu-item</entry>
- <entry>Defines the class for wrapping div element for the whole item</entry>
+ <entry>Rich-menu-item</entry>
+ <entry>Defines the class for wrapping div element for the whole item</entry>
</row>
<row>
<entry>Rich-menu-item-label</entry>
@@ -280,22 +294,21 @@
</tbody>
</tgroup>
</table>
- <para>
- All listed elements except the general ones are defined for disabled, enabled, and hovered modes.
- </para>
+ <para> All listed elements except the general ones are defined for disabled, enabled, and
+ hovered modes. </para>
<table>
- <title>Class names for modes</title>
+ <title>Class names for modes</title>
<tgroup cols="2">
<thead>
<row>
- <entry>Class name</entry>
- <entry>Description</entry>
+ <entry>Class name</entry>
+ <entry>Description</entry>
</row>
</thead>
<tbody>
<row>
- <entry>Rich-menu-item-disabled</entry>
- <entry>Defines the class for wrapping div element for the whole item</entry>
+ <entry>Rich-menu-item-disabled</entry>
+ <entry>Defines the class for wrapping div element for the whole item</entry>
</row>
<row>
<entry>Rich-menu-item-enabled</entry>
@@ -305,7 +318,7 @@
<entry>Rich-menu-item-hover</entry>
<entry>Defines the class for wrapping div element for the whole item</entry>
</row>
-
+
<row>
<entry>Rich-menu-item-label-disabled</entry>
<entry>Defines properties for the text</entry>
@@ -333,12 +346,10 @@
</tbody>
</tgroup>
</table>
- <para>
- In order to redefine the style for all menuItems on a page using CSS, it's enough to create classes with the same names and define the necessary properties in them.
- </para>
- <para>
- To change the style of particular menuItems define your own style classes in the corresponding menuItem attributes.
- </para>
+ <para> In order to redefine the style for all menuItems on a page using CSS, it's
+ enough to create classes with the same names and define the necessary properties in
+ them. </para>
+ <para> To change the style of particular menuItems define your own style classes in the
+ corresponding menuItem attributes. </para>
</section>
</section>
-
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml 2007-08-07 15:45:17 UTC (rev 2105)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml 2007-08-07 15:46:38 UTC (rev 2106)
@@ -83,9 +83,12 @@
<title>Details of Usage</title>
<para>All attributes are not required.</para>
- <para>Use "event" attribute to define an event for appearance of
- collapsing/expanding sublevels. Default value is "onclick". An example could
- be seen below.</para>
+ <para>Use <emphasis>
+ <property>"event"</property>
+ </emphasis> attribute to define an event for appearance of collapsing/expanding sublevels.
+ Default value is <emphasis>
+ <property>"onclick"</property>
+ </emphasis>. An example could be seen below.</para>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -96,13 +99,19 @@
</rich:panelMenu>
...</programlisting>
- <para>Switching mode could be chosen with the "mode" attribute for all
- panelMenu items except ones where this attribute was redefined. By default all items send
- traditional request. </para>
- <para>The "expandMode" attribute defines the submission modes for all
- collapsing/expanding panelMenu groups except ones where this attribute was redefined. </para>
- <para>The "mode" and "expandMode" attributes could be used
- with three possible parameters.</para>
+ <para>Switching mode could be chosen with the <emphasis>
+ <property>"mode"</property>
+ </emphasis> attribute for all panelMenu items except ones where this attribute was redefined.
+ By default all items send traditional request. </para>
+ <para>The <emphasis>
+ <property>"expandMode"</property>
+ </emphasis> attribute defines the submission modes for all collapsing/expanding panelMenu
+ groups except ones where this attribute was redefined. </para>
+ <para>The <emphasis>
+ <property>"mode"</property>
+ </emphasis> and <emphasis>
+ <property>"expandMode"</property>
+ </emphasis> attributes could be used with three possible parameters.</para>
<itemizedlist>
<listitem>
@@ -118,8 +127,9 @@
</listitem>
</itemizedlist>
- <para>An Ajax form submission is performed additionally specified elements in the
- "reRender" attribute are reRendered.</para>
+ <para>An Ajax form submission is performed additionally specified elements in the <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute are reRendered.</para>
<itemizedlist>
<listitem>
@@ -127,9 +137,12 @@
</listitem>
</itemizedlist>
- <para>"Action" and "ActionListener" attributes are ignored.
- Items don't fire any submits itself. Behavior is fully defined by the components
- nested to items. Groups expand on the client side.</para>
+ <para><emphasis>
+ <property>"Action"</property>
+ </emphasis> and <emphasis>
+ <property>"ActionListener"</property>
+ </emphasis> attributes are ignored. Items don't fire any submits itself. Behavior is
+ fully defined by the components nested to items. Groups expand on the client side.</para>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -147,10 +160,13 @@
</emphasis> component doesn't provide its own form, use it between
<h:form> and </h:form> tags.</note>
- <para>The "expandSingle" attribute is defined for expanding more than one
- submenu on the same level. The default value is "false". If it's
- true the previously opened group on the top level closes before opening another one. See the
- picture below.</para>
+ <para>The <emphasis>
+ <property>"expandSingle"</property>
+ </emphasis> attribute is defined for expanding more than one submenu on the same level. The
+ default value is <emphasis>
+ <property>"false"</property>
+ </emphasis>. If it's true the previously opened group on the top level closes before
+ opening another one. See the picture below.</para>
<figure>
<title>Using the "expandSingle" attribute</title>
@@ -162,8 +178,10 @@
</mediaobject>
</figure>
- <para>The "selectedChild" attribute is used for defining the name of the
- selected group or item. An example for group is placed below:</para>
+ <para>The <emphasis>
+ <property>"selectedChild"</property>
+ </emphasis> attribute is used for defining the name of the selected group or item. An example
+ for group is placed below:</para>
<para>Here is an example:</para>
@@ -181,8 +199,8 @@
<section>
<title>JavaScript API</title>
- <para>In Java Script code for expanding/collapsing group element creation it's necessary to use
- doExpand()/doCollapse() function.</para>
+ <para>In Java Script code for expanding/collapsing group element creation it's
+ necessary to use doExpand()/doCollapse() function.</para>
<table>
<title>JavaScript API</title>
@@ -218,10 +236,11 @@
<section>
<title>Look-and-Feel Customization</title>
- <para>As this component is just a wrapper for its children its provide the only "rich-panel-menu"
- class for wrapper div element. To redefine appearance of particular panel menus, it's possible
- to define your own CSS class. And then just define it in the components class attribute. </para>
-
+ <para>As this component is just a wrapper for its children its provide the only
+ "rich-panel-menu" class for wrapper div element. To redefine appearance of
+ particular panel menus, it's possible to define your own CSS class. And then just
+ define it in the components class attribute. </para>
+
</section>
</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml 2007-08-07 15:45:17 UTC (rev 2105)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenuGroup.xml 2007-08-07 15:46:38 UTC (rev 2106)
@@ -84,11 +84,17 @@
<section>
<title>Details of Usage</title>
- <para>All attributes except "label" are optional. The
- "label" attribute defines text to be represented.</para>
- <para>Switching mode could be chosen with the "expandMode" attribute for the
- concrete panelMenu group.</para>
- <para>The "expandMode" attribute could be used with three possible parameters:</para>
+ <para>All attributes except <emphasis>
+ <property>"label"</property>
+ </emphasis> are optional. The <emphasis>
+ <property>"label"</property>
+ </emphasis> attribute defines text to be represented.</para>
+ <para>Switching mode could be chosen with the<emphasis>
+ <property> "expandMode"</property>
+ </emphasis> attribute for the concrete panelMenu group.</para>
+ <para>The <emphasis>
+ <property>"expandMode"</property>
+ </emphasis> attribute could be used with three possible parameters:</para>
<itemizedlist>
<listitem>
@@ -104,8 +110,9 @@
</listitem>
</itemizedlist>
- <para>Ajax form submission is performed additionally specified elements in the
- "reRender" attribute are reRendered.</para>
+ <para>Ajax form submission is performed additionally specified elements in the <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute are reRendered.</para>
<itemizedlist>
<listitem>
@@ -113,14 +120,20 @@
</listitem>
</itemizedlist>
- <para>"Action" and "ActionListener" attributes are ignored.
- Items don't fire any submits itself. Behavior is fully defined by the components
- nested to items.</para>
+ <para><emphasis>
+ <property>"Action"</property>
+ </emphasis> and <emphasis>
+ <property>"ActionListener"</property>
+ </emphasis> attributes are ignored. Items don't fire any submits itself. Behavior is
+ fully defined by the components nested to items.</para>
- <para>There are three icon-related attributes. The "iconExpanded" attribute
- defines an icon for an expanded state. The "iconCollapsed" attribute defines
- an icon for a collapsed state. The "iconDisabled" attribute defines an icon
- for a disabled state.</para>
+ <para>There are three icon-related attributes. The <emphasis>
+ <property>"iconExpanded"</property>
+ </emphasis> attribute defines an icon for an expanded state. The <emphasis>
+ <property>"iconCollapsed"</property>
+ </emphasis> attribute defines an icon for a collapsed state. The <emphasis>
+ <property>"iconDisabled"</property>
+ </emphasis> attribute defines an icon for a disabled state.</para>
<para>Default icons are shown on the picture below:</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml 2007-08-07 15:45:17 UTC (rev 2105)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenuItem.xml 2007-08-07 15:46:38 UTC (rev 2106)
@@ -84,9 +84,14 @@
<section>
<title>Details of Usage</title>
- <para>All attributes except "label" are optional. The
- "label" attribute defines text to be represented.</para>
- <para>The "mode" attribute could be used with three possible parameters:</para>
+ <para>All attributes except <emphasis>
+ <property>"label"</property>
+ </emphasis> are optional. The <emphasis>
+ <property>"label"</property>
+ </emphasis> attribute defines text to be represented.</para>
+ <para>The <emphasis>
+ <property>"mode"</property>
+ </emphasis> attribute could be used with three possible parameters:</para>
<itemizedlist>
<listitem>
@@ -102,8 +107,9 @@
</listitem>
</itemizedlist>
- <para>Ajax form submission is performed additionally specified elements in the
- "reRender" attribute are reRendered.</para>
+ <para>Ajax form submission is performed additionally specified elements in the <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute are reRendered.</para>
<itemizedlist>
<listitem>
@@ -111,11 +117,16 @@
</listitem>
</itemizedlist>
- <para>"Action" and "ActionListener" attributes are ignored.
- Items don't fire any submits itself. Behavior is fully defined by the components
- nested to items.</para>
+ <para><emphasis>
+ <property>"Action"</property>
+ </emphasis> and <emphasis>
+ <property>"ActionListener"</property>
+ </emphasis> attributes are ignored. Items don't fire any submits itself. Behavior is
+ fully defined by the components nested to items.</para>
- <para>Here is an example for value "none":</para>
+ <para>Here is an example for value <emphasis>
+ <property>"none"</property>
+ </emphasis>:</para>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -132,8 +143,11 @@
</rich:panelMenu>
...</programlisting>
- <para>There are two icon-related attributes. The "icon" attribute defines an
- icon. The "iconDisabled" attribute defines an icon for a disabled item.</para>
+ <para>There are two icon-related attributes. The <emphasis>
+ <property>"icon"</property>
+ </emphasis> attribute defines an icon. The <emphasis>
+ <property>"iconDisabled"</property>
+ </emphasis> attribute defines an icon for a disabled item.</para>
<para>Default icons are shown on the picture below:</para>
@@ -174,16 +188,16 @@
<para>It's also possible to define a path to the icon. Simple code is placed below.</para>
<programlisting role="xml">...
- "rich:panelMenu"
+ <rich:panelMenu>
…
- "rich:panelMenuItem ="Item 1.1" icon="\images\img1.gif" /"
+ <rich:panelMenuItem ="Item 1.1" icon="\images\img1.gif" />
…
- "/rich:panelMenu"
+ </rich:panelMenu>
...</programlisting>
</section>
- <section>
+ <!--section>
<title>JavaScript API</title>
<para>In Java Script code for expanding/collapsing group element creation it's
necessary to use doExpand()/doCollapse() function.</para>
@@ -216,7 +230,7 @@
</tgroup>
</table>
- </section>
+ </section-->
<section>
@@ -371,9 +385,8 @@
<listitem>rich-pmenu-top-item-label</listitem>
</itemizedlist>
- <para>In order to redefine the style for all panel menu items on a page using CSS,
- it's enough to create classes with the same names and define the necessary properties
- in them.</para>
+ <para>In order to redefine the style for all panel menu items on a page using CSS, it's
+ enough to create classes with the same names and define the necessary properties in them.</para>
<para>To change the style of particular panel menu items components define your own style
classes in the corresponding panelMenuItem attributes.</para>
18 years, 9 months
JBoss Rich Faces SVN: r2105 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-08-07 11:45:17 -0400 (Tue, 07 Aug 2007)
New Revision: 2105
Modified:
trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml
Log:
http://jira.jboss.com/jira/browse/RF-412
Modified: trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml 2007-08-07 15:31:17 UTC (rev 2104)
+++ trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml 2007-08-07 15:45:17 UTC (rev 2105)
@@ -90,9 +90,24 @@
<para>Component provides two controllers groups for switching:</para>
<itemizedlist>
<listitem>Page numbers for switching onto a particular page</listitem>
- <listitem>The controls of fast switching: "first", "last",
- "next", "previous", "fastforward",
- "fastrewind"</listitem>
+ <listitem>The controls of fast switching: <emphasis>
+ <property>"first",</property>
+ </emphasis>
+ <emphasis>
+ <property>"last",</property>
+ </emphasis>
+ <emphasis>
+ <property>"next",</property>
+ </emphasis>
+ <emphasis>
+ <property>"previous",</property>
+ </emphasis>
+ <emphasis>
+ <property>"fastforward",</property>
+ </emphasis>
+ <emphasis>
+ <property>"fastrewind"</property>
+ </emphasis></listitem>
</itemizedlist>
<para>The controls of fast switching are created adding the facets component with the
corresponding name:</para>
@@ -111,10 +126,24 @@
</rich:Datascroller>
...
]]></programlisting>
- <para> There are also facets used to create the disabled states:
- "first_disabled", "last_disabled",
- "next_disabled", "previous_disabled",
- "fastforward_disabled", "fastrewind_disabled". </para>
+ <para> There are also facets used to create the disabled states: <emphasis>
+ <property>"first_disabled",</property>
+ </emphasis>
+ <emphasis>
+ <property>"last_disabled",</property>
+ </emphasis>
+ <emphasis>
+ <property>"next_disabled",</property>
+ </emphasis>
+ <emphasis>
+ <property>"previous_disabled",</property>
+ </emphasis>
+ <emphasis>
+ <property>"fastforward_disabled",</property>
+ </emphasis>
+ <emphasis>
+ <property>"fastrewind_disabled"</property>
+ </emphasis>. </para>
<figure>
<title>Datascroller controls</title>
<mediaobject>
@@ -124,12 +153,45 @@
</mediaobject>
</figure>
<para>The screenshot shows one controller from each group.</para>
- <para>For the
- <property>"fastforward"</property>/<property>"rewind"</property>
- controls customization the additional <emphasis>
+ <para>For the <emphasis>
+ <property>"fastforward"</property>
+ </emphasis>/<emphasis>
+ <property>"rewind"</property>
+ </emphasis> controls customization the additional <emphasis>
<property>"fastStep"</property>
</emphasis> attribute is used. The attribute indicates pages quantity to switch onto when fast
scrolling is used. </para>
+ <para>The <emphasis>
+ <property>"pageIndexVar"</property>
+ </emphasis> and <emphasis>
+ <property>"pagesVar"</property>
+ </emphasis> attributes provide an ability to show the current page and the number of pages in
+ the dataScroller. These attributes are used for definition the names of variables, that wiil
+ be used in the facet with name<emphasis>
+ <property>"pages"</property>
+ </emphasis>. An example can be found below: </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[ ...
+ <h:form>
+ <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
+ <rich:column>
+ <h:outputText value="#{cap.name}"></h:outputText>
+ </rich:column>
+ <f:facet name="footer">
+ <rich:datascroller pageIndexVar="pageIndex" pagesVar="pages">
+ <f:facet name="pages">
+ <h:outputText value="#{pageIndex} / #{pages}"></h:outputText>
+ </f:facet>
+ </rich:datascroller>
+ </f:facet>
+ </rich:dataTable>
+ </h:form>
+...
+]]></programlisting>
+
+
</section>
<section>
<title>Look-and-Feel Customization</title>
18 years, 9 months
JBoss Rich Faces SVN: r2104 - in trunk: samples/calendar-sample/src/main/webapp/pages and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-08-07 11:31:17 -0400 (Tue, 07 Aug 2007)
New Revision: 2104
Modified:
trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
trunk/ui/calendar/src/main/config/component/calendar.xml
trunk/ui/calendar/src/main/java/
trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
trunk/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java
trunk/ui/calendar/src/test/java/org/richfaces/component/CurrentDateEventTest.java
Log:
added new atribute boundaryDateMode.
Updated sample.
Some corretions in JUnit Tests.
Modified: trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
===================================================================
--- trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-08-07 14:56:08 UTC (rev 2103)
+++ trunk/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-08-07 15:31:17 UTC (rev 2104)
@@ -29,15 +29,17 @@
/**
* 20/07/2007
- * @author Alexej Kushunin
- * @mailto: akushunin(a)exadel.com
- *
+ *
+ * @author Alexej Kushunin
+ * @mailto: akushunin(a)exadel.com
+ *
*/
public class CalendarBean {
-
- private static final String[] WEEK_DAY_LABELS = new String[] {"Sun *", "Mon +", "Tue +", "Wed +", "Thu +", "Fri +", "Sat *"};
+
+ private static final String[] WEEK_DAY_LABELS = new String[] { "Sun *",
+ "Mon +", "Tue +", "Wed +", "Thu +", "Fri +", "Sat *" };
private Locale locale;
-
+
private boolean popup;
private boolean readonly;
private String pattern;
@@ -46,9 +48,10 @@
private String jointPoint;
private String direction;
private String inputType;
-
+ private String boundary;
+
private boolean useCustomDayLabels;
-
+
public Locale getLocale() {
return locale;
}
@@ -57,7 +60,6 @@
this.locale = locale;
}
-
public boolean isPopup() {
return popup;
}
@@ -65,7 +67,6 @@
public void setPopup(boolean popup) {
this.popup = popup;
}
-
public String getPattern() {
return pattern;
@@ -76,17 +77,17 @@
}
public CalendarBean() {
-
+
locale = Locale.US;
popup = true;
pattern = "MMM d, yyyy";
jointPoint = "bottom-left";
direction = "bottom-right";
- readonly=true;
- inputType="readonly";
+ readonly = true;
+ inputType = "readonly";
+ boundary = "inactive";
}
-
-
+
public String getInputType() {
return inputType;
}
@@ -103,13 +104,13 @@
this.readonly = readonly;
}
- public void selectLocale(ValueChangeEvent event){
-
+ public void selectLocale(ValueChangeEvent event) {
+
String tLocale = (String) event.getNewValue();
if (tLocale != null) {
- String lang = tLocale.substring(0,2);
+ String lang = tLocale.substring(0, 2);
String country = tLocale.substring(3);
- locale = new Locale(lang,country,"");
+ locale = new Locale(lang, country, "");
}
}
@@ -120,7 +121,7 @@
public void setUseCustomDayLabels(boolean useCustomDayLabels) {
this.useCustomDayLabels = useCustomDayLabels;
}
-
+
public Object getWeekDayLabelsShort() {
if (isUseCustomDayLabels()) {
return WEEK_DAY_LABELS;
@@ -132,9 +133,10 @@
public String getCurrentDateAsText() {
Date currentDate = getCurrentDate();
if (currentDate != null) {
- return DateFormat.getDateInstance(DateFormat.FULL).format(currentDate);
+ return DateFormat.getDateInstance(DateFormat.FULL).format(
+ currentDate);
}
-
+
return null;
}
@@ -153,23 +155,37 @@
public void setSelectedDate(Date selectedDate) {
this.selectedDate = selectedDate;
}
-
+
public String getJointPoint() {
return jointPoint;
}
+
public void setJointPoint(String jointPoint) {
this.jointPoint = jointPoint;
}
- public void selectJointPoint(ValueChangeEvent event){
+
+ public void selectJointPoint(ValueChangeEvent event) {
jointPoint = (String) event.getNewValue();
}
+
public String getDirection() {
return direction;
}
+
public void setDirection(String direction) {
this.direction = direction;
}
- public void selectDirection(ValueChangeEvent event){
+
+ public void selectDirection(ValueChangeEvent event) {
direction = (String) event.getNewValue();
}
+
+ public String getBoundary() {
+ return boundary;
+ }
+
+ public void setBoundary(String boundary) {
+ this.boundary = boundary;
+ }
+
}
\ No newline at end of file
Modified: trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-08-07 14:56:08 UTC (rev 2103)
+++ trunk/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-08-07 15:31:17 UTC (rev 2104)
@@ -45,7 +45,8 @@
jointPoint="#{calendarBean.jointPoint}"
direction="#{calendarBean.direction}"
buttonLabel="PopUp"
- inputType="#{calendarBean.inputType}">
+ inputType="#{calendarBean.inputType}"
+ boundaryDatesMode="#{calendarBean.boundary}">
<f:validator validatorId="org.richfaces.CalendarValidator" />
@@ -100,6 +101,12 @@
<f:selectItem itemLabel="hidden" itemValue="hidden"/>
<f:selectItem itemLabel="editable" itemValue="editable"/>
</h:selectOneRadio>
+ <h:outputText value="BoundaryDatesMode:" />
+ <h:selectOneRadio onclick="submit()" value="#{calendarBean.boundary}">
+ <f:selectItem itemLabel="inactive" itemValue="inactive"/>
+ <f:selectItem itemLabel="select" itemValue="select"/>
+ <f:selectItem itemLabel="scroll" itemValue="scroll"/>
+ </h:selectOneRadio>
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2007-08-07 14:56:08 UTC (rev 2103)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2007-08-07 15:31:17 UTC (rev 2104)
@@ -163,7 +163,14 @@
<classname>java.lang.String</classname>
<description></description>
<defaultvalue>"readonly"</defaultvalue>
- </property>
+ </property>
+ <property>
+ <name>boundaryDatesMode</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue>"inactive"</defaultvalue>
+ </property>
+
</component>
</components>
Property changes on: trunk/ui/calendar/src/main/java
___________________________________________________________________
Name: svn:ignore
+ META-INF
Modified: trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-08-07 14:56:08 UTC (rev 2103)
+++ trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-08-07 15:31:17 UTC (rev 2104)
@@ -125,7 +125,6 @@
public abstract void setDisabled(boolean disabled);
-
public abstract String getButtonLabel();
public abstract void setButtonLabel(String buttonLabel);
@@ -138,8 +137,12 @@
public abstract void setInputType(String inputType);
+ public abstract String getBoundaryDatesMode();
+ public abstract void setBoundaryDatesMode(String boundaryDatesMode);
+
+
// currentDate processing -------------------------------------------------
public Calendar getCalendar() {
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-08-07 14:56:08 UTC (rev 2103)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-08-07 15:31:17 UTC (rev 2104)
@@ -31,6 +31,7 @@
jointPoint: '#{component.jointPoint}',
direction: '#{component.direction}',
toolTipMode:'#{component.toolTipMode}',
+ boundaryDatesMode:'#{component.boundaryDatesMode}',
popup: #{component.popup},
disabled: #{component.disabled},
<f:call name="writeSymbols" />,
Modified: trunk/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java
===================================================================
--- trunk/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java 2007-08-07 14:56:08 UTC (rev 2103)
+++ trunk/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java 2007-08-07 15:31:17 UTC (rev 2104)
@@ -18,6 +18,7 @@
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.apache.commons.lang.StringUtils;
+import com.gargoylesoftware.htmlunit.ElementNotFoundException;
import com.gargoylesoftware.htmlunit.html.HtmlButton;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
@@ -35,6 +36,8 @@
private UICalendar calendar;
+ private UICalendar calendar1;
+
private static Set javaScripts = new HashSet();
static {
@@ -42,7 +45,8 @@
javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
javaScripts.add("org/richfaces/renderkit/html/scripts/events.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
- javaScripts.add("org/richfaces/renderkit/html/scripts/json/json-dom.js");
+ javaScripts
+ .add("org/richfaces/renderkit/html/scripts/json/json-dom.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/calendar.js");
}
@@ -57,25 +61,30 @@
form = new HtmlForm();
form.setId("form");
facesContext.getViewRoot().getChildren().add(form);
- calendar = (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE);
+ calendar = (UICalendar) application
+ .createComponent(UICalendar.COMPONENT_TYPE);
+ calendar1 = (UICalendar) application
+ .createComponent(UICalendar.COMPONENT_TYPE);
calendar.setLocale(Locale.UK);
calendar.setDatePattern("d/MM/yyyy");
calendar.setTimeZone(TimeZone.getTimeZone("Europe/London"));
- /*String[] strarr = TimeZone.getAvailableIDs();
- for(int i=0; i < strarr.length; i++){
- System.out.println(strarr[i]);
- } */
+ /*
+ * String[] strarr = TimeZone.getAvailableIDs(); for(int i=0; i <
+ * strarr.length; i++){ System.out.println(strarr[i]); }
+ */
calendar.setButtonLabel("PopUp");
- //TODO test popup false
- //TODO test CurrentDate = null
+ // XXX test popup false
+ // XXX test CurrentDate = null
calendar.setPopup(true);
Calendar calendarObject = Calendar.getInstance();
- calendarObject.set(2001, Calendar.SEPTEMBER, 11,1,1,1);
+ calendarObject.set(2001, Calendar.SEPTEMBER, 11, 1, 1, 1);
calendar.setId("calendar");
calendar.setSubmittedValue(calendarObject.getTime());
form.getChildren().add(calendar);
-
-
+ calendar1.setId("_calendar");
+ calendar1.setPopup(false);
+ calendar1.setCurrentDate(null);
+ form.getChildren().add(calendar1);
}
/*
@@ -151,80 +160,112 @@
public void testCalendarRenderer() throws Exception {
-/* UIViewRoot root = facesContext.getViewRoot();
- root.processDecodes(facesContext);
- root.processValidators(facesContext);
- root.processUpdates(facesContext);
- root.processApplication(facesContext);
-*/
+ /*
+ * UIViewRoot root = facesContext.getViewRoot();
+ * root.processDecodes(facesContext);
+ * root.processValidators(facesContext);
+ * root.processUpdates(facesContext);
+ * root.processApplication(facesContext);
+ */
HtmlPage page = renderView();
assertNotNull(page);
//System.out.println(page.asXml());
-
- HtmlElement htmlCalendar = page.getHtmlElementById(calendar.getClientId(facesContext));
+
+ HtmlElement htmlCalendar = page.getHtmlElementById(calendar
+ .getClientId(facesContext));
assertNotNull(htmlCalendar);
-
- HtmlInput htmlCalendarInput = (HtmlInput) page.getHtmlElementById(calendar.getClientId(facesContext)+"InputDate");
- HtmlButton htmlCalendarButton = (HtmlButton) page.getHtmlElementById(calendar.getClientId(facesContext)+"PopupButton");
- HtmlSpan htmlCalendarSpan =(HtmlSpan) page.getHtmlElementById(calendar.getClientId(facesContext)+"Popup");
+
+ HtmlInput htmlCalendarInput = (HtmlInput) page
+ .getHtmlElementById(calendar.getClientId(facesContext)
+ + "InputDate");
+ HtmlButton htmlCalendarButton = (HtmlButton) page
+ .getHtmlElementById(calendar.getClientId(facesContext)
+ + "PopupButton");
+ HtmlSpan htmlCalendarSpan = (HtmlSpan) page.getHtmlElementById(calendar
+ .getClientId(facesContext)
+ + "Popup");
assertNotNull(htmlCalendarInput);
assertNotNull(htmlCalendarButton);
assertNotNull(htmlCalendarSpan);
-
- assertEquals("10/09/2001", htmlCalendarInput.getValueAttribute());
+ assertEquals("10/09/2001", htmlCalendarInput.getValueAttribute());
+
+ HtmlElement htmlCalendar1 = page.getHtmlElementById(calendar1
+ .getClientId(facesContext));
+ assertNotNull(htmlCalendar1);
+
+ try {
+ HtmlInput htmlCalendarInput1 = (HtmlInput) page
+ .getHtmlElementById(calendar1.getClientId(facesContext)
+ + "InputDate");
+ } catch (ElementNotFoundException e) {
+ assertNotNull(e);
+ }
+ try {
+ HtmlButton htmlCalendarButton1 = (HtmlButton) page
+ .getHtmlElementById(calendar1.getClientId(facesContext)
+ + "PopupButton");
+ } catch (ElementNotFoundException e) {
+ assertNotNull(e);
+ }
+ try {
+ HtmlSpan htmlCalendarSpan1 = (HtmlSpan) page
+ .getHtmlElementById(calendar1.getClientId(facesContext)
+ + "Popup");
+ } catch (ElementNotFoundException e) {
+ assertNotNull(e);
+ }
+ //System.out.println(page.asXml());
}
-
- public void testCalendarDecode() throws Exception{
- //TODO Add set Date and time
+
+ public void testCalendarDecode() throws Exception {
+ // XXX Add set Date and time
+ Calendar calendarObject = Calendar.getInstance();
+ calendarObject.set(2001, Calendar.SEPTEMBER, 11, 1, 1, 1);
calendar.decode(facesContext);
- assertEquals("Tue Sep 11 01:01:01 EEST 2001", calendar.getSubmittedValue().toString());
- Calendar calendarObject = Calendar.getInstance();
- calendarObject.set(2002, Calendar.SEPTEMBER, 11,1,1,1);
+ assertEquals(calendarObject.getTime(), calendar.getSubmittedValue());
+ calendarObject.set(2002, Calendar.SEPTEMBER, 11, 1, 1, 1);
calendar.updateCurrentDate(facesContext, calendarObject.getTime());
- assertEquals("Wed Sep 11 01:01:01 EEST 2002", calendar.getCurrentDate().toString());
- //assertEquals("11/09/2001", htmlCalendarInput.getValueAttribute());
+ assertEquals(calendarObject.getTime(), calendar.getCurrentDate());
-
}
-
+
public void testCalendarStyles() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- //System.out.println(page.asXml());
- List links = page.getDocumentElement().getHtmlElementsByTagName("link");
- assertEquals(1, links.size());
- HtmlElement link = (HtmlElement) links.get(0);
- assertTrue(link.getAttributeValue("href").contains("css/calendar.xcss"));
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ // System.out.println(page.asXml());
+ List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ assertEquals(1, links.size());
+ HtmlElement link = (HtmlElement) links.get(0);
+ assertTrue(link.getAttributeValue("href").contains("css/calendar.xcss"));
}
public void testCalendarScrits() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
-
+
List scripts = page.getDocumentElement().getHtmlElementsByTagName(
"script");
for (Iterator it = scripts.iterator(); it.hasNext();) {
HtmlScript item = (HtmlScript) it.next();
String srcAttr = item.getSrcAttribute();
- if(item.getFirstChild()!=null ){
+ if (item.getFirstChild() != null) {
String scriptBodyString = item.getFirstChild().toString();
- if(scriptBodyString.contains("new Calendar")){
+ if (scriptBodyString.contains("new Calendar")&&scriptBodyString.contains("form:calendar")) {
- assertTrue(scriptBodyString.contains("datePattern"));
- assertTrue(scriptBodyString.contains("d/MM/yyyy"));
- assertTrue(scriptBodyString.contains("selectedDate"));
- assertTrue(scriptBodyString.contains("Date(2001,8,11)"));
- assertTrue(scriptBodyString.contains("popup: true"));
-
+ assertTrue(scriptBodyString.contains("datePattern"));
+ assertTrue(scriptBodyString.contains("d/MM/yyyy"));
+ assertTrue(scriptBodyString.contains("selectedDate"));
+ assertTrue(scriptBodyString.contains("Date(2001,8,11)"));
+ assertTrue(scriptBodyString.contains("popup: true"));
+
+ }
}
- }
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;
Modified: trunk/ui/calendar/src/test/java/org/richfaces/component/CurrentDateEventTest.java
===================================================================
--- trunk/ui/calendar/src/test/java/org/richfaces/component/CurrentDateEventTest.java 2007-08-07 14:56:08 UTC (rev 2103)
+++ trunk/ui/calendar/src/test/java/org/richfaces/component/CurrentDateEventTest.java 2007-08-07 15:31:17 UTC (rev 2104)
@@ -56,7 +56,7 @@
calendar = (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE);;
event1 = new CurrentDateChangeEvent (calendar, "11/2001");
cal = Calendar.getInstance();
- cal.set(2001, 0, 9);
+ cal.set(2001, 10, 10);
event2 = new CurrentDateChangeEvent (calendar, cal.getTime());
event4 = new CurrentDateChangeEvent (calendar, "");
event3 = new AjaxEvent(calendar);
@@ -78,13 +78,11 @@
}
public void testBrodcastEvent() throws Exception{
- calendar.broadcast(event4);
- calendar.broadcast(event1);
+ // calendar.broadcast(event4);
+ // calendar.broadcast(event1);
calendar.broadcast(event3);
- System.out.println(calendar.getCurrentDate().toString());
+ // calendar.broadcast(event2);
- // calendar.broadcast(event2);
-
}
}
18 years, 9 months
JBoss Rich Faces SVN: r2103 - in trunk: framework/api/src/main/java/org/richfaces/event/scroll and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-08-07 10:56:08 -0400 (Tue, 07 Aug 2007)
New Revision: 2103
Added:
trunk/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java
trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java
Modified:
trunk/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java
trunk/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
trunk/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
Log:
re-factored sort and scroll events allowing renderers to provide renderer-specific attributes upon broadcasting
Added: trunk/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/event/AttributeHolder.java 2007-08-07 14:56:08 UTC (rev 2103)
@@ -0,0 +1,54 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.event;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * Base interface holding attributes that can lately
+ * be applied on {@link UIComponent}
+ * @author Maksim Kaszynski
+ *
+ */
+public interface AttributeHolder {
+
+ /**
+ *
+ * @param name
+ * @param value
+ */
+ public abstract void setAttribute(String name, Object value);
+
+ /**
+ *
+ * @param name
+ * @return
+ */
+ public abstract Object getAttribute(String name);
+
+ /**
+ * Copy attributes from event map to component
+ * @param component
+ */
+ public abstract void applyAttributes(UIComponent component);
+
+}
\ No newline at end of file
Added: trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java 2007-08-07 14:56:08 UTC (rev 2103)
@@ -0,0 +1,95 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.event;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+
+/**
+ * Base class for events carrying component attributes.
+ * By using it, renderer-specific attributes can
+ * be applied when event is broadcast
+ * @author Maksim Kaszynski
+ *
+ */
+public abstract class AttributedEvent extends FacesEvent implements AttributeHolder{
+
+ private Map attributes = new HashMap();
+
+ public AttributedEvent(UIComponent component) {
+ super(component);
+ }
+
+ public AttributedEvent(UIComponent component, Map attributes) {
+ super(component);
+ this.attributes.putAll(attributes);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.event.AttributeHolder#setAttribute(java.lang.String, java.lang.Object)
+ */
+ public void setAttribute(String name, Object value) {
+ attributes.put(name, value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.event.AttributeHolder#getAttribute(java.lang.String)
+ */
+ public Object getAttribute(String name) {
+ return attributes.get(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.event.AttributeHolder#applyAttributes(javax.faces.component.UIComponent)
+ */
+ public void applyAttributes(UIComponent component) {
+
+ Map attrs = component.getAttributes();
+
+ for(Iterator iterator = attributes.entrySet().iterator();
+ iterator.hasNext(); ) {
+
+ Map.Entry entry = (Map.Entry) iterator.next();
+
+ String key = entry.getKey().toString();
+ Object value = entry.getValue();
+
+ if (value == null) {
+ attrs.remove(key);
+ } else {
+ attrs.put(key, value);
+ }
+ }
+ }
+
+ /**
+ * copy attributes to event source
+ */
+ public void applyAttributes() {
+ applyAttributes(getComponent());
+ }
+
+}
Added: trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java 2007-08-07 14:56:08 UTC (rev 2103)
@@ -0,0 +1,66 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.event;
+
+import javax.faces.component.UIComponent;
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public abstract class ScrollableGridViewEvent extends AttributedEvent {
+
+
+ /**
+ * number of rows to update
+ */
+ protected int rows;
+ /**
+ * start position of update
+ */
+ protected int first;
+
+
+ public ScrollableGridViewEvent(UIComponent component, int rows, int first) {
+ super(component);
+ this.rows = rows;
+ this.first = first;
+ }
+
+ public int getFirst() {
+ return first;
+ }
+
+ public int getRows() {
+ return rows;
+ }
+
+ public void setFirst(int first) {
+ this.first = first;
+ }
+
+ public void setRows(int rows) {
+ this.rows = rows;
+ }
+
+}
\ No newline at end of file
Modified: trunk/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java 2007-08-07 14:25:43 UTC (rev 2102)
+++ trunk/framework/api/src/main/java/org/richfaces/event/scroll/ScrollEvent.java 2007-08-07 14:56:08 UTC (rev 2103)
@@ -4,48 +4,31 @@
package org.richfaces.event.scroll;
import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
+import org.richfaces.event.ScrollableGridViewEvent;
+
+
/**
* @author Anton Belevich
*
*/
-public class ScrollEvent extends FacesEvent {
+public class ScrollEvent extends ScrollableGridViewEvent {
private static final long serialVersionUID = 3786221668771853810L;
- private int rows;
-
- private int first;
-
public ScrollEvent(UIComponent component, int rows, int first){
- super(component);
+ super(component, rows, first);
this.rows = rows;
this.first = first;
}
public boolean isAppropriateListener(FacesListener listener) {
- return false;
+ return listener instanceof ScrollListener;
}
public void processListener(FacesListener listener) {
+ ((ScrollListener) listener).processScroll(this);
}
- public int getFirst() {
- return first;
- }
-
- public void setFirst(int first) {
- this.first = first;
- }
-
- public int getRows() {
- return rows;
- }
-
- public void setRows(int rows) {
- this.rows = rows;
- }
-
}
Added: trunk/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java (rev 0)
+++ trunk/framework/api/src/main/java/org/richfaces/event/scroll/ScrollListener.java 2007-08-07 14:56:08 UTC (rev 2103)
@@ -0,0 +1,32 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.event.scroll;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface ScrollListener extends FacesListener {
+ public void processScroll(ScrollEvent event);
+}
Modified: trunk/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java 2007-08-07 14:25:43 UTC (rev 2102)
+++ trunk/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java 2007-08-07 14:56:08 UTC (rev 2103)
@@ -11,35 +11,26 @@
package org.richfaces.event.sort;
import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
+import org.richfaces.event.AttributedEvent;
+import org.richfaces.event.ScrollableGridViewEvent;
+
/**
* @author Maksim Kaszynski
* @modified by Anton Belevich
*
*/
-public class SortEvent extends FacesEvent {
+public class SortEvent extends ScrollableGridViewEvent {
private static final long serialVersionUID = -1453867412542792281L;
private int sortColumn;
- private int startRow;
-
- private int dataIndex;
-
- private boolean asc;
-
-
- public SortEvent(
- UIComponent component, int sortColumn, int startRow, int dataIndex, boolean asc) {
+ public SortEvent(UIComponent component, int sortColumn, int rows, int first) {
- super(component);
- this.asc = asc;
+ super(component, rows, first);
this.sortColumn = sortColumn;
- this.startRow = startRow;
- this.dataIndex = dataIndex;
}
@@ -65,30 +56,6 @@
return "SortEvent: {sortColumn: " + sortColumn + "}";
}
- public boolean isAsc() {
- return asc;
- }
-
- public void setAsc(boolean asc) {
- this.asc = asc;
- }
-
- public int getDataIndex() {
- return dataIndex;
- }
-
- public void setDataIndex(int dataIndex) {
- this.dataIndex = dataIndex;
- }
-
- public int getStartRow() {
- return startRow;
- }
-
- public void setStartRow(int startRow) {
- this.startRow = startRow;
- }
-
public void setSortColumn(int sortColumn) {
this.sortColumn = sortColumn;
}
Modified: trunk/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
--- trunk/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-08-07 14:25:43 UTC (rev 2102)
+++ trunk/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-08-07 14:56:08 UTC (rev 2103)
@@ -27,7 +27,8 @@
import org.apache.commons.collections.iterators.IteratorChain;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.richfaces.event.scroll.ScrollEvent;
+import org.richfaces.event.AttributeHolder;
+import org.richfaces.event.ScrollableGridViewEvent;
import org.richfaces.event.sort.MultiColumnSortListener;
import org.richfaces.event.sort.SingleColumnSortListener;
import org.richfaces.event.sort.SortEvent;
@@ -54,11 +55,16 @@
private final static Log log = LogFactory.getLog(UIScrollableGrid.class);
- private boolean MODEL_RANGE = false;
+ /**
+ * Flag set on each phase to determine what range of data to walk
+ * true means - locally saved ranges (for data pending update)
+ * false means - use range that comes from component state
+ */
+ private boolean useSavedRanges = true;
-
- private transient Collection partialUpdateChildren;
-
+ /**
+ * hold list of ranges previously accessed until updates are fully done for them
+ */
private List ranges;
private Collection responseData = new ArrayList();
@@ -69,14 +75,6 @@
private SortListener sortListener;
- public int getReqRowsCount() {
- return reqRowsCount;
- }
-
- public void setReqRowsCount(int reqRowsCount) {
- this.reqRowsCount = reqRowsCount;
- }
-
public abstract SortOrder getSortOrder();
public abstract void setSortOrder(SortOrder sortOrder) ;
@@ -101,7 +99,7 @@
reqRowsCount = getRows();
}
- int rows = getReqRowsCount();
+ int rows = reqRowsCount;
int rowsCount = getExtendedDataModel().getRowCount();
@@ -127,7 +125,9 @@
public void processDecodes(FacesContext faces) {
- MODEL_RANGE = true;
+
+ useSavedRanges = false;
+
if (log.isTraceEnabled()) {
log.trace("UIScrollableGrid.processDecodes(faces)");
}
@@ -135,7 +135,7 @@
}
public void processValidators(FacesContext faces) {
- MODEL_RANGE = false;
+ useSavedRanges = true;
if (log.isTraceEnabled()) {
log.trace("UIScrollableGrid.processValidators(faces)");
}
@@ -143,7 +143,7 @@
}
public void processUpdates(FacesContext faces) {
- MODEL_RANGE = false;
+ useSavedRanges = true;
if (log.isTraceEnabled()) {
log.trace("UIScrollableGrid.processUpdates(faces)");
@@ -159,7 +159,7 @@
log.trace("UIScrollableGrid.encodeBegin(context)");
}
- MODEL_RANGE = true;
+ useSavedRanges = false;
super.encodeBegin(context);
}
@@ -224,7 +224,7 @@
Object values[] = new Object[4];
values[0] = super.saveState(context);
- values[1] = getRanges();
+ values[1] = ranges;
values[2] = scrollPos;
values[3] = saveAttachedState(context, sortListener);
@@ -235,7 +235,7 @@
public void restoreState(FacesContext context, Object state) {
Object values[] = (Object[])state;
super.restoreState(context, values[0]);
- setRanges((List)values[1]);
+ ranges = ((List)values[1]);
scrollPos = (String)values[2];
sortListener = (SortListener) restoreAttachedState(context, values[3]);
}
@@ -273,19 +273,24 @@
super.broadcast(event);
+ if (event instanceof AttributeHolder) {
+ ((AttributeHolder) event).applyAttributes(this);
+ }
+
if(event instanceof AjaxEvent){
AjaxContext.getCurrentInstance().addComponentToAjaxRender(this);
}else if(event instanceof SortEvent){
processSortingChange(event);
// new AjaxEvent(this).queue();
- }else if(event instanceof ScrollEvent){
+ }else if(event instanceof ScrollableGridViewEvent){
// new AjaxEvent(this).queue();
processScrolling(event);
}
+
}
protected boolean broadcastLocal(FacesEvent event) {
- return super.broadcastLocal(event) || event instanceof SortEvent || event instanceof ScrollEvent;
+ return super.broadcastLocal(event) || event instanceof SortEvent || event instanceof ScrollableGridViewEvent;
}
public void queueEvent(FacesEvent event) {
@@ -295,7 +300,7 @@
}else if(event instanceof SortEvent){
new AjaxEvent(this).queue();
event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- }else if(event instanceof ScrollEvent){
+ }else if(event instanceof ScrollableGridViewEvent){
event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
new AjaxEvent(this).queue();
}
@@ -303,9 +308,11 @@
}
public void processScrolling(FacesEvent event){
- ScrollEvent e = (ScrollEvent)event;
- setReqRowsCount(e.getRows());
+ ScrollableGridViewEvent e = (ScrollableGridViewEvent)event;
+
setFirst(e.getFirst());
+ reqRowsCount = e.getRows();
+
getFacesContext().renderResponse();
}
@@ -314,9 +321,13 @@
SortEvent e = (SortEvent)event;
getSortListener().processSort(e);
+
+ setFirst(e.getFirst());
+ reqRowsCount = e.getRows();
resetDataModel();
+
getFacesContext().renderResponse();
}
@@ -332,7 +343,7 @@
ranges.add(visitedRange);
}
- if(!MODEL_RANGE){
+ if(useSavedRanges){
for (Iterator iter = ranges.iterator(); iter.hasNext();) {
ScrollableGridRange range = (ScrollableGridRange) iter.next();
@@ -350,33 +361,15 @@
}
}
- public Collection getPartialUpdateChildren() {
-
- if (partialUpdateChildren == null) {
- partialUpdateChildren = new ArrayList();
- }
- return partialUpdateChildren;
- }
-
-
public void encodeEnd(FacesContext context) throws IOException {
super.encodeEnd(context);
- partialUpdateChildren = null;
}
public boolean isCacheable() {
return true;
}
- public List getRanges() {
- return ranges;
- }
-
- public void setRanges(List ranges) {
- this.ranges = ranges;
- }
-
public String getScrollPos() {
return scrollPos;
}
Modified: trunk/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
--- trunk/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-08-07 14:25:43 UTC (rev 2102)
+++ trunk/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-08-07 14:56:08 UTC (rev 2103)
@@ -617,36 +617,23 @@
int sortColumn = Integer.parseInt((String)parameters.get(clientId + ":sortColumn"));
int sortDataIndex = Integer.parseInt((String)parameters.get(clientId + ":sortIndex"));
Integer sortStartRow = Integer.valueOf((String)parameters.get(clientId + ":sortStartRow"));
- String sortOrder = (String)parameters.get(clientId + ":sortOrder");
- boolean asc = true;
- if(!sortOrder.equals("asc")){
- asc = false;
- }
UIScrollableGridColumn column = (UIScrollableGridColumn)grid.getChildren().get(sortColumn);
if(column.isSortable()){
- grid.getAttributes().put(GridUtils.CLIENT_ROW_KEY,sortStartRow);
- grid.setFirst(sortDataIndex);
- grid.setReqRowsCount(grid.getRows());
-
- if (log.isDebugEnabled()) {
-
- log.debug("rows " + grid.getRows() );
- log.debug("client start index" + grid.getAttributes().get(GridUtils.CLIENT_ROW_KEY));
- log.debug("data index " + grid.getFirst());
-
- }
-
sorted = true;
- SortEvent sortEvent = new SortEvent(grid,sortColumn, sortStartRow.intValue(), sortDataIndex, asc );
- grid.queueEvent(sortEvent);
+ SortEvent sortEvent = new SortEvent(grid,sortColumn, grid.getRows(), sortDataIndex);
+ sortEvent.setAttribute(GridUtils.CLIENT_ROW_KEY,sortStartRow);
+
if (ajaxContext.isAjaxRequest()) {
- component.getAttributes().put(PARTIAL_UPDATE, Boolean.TRUE);
- component.getAttributes().put(UPDATE_HEADER, Boolean.TRUE);
+ sortEvent.setAttribute(PARTIAL_UPDATE, Boolean.TRUE);
+ sortEvent.setAttribute(UPDATE_HEADER, Boolean.TRUE);
}
+
+
+ sortEvent.queue();
}
}
@@ -666,15 +653,18 @@
int first = 0;
if(!isEmpty){
- grid.getAttributes().put(GridUtils.CLIENT_ROW_KEY,Integer.valueOf(values[2]));
rows = Integer.parseInt(values[0]);
first = Integer.parseInt(values[1]);
ScrollEvent scrollEvent = new ScrollEvent(grid,rows,first);
- grid.queueEvent(scrollEvent);
+ scrollEvent.setAttribute(GridUtils.CLIENT_ROW_KEY,Integer.valueOf(values[2]));
+
if (ajaxContext.isAjaxRequest()) {
- component.getAttributes().put(PARTIAL_UPDATE, Boolean.TRUE);
+ scrollEvent.setAttribute(PARTIAL_UPDATE, Boolean.TRUE);
}
+
+ scrollEvent.queue();
+
}
}
18 years, 9 months
JBoss Rich Faces SVN: r2102 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces: region and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2007-08-07 10:25:43 -0400 (Tue, 07 Aug 2007)
New Revision: 2102
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/region/usage.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-524
Language correction in richfaces-demo for aj4 components
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/usage.xhtml 2007-08-07 14:11:56 UTC (rev 2101)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/usage.xhtml 2007-08-07 14:25:43 UTC (rev 2102)
@@ -8,15 +8,15 @@
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
<p>
- Additional to the listeners provided by JSF specification, RichFaces add one more:
- Ajax Listener (a4j:ajaxListener). Ajax Listener in invoked before the Render Response
+ Additionally to the listeners provided by JSF specification, RichFaces add one more:
+ Ajax Listener (a4j:ajaxListener). Ajax Listener is invoked before the Render Response
phase. Instead of Action Listener of Value Change Listener which are not invoked when
Validation of Update Model phases failed, Ajax Listener is guarantied to be invoked
- for each Ajax response. So, it is a good place for update the list of re-rendered
+ for each Ajax response. Hence, it is a good place to update the list of re-rendered
components, for example.
</p>
<p>
- Ajax Listener is not invoked for non-Ajax request and when RichFaces works in
+ Ajax Listener is not invoked for a non-Ajax request and when RichFaces works in
"Ajax Request generates Non-Ajax Response" mode. Therefore, Ajax Listener invocation
is a good indicator that Ajax response is going to be processed.
</p>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/region/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/region/usage.xhtml 2007-08-07 14:11:56 UTC (rev 2101)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/region/usage.xhtml 2007-08-07 14:25:43 UTC (rev 2102)
@@ -19,18 +19,18 @@
ajax request comes. Processing means invocation during Decode, Validation and Model Update phase.
Most common reasons to use a region are:
<ul>
- <li>avoiding the aborting the JSF lifecycle processing during the validation of other
+ <li>avoiding the aborting of the JSF lifecycle processing during the validation of other
form input unnecessary for given ajax request;</li>
<li>defining the different strategies when events will be deliveries
(immediate="true/false")</li>
- <li>showing an individual indicator of ajax status</li>
+ <li>showing an individual indicator of an ajax status</li>
<li>increasing the performance of the rendering processing (selfRendered="true/false", renderRegionOnly="true/false")</li>
</ul>
</p>
<p>
- The following two examples show the situaltion when the validation error does not
- allow to process the ajax input. Type the name. The outputText component should
- repear after you. However, in the first case, this activity will be aboted because
+ The following two examples show the situation when a validation error does not
+ allow to process an ajax input. Type the name. The outputText component should
+ reappear after you. However, in the first case, this activity will be aboted because
of the other field with required="true". You will see only the error message
while the "Job" field is empty.
</p>
@@ -71,7 +71,7 @@
</div>
<p>
- If no one region is defined explicitly on the page, the whole view plays the role of region.
+ If no one region is defined explicitly on the page, the whole view plays the role of a region.
Regions might be nested. When the ajax request is invoked by the ajax component, the
closest to this component region becomes an actual.
</p>
@@ -91,16 +91,16 @@
rather than involving jsp (xhtml) page processing if selfRendered attribute is set
to true. This might bust the performance to decrease time spending on Render Respose
phase. However, you need to be aware that the artifact that are not included in the
- component tree will disappear from your page after page is updated.<br/>
- Most known component that is not stored in the component tree is f:verbatim. It often
+ component tree will disappear from your page after the page is updated.<br/>
+ Most known component that is not stored in the component tree is f:verbatim. It is often
used to wrap non-jsf content such as pure html tags in JSF 1.1. However, even f:verbatim
is not required, the pure html tags are not stored in the component tree and will be
revoked from the update area(s) if selfRendered="true".
</p>
<p>
- The following example showing the typical situation when the content unexpectedly
+ The following example shows the typical situation when the content unexpectedly
disappear during the partial page update when selfRendered="true". The right part of the
- example works fine, because the text is produced buy the standard h:outputText component
+ example works fine, because the text is produced by the standard h:outputText component
that is stored in the component tree. Both forms are wrapped with a4j:region selfRendered="true"
</p>
@@ -120,8 +120,8 @@
</h:panelGrid>
</h:form>
<h:panelGroup id="out3">
- This text will disappear during the partual update of this panel.
- The text appears back only after the whole page refresh or a partial
+ This text will disappear during the partial update of this panel.
+ The text appears again only after the whole page refresh or a partial
update from the region with selfRendered="false" (default value).
</h:panelGroup>
</h:panelGroup>
18 years, 9 months
JBoss Rich Faces SVN: r2101 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/form.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2007-08-07 10:11:56 -0400 (Tue, 07 Aug 2007)
New Revision: 2101
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/usage.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-524
Language correction in richfaces-demo for aj4 components
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/usage.xhtml 2007-08-07 13:59:14 UTC (rev 2100)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/form/usage.xhtml 2007-08-07 14:11:56 UTC (rev 2101)
@@ -14,7 +14,7 @@
}
</style>
- <p>a4j:form functionality is similar to standard h:form component except two additional features:
+ <p>a4j:form functionality is similar to the standard h:form component except two additional features:
<ul>
<li>Along with a4j:htmlCommandLink, it fixes the problem of h:commandLink component that cannot be re-rendered without
re-rendering the whole form it belongs to.</li>
@@ -46,10 +46,10 @@
</pre>
</p>
<p>
- When ajaxSubmit="true", all included in the form non-ajax control becomes ajaxable. This
- approach is similar to the one AjaxAnywhere framework uses. If form works in ajax mode,
+ When ajaxSubmit="true", all standard action components on this form become ajaxable. This
+ approach is similar to the one AjaxAnywhere framework uses. If a form works in an ajax mode,
the standard ajax attribute such as reRender, eventQueue, requestDelay can be used. The
- following example demonstate the difference between partial and full-page refreshing.
+ following example demonstates the difference between partial and full-page refreshing.
In both cases, the regular h:commandButton is used for the form submision.
</p>
@@ -87,12 +87,12 @@
</div>
<p>
- Note:You should not use a4j:form ajaxSubmit="true" if it contains other ajax command components.
- Also, due to the security reason, uploadFile form element cannot be convertable to
+ Note:You should not use a4j:form ajaxSubmit="true" if it contains other ajax command components.
+ Also, due to the security reason, uploadFile form element cannot be convertible to
the be ajaxable.
</p>
<p>
- For additional information about attributes of this compponent read
+ For additional information about attributes of this component read
<h:outputLink value="#{facesContext.externalContext.requestContextPath}/richfaces/ajaxAttributes.jsf?c=ajaxattributes">
<h:outputText value="'Ajax Attribute' section" />
</h:outputLink>.
18 years, 9 months
JBoss Rich Faces SVN: r2100 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2007-08-07 09:59:14 -0400 (Tue, 07 Aug 2007)
New Revision: 2100
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-524
Language correction in richfaces-demo for aj4 components
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml 2007-08-07 13:40:39 UTC (rev 2099)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml 2007-08-07 13:59:14 UTC (rev 2100)
@@ -8,22 +8,22 @@
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
- <p>This section overview the attributes that are common for the Ajax components
+ <p>This section overviews the attributes that are common for Ajax components
such as a4j:support, a4j:commandButton, a4j:jsFunction, a4j:poll, a4j:push and so
- on. Also, most RichFaces components with built-in Ajax support have those
- attribute for the similar purpose.
+ on. Also, most RichFaces components with built-in Ajax support have these
+ attributes for a similar purpose.
</p>
<p>
- Attributes of Ajax component is a way how RichFaces exposes its features.
- Most of the attributes have an default value. So, you can start working with RichFaces
- without knowing the usage of those attribute. However, using them allows to
- tune the required Ajax behavoir very smoothly.
+ Ajax components attributes help RichFaces to expose its features.
+ Most of the attributes have default values. Thus, you can start working with RichFaces
+ without knowing the usage of these attribute. However, their usage allows to
+ tune the required Ajax behavior very smoothly.
</p>
<h1 class="hsample">Re-Rendering</h1>
<p>
- <b>reRender</b> is a key attribute. It allows to point to the area(s) on the page that
+ <b>reRender</b> is a key attribute. It allows to point to the area(s) on a page that
should be updated as a response on Ajax interaction. The value of the reRender
- attribute is an id of the the JSF component or the id list. This is a simple example:
+ attribute is an id of the JSF component or an id list. This is a simple example:
</p>
<div class="esample">
@@ -40,10 +40,10 @@
<p>
reRender uses <a target="_blank" href="http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/c...">
UIComponent.findComponent()</a> algorithm (with some additional exceptions)
- to find the component in the component tree. As you see, the algorithm presume
- several steps. Each other step is used if the previous step is not succeseful.
- Therefore, from your side, you can shortcut the way how fast the component is
- found if you mentioned it more precisely. The following example show the difference
+ to find the component in the component tree. As you see, the algorithm presumes
+ several steps. Each other step is used if the previous step is not successful.
+ Therefore, you can define how fast the component is
+ found mentioning it more precisely. The following example shows the difference
in approaches (both buttons will work successfully):
</p>
<div class="esample">
@@ -69,25 +69,25 @@
</div>
<p>
- You can use JSF EL expression as a value of the reRender attribute. It might be property of
+ You can use JSF EL expression as a value of the reRender attribute. It might be a property of
types Set, Collection, Array or simple String. The EL for reRender is resolved right before the
- Render Response phase. So, you can calculate what should be re-rendered on any previous
+ Render Response phase. Hence, you can calculate what should be re-rendered on any previous
phase during the Ajax request processing.
</p>
<p>Most common problem with using reRender is pointing it to the component that has a
'rendered' attribute. Note, that JSF does not mark the place in the browser DOM where the outcome
of the component should be placed in case the 'rendered' condition returns false. Therefore,
- after the component becomes rendered during the Ajax request, RichFaces deliveres the rendered
- code to the client, but does not update the page, because the place for update is inknown.
- You need to point to one of the parent component that has no 'rendered' attribute. As an
+ after the component becomes rendered during the Ajax request, RichFaces delivers the rendered
+ code to the client, but does not update a page, because the place for update is unknown.
+ You need to point to one of the parent components that has no 'rendered' attribute. As an
alternative, you can wrap the component with a4j:outputPanel layout="none".
</p>
<p>
- <b>ajaxRendered</b> attribute of the a4j:outputPanel set to true allows to define the
- area of the page that will be re-rendered even it is not pointed in the reRender attribute
- explicitly. It might be useful if you have a zone on the page that should be updated as a
- response on any Ajax request. For example, the following code allows to output the error
- messages independently what Ajax request causes the Validation phase failed.
+ <b>ajaxRendered</b> attribute of the a4j:outputPanel set to true allows to define the
+ area of the page that will be re-rendered even if it is not pointed in the reRender attribute
+ explicitly. It might be useful if you have an area on a page that should be updated as a
+ response on any Ajax request. For example, the following code allows to output error
+ messages regardless of what Ajax request causes the Validation phase failed.
</p>
<div class="esample">
<pre>
@@ -97,27 +97,27 @@
</pre>
</div>
<p>
- <b>limitToList</b> attribute allows to dismiss the behaviour of the a4j:outputPanel's ajaxRendered
+ <b>limitToList</b> attribute allows to dismiss the behavior of the a4j:outputPanel ajaxRendered
attribute. limitToList = "false" means to update only the area(s) that mentioned in the
reRender attribute explicitly. All output panels with ajaxRendered="true" will be ignored.
</p>
<h1 class="hsample">Queue and Traffic Flood Protection</h1>
<p>
- <b>eventsQueue</b> attribute defines the name of the queue that will be used to order upcomming Ajax
+ <b>eventsQueue</b> attribute defines the name of the queue that will be used to order upcoming Ajax
requests. By default, RichFaces does not queue Ajax requests. If events are produced
- simultaneously, they will come to the server simultaniously. JSF implementations
- (especially, the very first ones) doe not guaranty that the request comes first will be
- served or pass the JSF lifecycle first. The order how the server side data
- will be modified in case of simultanious request might be unpredictable.
- Using eventsQueue attribute allows to avoid possible mess. Define the queue name explicitly,
- if you expect an intensive Ajax traffic in your application.
+ simultaneously, they will come to the server simultaneously. JSF implementations
+ (especially, the very first ones) does not guaranty that the request that comes first will be
+ served or passed into the JSF lifecycle first. The order how the server side data
+ will be modified in case of simultaneous request might be unpredictable.
+ Usage of eventsQueue attribute allows to avoid possible mess. Define the queue name explicitly,
+ if you expect intensive Ajax traffic in your application.
</p>
<p>
The next request posted in the same queue will wait until the previos one is not
- processed and Ajax response returns back if the eventsQueue attribute is defined. In
- addition, Richfaces starts to remove from the queue the 'similar' requests. 'Similar' are
- the requests that produced by the same event. For example, you have the following code,
- only the newest request will be sent to the server if user types very fast and typed
+ processed and Ajax response is returned back if the eventsQueue attribute is defined. In
+ addition, Richfaces starts to remove from the queue 'similar' requests. 'Similar' requests are
+ the requests produced by the same event. For example, according to the following code,
+ only the newest request will be sent to the server if a user types very fast and has typed
the several characters already before the previous Ajax response is back.
</p>
<div class="esample">
@@ -128,62 +128,62 @@
</pre>
</div>
<p><b>requestDelay</b> attribute defines the time (in ms.) that request will be wait in
- the queue before it is ready to be sent. When the delay time is over, the request will be
- sent to the server or removed if the newest 'similar' request is in queue already .
+ 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 .
</p>
<p><b>ignoreDupResponses</b> attributes orders to ignore the Ajax response produced by the
- request if the newest 'similar' request is in the queue already. ignoreDupResponses="true"
+ 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 unnssesary updates on the client side if the response loses the actuality.
+ avoid unnecessary updates on the client side if the response loses the actuality.
</p>
- <p>Defining the eventsQueue along with requestDelay allows to protect against unnssesary
- traffic flood and syncronizes the order of Ajax requests. If you have several source of
+ <p>Defining the eventsQueue along with requestDelay allows to protect against unnecessary
+ traffic flood and synchronizes Ajax requests order. If you have several sources of
Ajax requests, you can define the same queue name there. This might be very helpful if
you have Ajax components that invoke request asynchronously from the ones produced by
events from users. For example a4j:poll or a4j:push. In case the requests from such
- components modify the same data, the syncronization might be very helpful.</p>
+ components modify the same data, the synchronization might be very helpful.</p>
<h1 class="hsample">Data Processing Options</h1>
- <p>RichFaces uses form based appoach for sending Ajax request. This means each time, when
- user click an Ajax button or a4j:poll produces asynchronous request, the data from the closest
- JSF form is submitted behalf of XMLHTTPRequest object. The form data contains the values
+ <p>RichFaces uses form based approach for Ajax request sending. This means each time, when a
+ user click an Ajax button or a4j:poll produces an asynchronous request, the data from the closest
+ JSF form is submitted with the XMLHTTPRequest object. The form data contains the values
from the form input element and auxiliary information such as state saving data</p>
<p>
- <b>ajaxSingle</b> attribute when it equals true directs to include only the value of
+ When <b>ajaxSingle</b> attribute is equal true, it orders to include only a value of the
current component (along with f:param or a4j:action param values if any) to the request
- map. In case of a4j:support, it will be the value of the parent component.
+ map. In case of a4j:support, it will be a value of the parent component.
</p>
- <p> Note, that ajaxSingle="true" reduces the upcomming traffic, but does not
- prevent decoding other input components on the server side. Some JSF component,
- such as h:selectOneMenu do recognize the missing in the request map value as
- a null value and try to pass the validation process with failed result. So,
- use a4j:region to limit the part of the component tree that will be processed
- on the server side when it needs.
+ <p> Note, that ajaxSingle="true" reduces the upcoming traffic, but does not
+ prevent decoding other input components on the server side. Some JSF components,
+ such as h:selectOneMenu do recognize the missing data in the request map value as
+ a null value and try to pass the validation process with a failed result. Thus,
+ use a4j:region to limit a part of the component tree that will be processed
+ on the server side when it is required.
</p>
- <p><b>immediate</b> attribute has the same purpose as for any other non-JSF component.
- The default ActionListener should be executed immediately (i.e. during Apply Request
- Values phase of the request processing lifecycle), rather than waiting until the
- Invoke Application phase. Using immediate="true" is one of the way how to have the one
- data model values updated when the other cannot be updated because of problem with
+ <p><b>immediate</b> attribute has the same purpose as any other non-JSF component.
+ The default ActionListener should be executed immediately (i.e. during the Apply Request
+ Values phase of a request processing lifecycle), rather than waiting until the
+ Invoke Application phase. Using immediate="true" is one of the ways to have some
+ data model values updated when other cannot be updated because of a problem with
passing the Validation phase successfully. This might be important inside the
h:dataTable like components where using a4j:region is impossible due to the
h:dataTable component architecture.
</p>
<p><b>bypassUpdates</b> attribute allows to bypass the Update Model phase. It
- might be useful if you need to check the user input against the available validator,
- but not to update the model with those data. Note, that the a action will be invoked
+ might be useful if you need to check user input against the available validator,
+ but not to update the model with those data. Note, that an action will be invoked
at the end of the Validation phase only if the Validation phase is passed successfully.
The listeners of the Application phase will not be invoked in any case.
</p>
<h1 class="hsample">Action and Navigation</h1>
<p>Ajax component is similar to any other non-Ajax JSF component like h:commandButton. It
- allows to submit the form. You can use action and actionListener attribute to invoke
+ allows to submit the form. You can use action and actionListener attribute to invoke
the action method and define the action event.
</p>
<p>
- <b>action</b> method must return null if you want to have an Ajax response with partual page
- update. This is regular mode that names: "Ajax Request generates Ajax Response". In case of
- action does not return null, but the action outcome that match one of the navigation rule, RichFaces
+ <b>action</b> method must return null if you want to have an Ajax response with a partual page
+ update. This is regular mode called "Ajax Request generates Ajax Response". In case of
+ action does not return null, but the action outcome that matches one of navigation rules, RichFaces
starts to work in "Ajax Request generates Non-Ajax Response" mode.
This mode might be helpful in two major cases:
</p>
@@ -197,26 +197,26 @@
page update will be performed.
</li>
<li>If you want to involve the server side validators and navigate to the next page only if
- the Validation phase is passed succesefully, you can replace h:commandButton with a4j:commandButton
- and point to the action method that navigate to the next page. In case of Validation process failed,
- the partial page update will occure and user will see the error message. Otherwize, the application
- proceeds to the next page. Be sure, you define <redirect /%gt; option for the navigation rule to
- avoid the memory leaks.
+ the Validation phase is passed successfully, you can replace h:commandButton with a4j:commandButton
+ and point to the action method that navigates to the next page. If Validation process fails,
+ the partial page update will occur and a user will see an error message. Otherwize, the application
+ proceeds to the next page. Make sure, you define <redirect /%gt; option for the navigation rule to
+ avoid memory leaks.
</li>
</ol>
<h1 class="hsample">Javascript Interactions</h1>
<p>
- RichFaces allows to write Ajax-enabled JSF application without using Javascript hard.
+ RichFaces allows writing Ajax-enabled JSF application without writing any Javascript code.
However, you can still invoke the javascript code if you need. There are several ajax
attributes that helps to do it.
</p>
<p>
- <b>onsubmit</b> attribute allows to invoke javascript code before the Ajax request is
+ <b>onsubmit</b> attribute allows to invoke javascript code before an Ajax request is
sent. If 'onsubmit' returns false, the Ajax request is canceled. The code of 'onsubmit'
- is inserter before the RichFaces Ajax call. So, the 'onsubmit' should not has a 'return'
- statment is you want the Ajax request to be send. if you are going to invoke a javscript
- function that return true or false, use the conditional statment to return something only
- in you need to cancel the request. For example, onsubmit="if (mynosendfunct()==false){return false}".
+ is inserted before the RichFaces Ajax call. Hence, the 'onsubmit' should not has a 'return'
+ statement if you want the Ajax request to be sent. If you are going to invoke a javscript
+ function that returns true or false, use the conditional statement to return something only
+ when you need to cancel the request. For example, onsubmit="if (mynosendfunct()==false){return false}".
</p>
<p>
<b>onclick</b> attribute is similar to the 'onsubmit', but for clickable components such
@@ -225,14 +225,14 @@
<p>
<b>oncomplete</b> attribute allows to invoke the javascript code right after the
Ajax response is returned back and the DOM tree of the browser is updated. Richfaces
- register the code for further invocation to XMLHTTP request object before the Ajax
- request is send. This means the code will not be changed during processing
+ registers the code for further invocation of XMLHTTP request object before an Ajax
+ request is sent. This means the code will not be changed during processing of
the request on the server if you use JSF EL value binding. Also, you cannot use
'this' inside the code, because it will not point the component where Ajax request
was initiated.
</p>
<p>
- <b>data</b> attribute allows to get the additional data from the server during the
+ <b>data</b> attribute allows to get the additional data from the server during an
Ajax call. You can use JSF EL to point the property of the managed bean and its value
will be serialized in JSON format and be available on the client side. You can refer
to it using the 'data' variable. For example:
@@ -243,8 +243,8 @@
</pre>
</div>
<p>
- Richfaces allows to serialize into JSON format not only primitive types, but complex
- type including arrays and collections. The beans should be serializable to be refered
+ Richfaces allows to serialize not only primitive types into JSON format, but also complex
+ types including arrays and collections. The beans should be serializable to be refered
with 'data'.
</p>
18 years, 9 months
JBoss Rich Faces SVN: r2099 - trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-08-07 09:40:39 -0400 (Tue, 07 Aug 2007)
New Revision: 2099
Modified:
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
Log:
http://jira.jboss.com/jira/browse/RF-504
Modified: trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
===================================================================
--- trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-08-07 13:40:19 UTC (rev 2098)
+++ trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-08-07 13:40:39 UTC (rev 2099)
@@ -176,7 +176,7 @@
sliderValue = this.getNearestValue(sliderValue);
this.value = sliderValue;
this.handle.style.left = this.translateToPx(sliderValue);
- if (!this.editInFocus && (this.required || "" != this.input.value)){
+ if (!this.editInFocus && (this.required || "" != this.input.value || this.updating)){
this.input.value = this.value;
}
if (!this.tip.firstChild) {
@@ -209,6 +209,8 @@
},
startDrag: function(event) {
+ if (this.editInFocus)
+ this.input.blur();
window.document.onmouseup = this.eventMouseUp.bindAsEventListener(this);
window.document.onmousemove = this.eventMouseMove.bindAsEventListener(this);
this.editBlur();
@@ -234,12 +236,14 @@
},
update: function(event) {
+ this.updating = true;
if(this.active) {
if(!this.dragging) this.dragging = true;
this.draw(event);
Event.stop(event);
}
+ this.updating = false;
},
draw: function(event) {
18 years, 9 months
JBoss Rich Faces SVN: r2098 - trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-08-07 09:40:19 -0400 (Tue, 07 Aug 2007)
New Revision: 2098
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
style fixes
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-08-07 13:27:24 UTC (rev 2097)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-08-07 13:40:19 UTC (rev 2098)
@@ -893,8 +893,12 @@
// class styles
e = Element.classNames(element);
- if (dataobj._month!=0) { e.add('calendar_boundary_dates'); if (boundaryDatesModeFlag) e.add('calendar_btn');}
- else e.add('calendar_btn');
+ if (dataobj._month!=0) { e.add('calendar_boundary_dates'); if (boundaryDatesModeFlag) e.add('calendar_btn'); else e.remove('calendar_btn');}
+ else
+ {
+ e.remove('calendar_boundary_dates');
+ e.add('calendar_btn');
+ }
// TODO make some optimization with calendar_current class
if (todayflag && dataobj._month==0 && dataobj.day==todaydate) e.add("calendar_current"); else e.remove("calendar_current");
18 years, 9 months
JBoss Rich Faces SVN: r2097 - trunk/ui/calendar/design/funcspec.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-08-07 09:27:24 -0400 (Tue, 07 Aug 2007)
New Revision: 2097
Modified:
trunk/ui/calendar/design/funcspec/FuncSpec - RF Calendar Component.doc
Log:
Modified: trunk/ui/calendar/design/funcspec/FuncSpec - RF Calendar Component.doc
===================================================================
(Binary files differ)
18 years, 9 months