You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2007/05/30 18:22:55 UTC
svn commit: r542861 -
/struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java
Author: musachy
Date: Wed May 30 09:22:53 2007
New Revision: 542861
URL: http://svn.apache.org/viewvc?view=rev&rev=542861
Log:
Improve bind tag documentation
Modified:
struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java
Modified: struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java?view=diff&rev=542861&r1=542860&r2=542861
==============================================================================
--- struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java (original)
+++ struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java Wed May 30 09:22:53 2007
@@ -36,15 +36,28 @@
* making an asynchronous request to the specified href, and updating multiple targets.
* </p>
* <!-- END SNIPPET: javadoc -->
+ *
* <p>Examples</p>
+ *
+ * <!-- START SNIPPET: example0 -->
+ * <p>Without attaching to an event, listening to a topic (used to make an Ajax call)</p>
+ * <pre>
+ * <sx:bind href="%{#ajaxTest}" listenTopics="/makecall"/>
+ * <s:submit onclick="dojo.event.topic.publish('/makecall')"/>
+ * </pre>
+ * <!-- END SNIPPET: example0 -->
+ *
* <!-- START SNIPPET: example1 -->
+ * <p>Attached to event 'onclick' on submit button</p>
* <pre>
* <img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
* <sx:bind id="ex1" href="%{#ajaxTest}" sources="button" targets="div1" events="onclick" indicator="indicator" />
* <s:submit theme="simple" type="submit" value="submit" id="button"/>
* </pre>
* <!-- END SNIPPET: example1 -->
+ *
* <!-- START SNIPPET: example2 -->
+ * <p>Submit form</p>
* <pre>
* <sx:bind id="ex3" href="%{#ajaxTest}" sources="chk1" targets="div1" events="onchange" formId="form1" />
* <form id="form1">