Author: artdaw
Date: 2008-04-11 09:05:31 -0400 (Fri, 11 Apr 2008)
New Revision: 7766
Modified:
trunk/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml
Log:
http://jira.jboss.com/jira/browse/RF-1226 - Details of Usage were changed
Modified: trunk/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml 2008-04-11
13:04:56 UTC (rev 7765)
+++ trunk/docs/userguide/en/src/main/docbook/included/inplaceSelect.xml 2008-04-11
13:05:31 UTC (rev 7766)
@@ -19,23 +19,23 @@
<tbody>
<row>
<entry>component-type</entry>
- <entry>org.richfaces.inplaceInput</entry>
+ <entry>org.richfaces.InplaceSelect</entry>
</row>
- <!--row>
+ <row>
<entry>component-class</entry>
- <entry></entry>
- </row-->
+
<entry>org.richfaces.component.html.HtmlInplaceSelect</entry>
+ </row>
<row>
- <entry>component-family</entry>
- <entry>org.richfaces.inplaceInput</entry>
+ <entry>component-family</entry>
+ <entry>org.richfaces.InplaceSelect</entry>
</row>
<row>
- <entry>renderer-type</entry>
-
<entry>org.richfaces.renderkit.inplaceInputRenderer</entry>
+ <entry>renderer-type</entry>
+
<entry>org.richfaces.renderkit.InplaceSelectRenderer</entry>
</row>
<row>
<entry>tag-class</entry>
- <entry>org.richfaces.taglib.inplaceInputTag</entry>
+ <entry>org.richfaces.taglib.InplaceSelectTag</entry>
</row>
</tbody>
</tgroup>
@@ -49,10 +49,8 @@
<!-- itemLabels has to have realy value-->
<programlisting role="XML"><![CDATA[...
-<rich:inplaceSelect value="#{Bean.inputValue}" defaultLabel="Click to
edit">
- <f:selectItems value="#{bean.selectItems}"/>
+<rich:inplaceSelect value="#{bean.inputValue}">
<f:selectItem itemValue="1" itemLabel="factory"/>
- <f:selectItem itemValue="2" itemLabel="newspaper"/>
</rich:inplaceSelect>
...]]></programlisting>
</section>
@@ -67,22 +65,51 @@
...]]></programlisting>
</section>
-
-
-
-
<!-- Start Details of Usage-->
<section>
<title>Details of Usage</title>
+
+ <para>
+ The
<emphasis><property>"value"</property></emphasis>
attribute is a value-binding expression for the current value of the component.
+ </para>
<para>
- The <emphasis
role="bold"><property><rich:inplaceSelect></property>
</emphasis> component has three functional states, which are:
- </para>
- <para>
+ The <emphasis
role="bold"><property><rich:inplaceSelect></property>
</emphasis> component has three functional states:
+ </para>
<itemizedlist>
<listitem>
- <para><property>View </property>state displays some sting
type data that
<emphasis><property>"value"</property></emphasis>
or
<emphasis><property>"defaultLabel"</property></emphasis>
attributes contain;</para>
- <figure>
+ <para>
+ <property>View</property> state displays default label with the
value taken from
+
<emphasis><property>"value"</property></emphasis>
or
<emphasis><property>"defaultLabel"</property></emphasis>
attributes.
+ </para>
+ <para>
+ If the initial value of the
<emphasis><property>"value"</property></emphasis>
+ attribute is "null" or <property>empty
string</property>
+ the
<emphasis><property>"defaultLabel"</property></emphasis>
attribute is used to define default label.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:inplaceSelect value="#{bean.value}" defaultLabel="click to
edit">
+ <f:selectItems value="#{bean.selectItems}" />
+</rich:inplaceSelect>
+...]]> </programlisting>
+ <para>
+ The managed bean code:
+ </para>
+ <programlisting role="JAVA"><![CDATA[...
+private String value = "";
+...]]> </programlisting>
+ <para>
+ In the example above the
<emphasis><property>"value"</property></emphasis>
attribute is empty string
+ therefore "click to edit" value is displayed since it is
placed into the
+
<emphasis><property>"defaultLabel"</property></emphasis>
attribute.
+ </para>
+ <para>
+ This is the result:
+ </para>
+ <figure>
<title>View state</title>
<mediaobject>
<imageobject>
@@ -92,8 +119,10 @@
</figure>
</listitem>
<listitem>
- <para><property>Edit </property>state displays a list with
options;</para>
- <figure>
+ <para>
+ <property>Edit </property>state - select representation to
allow value edit
+ </para>
+ <figure>
<title>Edit state</title>
<mediaobject>
<imageobject>
@@ -103,7 +132,9 @@
</figure>
</listitem>
<listitem>
- <para><property>Changed </property>state displays the value
of the selected option as text</para>
+ <para>
+ <property>Changed</property> state - value representation after
it was changed
+ </para>
<figure>
<title>Changed state</title>
<mediaobject>
@@ -115,101 +146,159 @@
</listitem>
</itemizedlist>
- </para>
-
- <para>
- The
-
<emphasis><property>"value"</property></emphasis>
- attribute displays the value as text.
- The attribute is defined when some option in the list is selected.
- </para>
-
-
-
-
- <para>You can form he list of the options: using
- <emphasis
role="bold"><property><f:selectItem></property></emphasis>
and
- <emphasis
role="bold"><property><f:selectItems></property></emphasis>
</para>
- <para>Please see the example below</para>
-
-
-
-
-
-<para>
+ <para>
+ You can form the list of the options using <emphasis
role="bold"><property><f:selectItem/></property></emphasis>
and
+ <emphasis
role="bold"><property><f:selectItems/></property></emphasis>
facets.
+ </para>
+ <para>
+ Please, see the example below.
+ </para>
+ <para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}"
showControls="true" defaultLabel="click to edit">
+<rich:inplaceSelect value="#{bean.inputValue}" defaultLabel="click to
edit">
<f:selectItems value="#{bean.selectItems}"/>
<f:selectItem itemValue="1" itemLabel="factory"/>
<f:selectItem itemValue="2" itemLabel="newspaper"/>
</rich:inplaceSelect>
-...]]> </programlisting>
+...]]></programlisting>
<para>
- The
<emphasis><property>"value"</property></emphasis>
attribute gets
- some value when an option in the select-box in clicked on (the default action).
+ In the example above the value of the selected item is available via
<emphasis><property>"value"</property></emphasis>
attribute.
</para>
-
- <para>
- Nowever, if you want the end user to confirm the data saving explicitly you can:
</para>
+ <para>
+ The
<emphasis><property>"editEvent"</property></emphasis>
attribute provides an option to assign an JavaScript action
+ that initiates the change of the state from <property>view</property>
to <property>edit</property>.
+ The default value is "onclick".
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:inplaceSelect value="#{bean.inputValue}" defaultLabel="Double
Click to edit" editEvent="ondblclick">
+ <f:selectItems value="#{demo.selectItems}" />
+</rich:inplaceSelect>
+...]]></programlisting>
+ <para>
+ The <emphasis
role="bold"><property><rich:inplaceSelect></property></emphasis>
+ component provides specific event attributes:
+ </para>
<itemizedlist>
<listitem>
- <para>Use a
<emphasis><property>"showControls"</property></emphasis>
attribute, which makes "Save" and "Cancel" buttons
(displayed as icons) appear next to the input field;
+ <para>
+
<emphasis><property>"oneditactivation"</property></emphasis>
which is fired on <property>edit</property> state activation
</para>
- <para>Please see the example </para>
+ </listitem>
+ <listitem>
<para>
+
<emphasis><property>"oneditactivated"</property></emphasis>
which is fired when <property>edit</property> state is activated
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+
<emphasis><property>"onviewactivation"</property></emphasis>
which is fired on <property>view</property> state activation
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+
<emphasis><property>"onviewactivated"</property></emphasis>
which is fired after the component is changed to representation state
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:inplaceSelect value="#{bean.inputValue}" oneditactivation="if
(confirm('Are you sure you want to change value?')){return false;}">
+ <f:selectItems value="#{demo.selectItems}" />
+</rich:inplaceSelect>
+...]]> </programlisting>
+ <para>
+ The given code illustrates how
<emphasis><property>"oneditactivation"</property></emphasis>
attribute works,
+ namely when the state is being changed from <property>view</property>
to <property>edit</property>,
+ a confirmation window with a message "Are you sure you want to change
value?" comes up.
+ </para>
+ <para>
+ The
<emphasis><property>"selectOnEdit"</property></emphasis>
(with possible values "true", "false") gives you an
+ option to make the text in the input field selected right after the change from
<property>view</property> state to <property>edit</property>
occurs.
+ </para>
+ <para>
+ Another useful attribute is
<emphasis><property>"openOnEdit"</property></emphasis>.
+ With "true" value it defines that the drop-down list with items
opens automatically after <property>edit</property> state is activated.
+ </para>
+
+ <para>
+ Nowever, if you want to confirm the data saving explicitly you can use the
<emphasis><property>"showControls"</property></emphasis>
attribute,
+ which makes "Save" and "Cancel" buttons
(displayed as icons) appear next to the input field.
+ </para>
+ <para>
<emphasis role="bold">Example:</emphasis>
- </para>
-
+ </para>
<programlisting role="XML"><![CDATA[...
- <rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}"
- defaultLabel="Click here to edit">
- <f:selectItem itemValue="0" itemLabel="oil well"/>
- <f:selectItem itemValue="1" itemLabel="factory"/>
- <f:selectItem itemValue="2" itemLabel="newspaper"/>
- </rich:inplaceSelect>
-...]]> </programlisting>
+<rich:inplaceSelect value="#{bean.inputValue}"
showControls="true">
+ <f:selectItems value="#{bean.selectItems}"/>
+</rich:inplaceSelect>
+...]]></programlisting>
- </listitem>
-
+ <para>
+ You can also position the controls relatively to the input field, by means of
+ </para>
+ <itemizedlist>
<listitem>
- <para>Use standard buttons by means of the
<emphasis><property>"controls"</property></emphasis>facet
+ <para>
+ The
<emphasis><property>"controlsHorizontalPosition"</property></emphasis>
attribute
+ with "left", "right" and
"center" definitions
</para>
- <para>Please see the example </para>
+ </listitem>
+ <listitem>
<para>
+ The <emphasis><property>"controlsVerticalPosition
"</property></emphasis> attribute
+ with "bottom", "center" and
"top" definitions
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:inplaceSelect value="#{bean.inputValue}"
controlsHorizontalPosition="left" controlsVerticalPosition="bottom"
showControls="true">
+ <f:selectItems value="#{bean.selectItems}"/>
+</rich:inplaceSelect>
+...]]> </programlisting>
+
+
+ <para>It is also possible to use
<emphasis><property>"controls"</property></emphasis>
+ facet in order to replace the default controls with facets content. See the
example below.
+ </para>
+ <para>Please, see the example.</para>
+ <para>
<emphasis role="bold">Example:</emphasis>
</para>
-
<programlisting role="XML"><![CDATA[...
-<rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}"
defaultLabel="Click to edit" showControls="true">
+<rich:inplaceSelect value="#{bean.inputValue}" showControls="true"
controlsHorizontalPosition="left"
controlsVerticalPosition="bottom">
<f:facet name="controls">
- <input type="button" value="Save"/>
- <input type="button" value="Cancel"/>
- </f:facet>
- <f:selectItem itemValue="0" itemLabel="oil well"/>
- <f:selectItem itemValue="1" itemLabel="factory"/>
- <f:selectItem itemValue="2" itemLabel="newspaper"/>
+ <button onclick="#{rich:component('inplaceSelect')}.save();"
type="button">Save</button>
+ <button
onclick="#{rich:component('inplaceSelect')}.cancel();"
type="button">Cancel</button>
+ </f:facet>
+ <f:selectItems value="#{bean.selectItems}"/>
</rich:inplaceSelect>
...]]> </programlisting>
-
- </listitem>
- </itemizedlist>
-
-
+
<note>
<title>Note:</title>
<para>
- The <emphasis>
<property>"controls"</property></emphasis>facet also
implies using showcontrols
+ The <emphasis>
<property>"controls"</property></emphasis>facet also
implies using
+
<emphasis><property>"showControls"</property></emphasis>
attribute and it has to be defined as "true".
</para>
</note>
<!--Icons redefinitions-->
- <para>
+ <!--para>
Redefinition of the
"save" and "cancel" icons can be performed
using
<emphasis><property>"saveControlIcon"</property></emphasis>
@@ -234,89 +323,28 @@
<f:selectItem itemValue="1" itemLabel="factory"/>
<f:selectItem itemValue="2" itemLabel="newspaper"/>
</rich:inplaceSelect>
- ...]]> </programlisting>
+ ...]]> </programlisting-->
<para>
- You can also position the controls relatively to the input field, by means of
- <emphasis><property>"
controlsHorizontalPosition"</property></emphasis>
- <emphasis><property>" controlsVerticalPosition
"</property></emphasis>
- attributes.
-
- The
- <emphasis><property>"
controlsHorizontalPosition"</property></emphasis> attribute has
- "left", "right" and
"center" definitions.
-
- The
- <emphasis><property>" controlsVerticalPosition
"</property></emphasis>
- attribute has "bottom", "center" and
"top" definitions.
+ The <emphasis
role="bold"><property><rich:inplaceSelect></property></emphasis>
component could be rendered with
+ <emphasis
role="bold"><property><span></property></emphasis>
or <emphasis
role="bold"><property><div></property></emphasis>
+ elements to display its value.
+ In order to change default <emphasis
role="bold"><property><span></property></emphasis>
output,
+ use the
<emphasis><property>"layout"</property></emphasis>
attribute with "block" value.
</para>
-
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<rich:inplaceSelect value="#{inplaceComponentsBean.inputValue}"
defaultLabel="Click to edit" controlsHorizontalPosition="left"
controlsVerticalPosition="top" showControls="true">
- <f:facet name="controls" >
- <input type="button" value="Save"/>
- <input type="button" value="Cancel"/>
- </f:facet>
- <f:selectItem itemValue="0" itemLabel="oil well"/>
- <f:selectItem itemValue="1" itemLabel="factory"/>
- <f:selectItem itemValue="2" itemLabel="newspaper"/>
-</rich:inplaceSelect>
-...]]> </programlisting>
-
- <para>
- Another useful attribute is
-
<emphasis><property>"openOnEdit"</property></emphasis>.
- It allows you to make the drop-down box with options appear once
"edit" state activated.
- </para>
-
-
-
-
-
-
<para>
- The
-
<emphasis><property>"editEvent"</property></emphasis>
- attribute provides an option to assign an JavaScript action that initiates the
change of the state from
- <property>view</property>
- to
- <property>edit</property>.
-
-
- The default value is "click".
-
- </para>
-
-
-
- <note>
- <title>Note:</title>
- <para>
- Do not use "on" prefix applying event action. E.g. use
"click" instead of "onClick", use
"mouseover" instead of "onMouseOver".
- </para>
- </note>
-
- <para>
- The
-
<emphasis><property>"selectOnEdit"</property></emphasis>
- (with possible values "true", "false") gives
you an
- option to make the text in the input area selected right after the change from
- <property>view</property> state to
<property>edit</property> occurs.
-
- </para>
-
-
+ The <emphasis
role="bold"><property><rich:inplaceSelect></property></emphasis>
component supports standard
+
<emphasis><property>"tabindex"</property></emphasis>
attribute.
+ When the component gets focus and the
<emphasis><property>"editOnTab"</property></emphasis>
attribute is "true"
+ the <property>edit</property> mode is activated and drop-down list is
opened.
+ </para>
<para>
The
- <emphasis><property>"
inputWidth"</property></emphasis> ,
- <emphasis><property>"
minInputWidth"</property></emphasis> , and
- <emphasis><property>"
maxInputWidth"</property></emphasis>
+
<emphasis><property>"selectWidth"</property></emphasis>
,
+
<emphasis><property>"minSelectWidth"</property></emphasis>
and
+
<emphasis><property>"maxSelectWidth"</property></emphasis>
attributes are provided to specify the width, minimal width and maximal width for
the input element respectively.
</para>
<para>
@@ -326,19 +354,6 @@
</para>
- <para>
- The
- <emphasis><property>"
oneditactivation"</property></emphasis> ,
-
<emphasis><property>"oneditactivated"</property></emphasis>
,
-
<emphasis><property>"onviewactivation"</property></emphasis>
- and
- <emphasis><property>"
onviewactivated"</property></emphasis> attributes
- provide a possibility to assign JavaScript code on
- <property>edit</property> state activation, on
- <property>edit</property> state activated,on
- <property>view</property> state activation and on
- <property>view</property> state activated respectively.
- </para>
</section>
<!-- End. Details of Usage-->