Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{excerpt-include

...

:ajax common

...

Description

Wiki Markup
 header|nopanel=true}

h2. Description
{snippet:id=javadoc|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.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


{code|lang=xml}
<img id="loadingImage" src="images/loadingAnimation.gif" style="display:none"/>
<s:div id="parentDiv">
    <s:form action="actionName">
        <sx:a targets="parentDiv" showLoadingText="false" indicator="loadingImage"/>
    </s:form>
</s:div>

Parameters

Wiki Markup

{code}

h2. Parameters
{snippet:id=tagattributes|javadoc=false|url=struts2-tags/ajax/a.html}

Examples

Update target content with html returned from an action:

Wiki Markup


h2. Examples
Update target content with html returned from an action:
{snippet:id=example1|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java}
Submit form(anchor inside the form):

...

Wiki Markup

{snippet:id=example2|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java}
Submit form(anchor outside the form):

...

Wiki Markup

{snippet:id=example3|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java}
Using beforeNotifyTopics:

...

Wiki Markup

{snippet:id=example4|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java}
Using afterNotifyTopics and highlights target:

...

Wiki Markup

{snippet:id=example5|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.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/Anchor.java}