Excerpt Include |
---|
| ajax common header |
---|
nopanel | true |
---|
| ajax common header |
---|
|
Description
Wiki Markup |
---|
{snippet:id=javadoc|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java} |
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).
Code Block |
---|
|
<img id="loadingImage" src="images/loadingAnimation.gif" style="display:none"/>
<s:div id="parentDiv">
<s:form action="actionName">
<s:submit id="btn" />
<sx:bind sources="btn" events="onclick" targets="parentDiv" showLoadingText="false" indicator="loadingImage"/>
</s:form>
</s:div>
|
Parameters
Wiki Markup |
---|
{snippet:id=tagattributes|javadoc=false|url=struts2-tags/ajax/bind.html} |
Examples
Without attaching to an event, listening to a topic (used to make an Ajax call):
Wiki Markup |
---|
{snippet:id=example0|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java} |
Attached to event 'onclick' on submit button:
Wiki Markup |
---|
{snippet:id=example1|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java} |
Submit form:
Wiki Markup |
---|
{snippet:id=example2|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java} |
Using beforeNotifyTopics:
Wiki Markup |
---|
{snippet:id=example4|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java} |
Using afterNotifyTopics and highlight:
Wiki Markup |
---|
{snippet:id=example5|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java} |
Using errorNotifyTopics and indicator:
Wiki Markup |
---|
{snippet:id=example6|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java} |