[richfaces-svn-commits] JBoss Rich Faces SVN: r11735 - 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 07:00:37 EST 2008
Author: atsebro
Date: 2008-12-12 07:00:37 -0500 (Fri, 12 Dec 2008)
New Revision: 11735
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml
Log:
RF-5219: dropSupport: typeMapping attribute have wrong description.
Modified: trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml 2008-12-12 11:52:46 UTC (rev 11734)
+++ trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml 2008-12-12 12:00:37 UTC (rev 11735)
@@ -95,66 +95,68 @@
<section>
<title>Details of Usage</title>
- <para>
- As shown in the example, the key attribute for
- <emphasis role="bold">
- <property><rich:dropSupport></property>
- </emphasis>
- is
- <emphasis>
- <property>"acceptedTypes"</property>
- </emphasis>
- . This attribute defines the types of draggable items that
- can be dropped onto the designated drop zone.
+ <para>The key attribute for <emphasis role="bold"><property><rich:dropSupport></property></emphasis> is <emphasis><property>"acceptedTypes"</property></emphasis>.
+ It defines, which types of dragable items (zones) could be accepted by the current drop zone. Check the example below:
</para>
-
- <para>
- The second most important attribute for
- <emphasis role="bold">
- <property><rich:dropSupport></property>
- </emphasis>
- is
- <emphasis>
- <property>"typeMapping"</property>
- </emphasis>
- . This attribute maps a specific type among the acceptable
- types for draggable items to a specific
- <emphasis role="bold">
- <property><rich:dndParam></property>
- </emphasis>
- child element under
- <emphasis role="bold">
- <property><rich:dropSupport></property>
- </emphasis>
- .
- </para>
-
-
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
-
- <programlisting role="XML"><![CDATA[...
- <rich:dropSupport acceptedTypes="[iconsDragged, textDragged]" typeMapping="{iconsDragged: DropIcon}">
- <rich:dndParam name="DropIcon">
- <h:graphicImage value="/images/drop-icon.png"/>
- </rich:dndParam>
+ <programlisting role="XML"><![CDATA[...
+<rich:panel styleClass="dropTargetPanel">
+ <f:facet name="header">
+ <h:outputText value="PHP Frameworks" />
+ </f:facet>
+
+ <rich:dropSupport id="php" acceptedTypes="PHP" dropValue="PHP" dropListener="#{eventBean.processDrop}" reRender="phptable, src">
+ </rich:dropSupport>
+ ...
+</rich:panel>
...
]]></programlisting>
+ <para>and here is what happens on the page:</para>
+ <figure>
+ <title>Drop zone accepts dragable item with "PHP" type only</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/dropSupport1.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para><emphasis><property>"typeMapping"</property></emphasis>. Previous example shows that a drop zone could accept a dragable item or not.
+ Special markers, which are placed at <emphasis role="bold"><property><rich:dragIndicator></property></emphasis>, inform user about drop zone’s possible behaviors:
+ "checkmark" appears if drop is accepted and "No stop" sign if it is not.
+ Moreover, some extra information (e.g. text message) could be put into the Indicator to reinforce the signal about drop zone’s behavior or pass some other additional sense.
+ This reinforcement could be programmed and attributed to drop zone via <emphasis><property>"typeMapping"</property></emphasis> attribute using JSON syntax.
+ The type of dragged zone (dragType) should be passed as "key" and name of <emphasis role="bold"><property><rich:dndParam></property></emphasis>
+ that gives needed message to Indicator as "value":
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:panel styleClass="dropTargetPanel">
+ <f:facet name="header">
+ <h:outputText value="PHP Frameworks" />
+ </f:facet>
+
+ <rich:dropSupport id="php" acceptedTypes="PHP" dropValue="PHP" dropListener="#{eventBean.processDrop}" reRender="phptable, src"
+ typeMapping="{PHP: text_for_accpet, DNET: text_for_rejection}">
+ <rich:dndParam name="text_for_accepting" value="Drop accepted!" />
+ <rich:dndParam name="text_for_rejecting" value="Drop is not accepted!" />
+ </rich:dropSupport>
+ ...
+</rich:panel>
+...
+]]></programlisting>
+ <para>What happens on the page:</para>
+ <figure>
+ <title>"typeMapping" helps to add some extra information to <rich:drag indicator> </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/dropSupport1a.png" />
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In examples above dropping a dragable item triggers the use a parameter in the event processing; Ajax request is sent and dropListener defined for the component is called.
+ </para>
<para>
- In this example, dropping a draggable item of an
- <emphasis>
- <property>"iconsDragged"</property>
- </emphasis>
- type will trigger the use a parameter named
- <code>"DropIcon"</code>
- in the event processing after a drop event. (Also, an Ajax
- request is sent, and the action and dropListener defined for
- the component are called.)
- </para>
-
- <para>
Here is an example of moving records between tables. The
example describes all the pieces for drag-and-drop. (To get
extra information on these components, read the sections for
More information about the richfaces-svn-commits
mailing list