...
Tip |
---|
To use the Ajax tags you need to set the "theme" attribute to "ajax". Use the head tag to configure the page for the ajax theme. Set the "debug" attribute of the head tag to "true" to display debug information on the bottom of the page. |
Basic Ajax Tags |
|
---|---|
Creates a content area that can load its content via Ajax, optionally refreshing. | |
Updates element(s) or submits a form via Ajax. | |
Updates element(s) via Ajax. | |
Creates a tabbed panel containing static or dynamic <s:div.../> tab contents. | |
Autocompleter tag providing suggestions or updating elements based on current value. |
...
Anchor | ||||
---|---|---|---|---|
|
Common Attributes
These attributes are common to all the ajax tags:
...
Ajax tags can be used inside content returned from an asynchronous request, just like in regular pages.
Anchor | ||||
---|---|---|---|---|
|
Div
The div tag is a content area that can load its content asynchronously. The div tag can be forced to reload its content using topics. To define the topics that will trigger the refresh of the panel, use the "listenTopics" attribute. This tag will load its content when the page is loaded, unless "autoStart" is set to "false".
...
Attribute | Description | Type |
---|---|---|
handler | Javascript function name that will make the request | String |
formId | Form id whose fields will be serialized and passed as parameters | String |
formFilter | Function name used to filter the fields of the form | String |
loadingText | The text to display in the div while content is loaded | String |
errorText | The text to display in the div when there is an error | String |
refreshListenTopic | Topic name that will cause the div content to be reloaded | String |
startTimerListenTopics | Topic names that will start the timer (comma separated) | String |
stopTimerListenTopics | Topic names that will stop the timer | String (comma separated) |
executeScripts | Any Javascript code in the loaded content will be executed | Boolean |
updateFreq | Time between requests (in milliseconds) | Integer |
delay | Time to wait before making the first request (in milliseconds) | Integer |
autoStart | Start timer automatically when page loads | Boolean |
afterLoading | Deprecated. Use "notifyTopics" instead | String |
Anchor | ||||
---|---|---|---|---|
|
Submit
The submit tag can be used to update the content of its "targets" attribute with text returned from the asynchronous request. "targets" is a comma-delimited list of element ids. The "targets" attribute is optional.
...
Attribute | Description | Type |
---|---|---|
targets | Comma delimited list of ids of the elements whose content will be updated | String |
handler | Javascript function name that will make the request | String |
formId | Form id whose fields will be serialized and passed as parameters | String |
formFilter | Function name used to filter the fields of the form | String |
loadingText | The text to display in the "targets" while content is loaded | String |
errorText | The text to display in the "targets" when there is an error | String |
refreshListenTopic | Topic name that will cause the "targets" content to be reloaded | String |
executeScripts | Any Javascript code in the loaded content will be executed | Boolean |
src | Supply an image src for "image" type submit button. Will have no effect for types "input" and "button" | String |
resultDivId | Deprecated. Use "targets" instead | String |
preInvokeJS | Deprecated. Use "notifyTopics" instead | String |
onLoadJS | Deprecated. Use "notifyTopics" instead | String |
Anchor | ||||
---|---|---|---|---|
|
Anchor
The anchor tag, like the submit tag, can be used to update the content of its "targets" attribute with text returned from the asynchronous request. "targets" is a comma-delimited list of element ids. The "targets" attribute is optional.
...
Attribute | Description | Type |
---|---|---|
targets | Comma delimited list of ids of the elements whose content will be updated | String |
handler | Javascript function name that will make the request | String |
formId | Form id whose fields will be serialized and passed as parameters | String |
formFilter | Function name used to filter the fields of the form | String |
loadingText | The text to display in the "targets" while content is loaded | String |
errorText | The text to display in the "targets" when there is an error | String |
refreshListenTopic | Topic name that will cause the "targets" content to be reloaded | String |
executeScripts | Any Javascript code in the loaded content will be executed | Boolean |
preInvokeJS | Deprecated. Use "notifyTopics" instead | String |
afterLoading | Deprecated. Use "notifyTopics" instead | String |
Anchor | ||||
---|---|---|---|---|
|
Tabbed Panel
The tabbedPanel tag can host static and dynamic (asynchronously loaded) tabs. Every div tag inside the tabbedPanel will be rendered as a tab. The "label" attribute is required for each tab, and will be used as its caption. For more details on the dynamic tabs, see the "div" tag section. The tabbedPanel tag is in the "simple" theme bacause it does not contains any ajax functionality itself.
...
Attribute | Description | Type |
---|---|---|
closeButton | Where the close button will be placed, possible values are "tab" and "pane" | String |
selectedTab | The id of the tab that will be selected by default | String |
doLayout | If doLayout is false (default), the tabbedPanel's height is the height of the currently selected tab | Boolean |
labelposition | Where to place the tabs, possible vales are "top" (default), "right", "bottom" and "left" | String |
Anchor | ||||
---|---|---|---|---|
|
Autocompleter
The autocompleter tag loads its options asynchronously when the page loads, and suggests options based on the text entered in the textbox. If the attribute "autoComplete" is set to "true" (defaults to false), the autocompleter will make suggestions in the textbox, as the user types. The autocompleter will always display a dropdown with the options that have at least a partial match with the text entered in the textbox. If the user clicks on the dropdown button, all the options will be shown in the dropdown. To force the value to be a valid option set the attribute "forceValidOption" to "true" ("false" by default).
...