Author: musachy Date: Thu Apr 12 15:55:35 2007 New Revision: 528275 URL: http://svn.apache.org/viewvc?view=rev&rev=528275 Log: Split examples
Modified: struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java Modified: struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java?view=diff&rev=528275&r1=528274&r2=528275 ============================================================================== --- struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java (original) +++ struts/struts2/trunk/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java Thu Apr 12 15:55:35 2007 @@ -36,33 +36,44 @@ * attribute must be build using the <s:url/> tag. * </p> * <!-- END SNIPPET: javadoc --> - * <pre> - * <!-- START SNIPPET: examples --> - * <b>Update target content with html returned from an action:</b> + * <p>Examples</p> * + * <p>Update target content with html returned from an action:</p> + * <!-- START SNIPPET: example1 --> + * <pre> * <div id="div1">Div 1</div> * <s:url id="ajaxTest" value="/AjaxTest.action"/> * * <sx:a id="link1" href="%{ajaxTest}" target="div1"> * Update Content * </sx:a> + * </pre> + * <!-- END SNIPPET: example1 --> * - * <b>Submit form(anchor inside the form):</b> - * + * <p>Submit form(anchor inside the form):</p> + * <!-- START SNIPPET: example2 --> + * <pre> * <s:form id="form" action="AjaxTest"> * <input type="textbox" name="data"> * <sx:a>Submit form</sx:a> * </s:form> + * </pre> + * <!-- END SNIPPET: example2 --> * - * <b>Submit form(anchor outside the form)</b> - * + * <p>Submit form(anchor outside the form)</p> + * <!-- START SNIPPET: example3 --> + * <pre> * <s:form id="form" action="AjaxTest"> * <input type="textbox" name="data"> * </s:form> * * <sx:a formId="form">Submit form</sx:a> + * </pre> + * <!-- END SNIPPET: example3 --> * - * <b>Using topics:</b> + * <p>Using topics:</p> + * <!-- START SNIPPET: example4 --> + * <pre> * <script type="text/javascript"> * dojo.event.topic.subscribe("/before", function(data, type, e){ * alert('inside a topic event. before request'); @@ -73,8 +84,9 @@ * }); * </script> * - * <sx:a beforeNotifyTopics="/before">Publish topics</sx:a> - * <!-- END SNIPPET: examples --> + * <sx:a beforeNotifyTopics="/before">Publish topics</sx:a> + * </pre> + * <!-- END SNIPPET: example4 --> * </pre> */ @StrutsTag(name="a", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.AnchorTag", description="Renders an HTML anchor element that when clicked calls a URL via remote XMLHttpRequest and updates " +