Home > Guides > Tag Developers Guide > Struts Tags > Tag Reference > UI Tag Reference > bind
Icon

To use this tag:

  • Add: <%@ taglib prefix="sx" uri="/struts-dojo-tags" %> to your page.
  • The head tag must be included on the page, which can be configured for performance or debugging purposes.
  • If the parseContent parameter for the head tag is false (it is false by default), then the id tag is required.

Additional Examples

Icon

For more examples see Ajax and JavaScript Recipes

Description

This tag will generate event listeners for multiple events on multiple sources, making an asynchronous request to the specified href, and updating multiple targets.

There's a bug in IE6/IE7 which makes impossible to use the target's attribute with a parent Div, because such Div's content's are overwritten with the tag's loadingText. Resulting in an "undefined" message in the content's, instead of the result of the request.

One possible alternative is to set showLoadingText="false" and set the indicator attribute to an element showing the desired loading text or image (outside the div).

Parameters

Dynamic Attributes Allowed:

false
 

Name

Required

Default

Evaluated

Type

Description

afterNotifyTopicsfalsefalseStringComma delimmited list of topics that will published after the request(if the request succeeds)
ajaxAfterValidationfalsefalsefalseBooleanMake an asynchronous request if validation succeeds. Only valid is 'validate' is 'true'
beforeNotifyTopicsfalsefalseStringComma delimmited list of topics that will published before the request
errorNotifyTopicsfalsefalseStringComma delimmited list of topics that will published after the request(if the request fails)
errorTextfalsefalseStringThe text to display to the user if the is an error fetching the content
eventsfalsefalseStringComma delimited list of event names to attach to
executeScriptsfalsefalsefalseBooleanJavascript code in the fetched content will be executed
formFilterfalsefalseStringFunction name used to filter the fields of the form.
formIdfalsefalseStringForm id whose fields will be serialized and passed as parameters
handlerfalsefalseStringJavascript function name that will make the request
highlightColorfalsenonefalseStringColor used to perform a highlight effect on the elements specified in the 'targets' attribute
highlightDurationfalse2000falseIntegerDuration of highlight effect in milliseconds. Only valid if 'highlightColor' attribute is set
hreffalsefalseStringThe URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value.
idfalsefalseStringThe id to use for the element
indicatorfalsefalseStringId of element that will be shown while making request
listenTopicsfalsefalseStringTopic that will trigger the remote call
loadingTextfalseLoading...falseStringText to be shown while content is being fetched
notifyTopicsfalsefalseStringComma delimmited list of topics that will published before and after the request, and on errors
separateScriptsfalsetruefalseStringRun scripts in a separate scope, unique for each tag
showErrorTransportTextfalsetruefalseBooleanSet whether errors will be shown or not
showLoadingTextfalsefalsefalseBooleanShow loading text on targets
sourcesfalsefalseStringComma delimited list of ids of the elements to attach to
targetsfalsefalseStringComma delimited list of ids of the elements whose content will be updated
transportfalseXMLHTTPTransportfalseStringTransport used by Dojo to make the request
validatefalsefalsefalseBooleanPerform Ajax validation. 'ajaxValidation' interceptor must be applied to action

Examples

Without attaching to an event, listening to a topic (used to make an Ajax call):

Attached to event 'onclick' on submit button:

Submit form:

Using beforeNotifyTopics:

Using afterNotifyTopics and highlight:

Using errorNotifyTopics and indicator: