[richfaces-svn-commits] JBoss Rich Faces SVN: r11749 - trunk/docs/userguide/en/src/main/docbook/included.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri Dec 12 12:38:13 EST 2008


Author: msorokin
Date: 2008-12-12 12:38:13 -0500 (Fri, 12 Dec 2008)
New Revision: 11749

Modified:
   trunk/docs/userguide/en/src/main/docbook/included/editor.xml
Log:
https://jira.jboss.org/jira/browse/RF-5042
added some info about events handling to the guide

Modified: trunk/docs/userguide/en/src/main/docbook/included/editor.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/editor.xml	2008-12-12 17:37:15 UTC (rev 11748)
+++ trunk/docs/userguide/en/src/main/docbook/included/editor.xml	2008-12-12 17:38:13 UTC (rev 11749)
@@ -125,12 +125,7 @@
                     </h:selectOneRadio>
                     ...
                     ...]]></programlisting>  
-                     <para>
-                              Apart from the attributes that define the editor&apos;s properties there are  some attributes that help  handle events(custom event handlers).
-                    </para>
-                    <para>
-                              All custom event handlers  are listed in the table of attributes and you can use them the same way as standard HTML event handlers. 
-                    </para>
+             
 
 
                     <para>Most configuration options that TinyMCE provides can be applied using &lt;f:param&gt; JSF tag. 
@@ -283,6 +278,40 @@
                               
                     </itemizedlist>
                     
+                    <para>
+                              The implementation of the <emphasis role="bold"> <property>&lt;rich:editor&gt;</property></emphasis> component has two  methods for handling
+                    events. 
+                    </para>  
+                    <para>The attributes take some function name as a value with is triggered on the appropriate event.  You need to use standard JavaScript function calling syntax. </para>
+                    
+                    <itemizedlist>                    
+                    <listitem>
+                              <para>Using  attributes (<property>&quot;onchange&quot;</property>, <property>&quot;oninit&quot;</property>,<property>&quot;onsave&quot;</property>,<property>&quot;onsetup&quot;</property>) </para>
+                              <para>
+                                        <emphasis role="bold">Example:</emphasis>
+                              </para>
+                              
+               <programlisting role="XML"><![CDATA[...
+<rich:editor value="#{bean.editorValue}"onchange="myCustomOnChangeHandler()"  ... />
+...]]></programlisting> 
+                    
+                    </listitem>
+                              
+                              <listitem>
+                                        <para>Using  &lt;f:param&gt;  as a child element defining the <property>&quot;name&quot;</property> attribute with one of the TinyMCE&apos;s callbacks and the <property>&quot;value&quot;</property> attribute takes the function name you want to be called on the corresponding event as the value. Note, that the syntax in this case is a bit different: parentheses are not required. </para>
+                              </listitem>
+                              
+                              
+                              <programlisting role="XML"><![CDATA[...
+<rich:editor value="#{bean.editorValue}" ...>
+<f:param name="onchange" value="myCustomOnChangeHandler">
+</rich:editor>
+...]]></programlisting> 
+                              
+                              
+                    </itemizedlist>
+                    
+                    
                     <para>The <emphasis role="bold"> <property>&lt;rich:editor&gt;</property></emphasis> 
                               component has a build-in converter that renders HTML code generated by the editor 
                               to Seam text (you can read more Seam text <ulink url="http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/text.html">here</ulink>.), it also interprets Seam text




More information about the richfaces-svn-commits mailing list