Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
titleRemember

To use these ajax tags you need to set the "theme" attribute to "ajax".

Common

...

Attributes

These properties attributes are common to all the ajax tags:

...

This div will not start the timer by default and will listen to the start/stop topics to start its timer.:

Code Block
XML
XML
<s:div theme="ajax" href="/AjaxTest.action" startTimerListenTopic="/startTimer" stopTimerListenTopic="/stopTimer" updateInterval="3000" autoStart="false"/>

...

This div uses custom error/loading messages.:

Code Block
XML
XML
<s:div href="/AjaxTest.action" theme="ajax" errorText="There was an error" loadingText="reloading" updateInterval="5000"/>

If the loaded text contains javascript code sections, these sections will be evaluated by the div tag if the "executeScripts" attribute is set to true.

If parameters need to be passed to the url, the "formId" attribute can be used to specify a form whose fields will be serialized and passed on the request as parameters. The attribute "formFilter" can bet set to the name of a javascript function that will be used to filter the fields of "formId".

This div will submit the field "firstName", of the form "userData" and ignore other fields:

Code Block
HTML
HTML

<script type="text/javascript">
  function filter(field) {
    return field.name == "firstName";
  }
</script>

<form id="userData">
	<label for="firstName">First Name</label>
	<input type="textbox" id="firstName" name="firstName">
        <label for="lastName">Last Name</label>
	<input type="textbox" id="lastName" name="lastName">
</form>
<s:div href="/AjaxTest.action" theme="ajax" formId="userData" formFilter="filter"/>

If the attribute "handler" is set, the javascript function specified by its value will be called, instead of making the request.

This div will not make any request, and will just call the function "handler". The first parameter of the function is the Dojo widget for the div, and the second the DOM node for the div.

Code Block
HTML
HTML

<script type="text/javascript">
   function handler(widget, node) {
     alert('I will handle this myself!');
	 node.innerHTML = "Done";
   }
</script>

<s:div theme="ajax" href="/AjaxTest.action" handler="handler"/>