...
Attribute | Description | Type |
---|---|---|
href | url used to make the request | String |
listenTopics | A comma separated list of topics names, which will cause the tag to reload its content (Div, Autocompleter), or perform an action (Anchor, Submit) | String |
notifyTopics | A comma separated list of topics names, published by the tag, parameters "data", "type" and "request" will be passed. See each tag for details. | String |
showErrorTransportText | Sets whether or not error messages should be displayed ("true" by default) | Boolean |
indicator | The id of an element that will be displayed while a request is in progress | String |
Preventing a request
The third parameter of "notifyTopics", request, has a "cancel" property that can be used to prevent a request.
Example:
Code Block | ||||
---|---|---|---|---|
| ||||
dojo.event.topic.subscribe("/request", function(data, type, request) {
//cancel request
request.cancel= true;
});
<s:url id="ajaxTest" value="/AjaxTest.action" />
<s:submit type="submit" theme="ajax" value="submit" notifyTopics="/request" href="%{ajaxTest}"/>
|
Indicators
Use indicators to notify the user that a request is in progress. The indicator should be hidden when the page is loaded.
...
If the submit button is used inside a form (href is not required on this case), the form will be submitted asynchronously:
...