Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Excerpt Include
ajax common header
nopaneltrue
ajax common header

Description

Wiki Markup
{snippet:id=javadoc|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.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"(the default) and set the indicator attribute to an element showing the desired loading text or image (outside the div).

Code Block
xml
xml
<img id="loadingImage" src="images/loadingAnimation.gif" style="display:none"/>
<s:div id="parentDiv">
    <s:form action="actionName">
        <sx:submit  targets="parentDiv" showLoadingText="false" indicator="loadingImage"/>
    </s:form>
</s:div>

Parameters

Wiki Markup
{snippet:id=tagattributes|javadoc=false|url=struts2-tags/ajax/submit.html}

Examples

Wiki Markup
{snippet:id=example1|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java}

Render an image submit:

Wiki Markup
{snippet:id=example2|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java}

Render a button submit:

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

Update target content with html returned from an action:

Wiki Markup
{snippet:id=example4|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java}

Submit form(inside the form):

Wiki Markup
{snippet:id=example5|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java}

Submit form(outside the form):

Wiki Markup
{snippet:id=example6|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java}

Using beforeNotifyTopics:

Wiki Markup
{snippet:id=example7|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java}

Using afterNotifyTopics and highlight target:

Wiki Markup
{snippet:id=example8|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java}

Using errorNotifyTopics and indicator:

Wiki Markup
{snippet:id=example9|lang=xml|javadoc=true|url=struts2/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java}