[richfaces-svn-commits] JBoss Rich Faces SVN: r4646 - branches/3.1.x/docs/userguide/en/src/main/docbook/included.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Dec 10 08:12:22 EST 2007


Author: artdaw
Date: 2007-12-10 08:12:21 -0500 (Mon, 10 Dec 2007)
New Revision: 4646

Modified:
   branches/3.1.x/docs/userguide/en/src/main/docbook/included/contextMenu.xml
Log:
http://jira.jboss.com/jira/browse/RF-1298 - add 'attached',  'event' attributes, add examples and screenshot

Modified: branches/3.1.x/docs/userguide/en/src/main/docbook/included/contextMenu.xml
===================================================================
--- branches/3.1.x/docs/userguide/en/src/main/docbook/included/contextMenu.xml	2007-12-10 12:01:41 UTC (rev 4645)
+++ branches/3.1.x/docs/userguide/en/src/main/docbook/included/contextMenu.xml	2007-12-10 13:12:21 UTC (rev 4646)
@@ -46,9 +46,12 @@
             <emphasis role="bold">Example:</emphasis>
         </para>
         <programlisting role="XML"><![CDATA[...
-<rich:contextMenu value="Menu1">
-    <!--Nested menu components-->
-</rich:contextMenu>
+<h:panelGroup id="MyGroup">
+        <!-- Panel Content-->
+        <rich:contextMenu id="Menu1">
+                <!--Nested menu components-->
+        </rich:contextMenu>
+</h:panelGroup>
 ...]]></programlisting>
     </section>
     <section>
@@ -64,20 +67,75 @@
 
     <section>
         <title>Details of Usage</title>
-        <para>All attributes except <emphasis>
-                <property>&quot;value&quot;</property>
-            </emphasis> are optional. The <emphasis>
-                <property>&quot;value&quot;</property>
-            </emphasis> attribute defines text to be represented. For the same purpose you can also
-            use the <emphasis>
-                <property>&quot;label&quot;</property>
-            </emphasis> facet.</para>
-
+        <para>
+            <emphasis role="bold">
+                <property>&lt;rich:contexMenu&gt;</property>
+            </emphasis> is a support-like component. It is possible to define it as a child to some component 
+            and specify some events that trigger the menu.
+        </para>
+        <para>
+            The  <emphasis><property>&quot;attached&quot;</property></emphasis> attribute defines the state of the component.
+            If the value of the <emphasis><property>&quot;attached&quot;</property></emphasis> attribute is true, 
+            component is attached to parent component. 
+        </para>
+        <para>
+            <emphasis role="bold">Example:</emphasis>
+        </para>   
+        <programlisting role="XML"><![CDATA[...
+<rich:dataTable id="table" value="#{bean.model}" var="row" rows="5">
+        <rich:column>
+	      <f:facet name="header">
+	              <h:outputText value="Packages" />
+	      </f:facet>
+	      <h:outputText value="#{row.first}" />
+                <rich:contextMenu id="Menu1" attached="true">
+	             <rich:menuItem value="Edit package" action="#{bean.create}" />
+	             <rich:menuItem value="Delete package" action="#{bean.edit}" />
+	      </rich:contextMenu>
+        </rich:column>
+</rich:dataTable>
+...]]></programlisting>
+        <para>
+            If the value of the <emphasis><property>&quot;attached&quot;</property></emphasis> attribute is false, 
+            component activates by JavaScript API or with assistance of <emphasis role="bold"><property>&lt;rich:componentControl&gt;</property></emphasis>.
+        </para>
+        <para>
+            <emphasis role="bold">Example:</emphasis>
+        </para>   
+        <programlisting role="XML"><![CDATA[...
+<rich:dataTable id="table" value="#{bean.model}" var="row" rows="5">
+        <rich:column id="c1">
+	      <f:facet name="header">
+	              <h:outputText value="Packages" />
+	      </f:facet>
+	      <h:outputText value="#{row.first}" />
+	      <rich:componentControl event="oncontextmenu" attachTo="c1" for=":f:m" operation="doShow">
+	              <f:param name="param" value="#{row.first}" />
+	      </rich:componentControl>
+        </rich:column>
+</rich:dataTable>
+<rich:contextMenu id="Menu1" attached="false">
+        <rich:menuItem value="Edit package" action="#{bean.edit}" />
+        <rich:menuItem value="Delete package" action="#{bean.delete}" />
+ </rich:contextMenu>
+ ...]]></programlisting>
+        <figure>
+            <title>Using the <emphasis><property>&quot;attached&quot;</property></emphasis> attribute</title>
+            <mediaobject>
+                <imageobject>
+                    <imagedata fileref="images/contextMenu_attached.png" scalefit="1"/>
+                </imageobject>
+            </mediaobject>
+        </figure>
+        <para>
+            The  <emphasis><property>&quot;event&quot;</property></emphasis> attribute defines the event on the parent element 
+            that triggers the menu&apos;s appearance (<property>oncontextmenu</property> by default).
+        </para>        
         <para>The <emphasis role="bold">
                 <property>&lt;rich:contexMenu&gt;</property>
             </emphasis>
             <emphasis>
-                <property>"submitMode"</property>
+                <property>&quot;submitMode&quot;</property>
             </emphasis> attribute can be set to three possible parameters:</para>
 
         <itemizedlist>
@@ -103,10 +161,10 @@
         </itemizedlist>
 
         <para>The <emphasis>
-                <property>"action"</property>
+                <property>&quot;action&quot;</property>
             </emphasis> and <emphasis>
-                <property>"actionListener"</property>
-            </emphasis> item's attributes are ignored. Menu items don't fire any submits themselves.
+                <property>&quot;actionListener&quot;</property>
+            </emphasis> item&apos;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">
@@ -114,15 +172,11 @@
             </emphasis> component doesn't provide its own form, use it between
             &lt;h:form&gt; and &lt;/h:form&gt; tags.</note>
 
-        <para><emphasis role="bold">
-                <property>&lt;rich:menuGroup&gt;</property>
-            </emphasis>, <emphasis role="bold">
-                <property>&lt;rich:menuItem&gt;</property>
-            </emphasis> and <emphasis role="bold">
-                <property>&lt;rich:menuSeparator&gt;</property>
-            </emphasis> components is used as nested elements for <emphasis role="bold">
-                <property>&lt;rich:contexMenu&gt;</property>
-            </emphasis>.</para>
+        <para><emphasis><property><link linkend="menuGroup">&lt;rich:menuGroup&gt;</link></property></emphasis>, 
+            <emphasis><property><link linkend="menuItem">&lt;rich:menuItem&gt;</link></property></emphasis> 
+            and <emphasis><property><link linkend="menuSeparator">&lt;rich:menuSeparator&gt;</link></property></emphasis> 
+            components is used as nested elements for <emphasis role="bold"><property>&lt;rich:contexMenu&gt;</property></emphasis>.
+        </para>
 
         <!-- Will be done for latest version -->
         <!--para> It&apos;s possible to define the direction for list appear in the <emphasis>




More information about the richfaces-svn-commits mailing list