Home > Guides > Tag Developers Guide > Struts Tags > Tag Reference > dojo submit

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

For more examples see Ajax and JavaScript Recipes

Description

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

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).

<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

Dynamic Attributes Allowed:

false
 

Name

Required

Default

Evaluated

Type

Description

accesskeyfalsefalseStringSet the html accesskey attribute on rendered html element
afterNotifyTopicsfalsefalseStringComma delimmited list of topics that will published after the request(if the request succeeds)
ajaxAfterValidationfalsefalsefalseBooleanMake an asynchronous request if validation succeeds. Only valid if 'validate' is 'true'
alignfalsefalseStringHTML align attribute.
beforeNotifyTopicsfalsefalseStringComma delimmited list of topics that will published before the request
cssClassfalsefalseStringThe css class to use for element
cssErrorClassfalsefalseStringThe css error class to use for element
cssErrorStylefalsefalseStringThe css error style definitions for element to use
cssStylefalsefalseStringThe css style to use for element
disabledfalsefalseStringSet the html disabled attribute on rendered html element
errorNotifyTopicsfalsefalseStringComma delimmited list of topics that will published after the request(if the request fails)
errorPositionfalsefalseStringDefine error position of form element (top|bottom)
errorTextfalsefalseStringThe text to display to the user if the is an error fetching the content
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
highlightDurationfalse1000falseStringDuration 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
indicatorfalsefalseStringSet indicator
javascriptTooltipfalsefalsefalseBooleanUse JavaScript to generate tooltips
keyfalsefalseStringSet the key (name, value, label) for this particular component
labelfalsefalseStringLabel expression used for rendering a element specific label
labelSeparatorfalse:falseStringString that will be appended to the label
labelpositionfalsefalseStringDefine label position of form element (top/left)
listenTopicsfalsefalseStringTopic that will trigger the remote call
loadingTextfalseLoading...falseStringText to be shown while content is being fetched
methodfalsefalseStringSet method attribute.
namefalsefalseStringThe name to set for element
notifyTopicsfalsefalseStringComma delimmited list of topics that will published before and after the request, and on errors
onblurfalsefalseString Set the html onblur attribute on rendered html element
onchangefalsefalseStringSet the html onchange attribute on rendered html element
onclickfalsefalseStringSet the html onclick attribute on rendered html element
ondblclickfalsefalseStringSet the html ondblclick attribute on rendered html element
onfocusfalsefalseStringSet the html onfocus attribute on rendered html element
onkeydownfalsefalseStringSet the html onkeydown attribute on rendered html element
onkeypressfalsefalseStringSet the html onkeypress attribute on rendered html element
onkeyupfalsefalseStringSet the html onkeyup attribute on rendered html element
onmousedownfalsefalseStringSet the html onmousedown attribute on rendered html element
onmousemovefalsefalseStringSet the html onmousemove attribute on rendered html element
onmouseoutfalsefalseStringSet the html onmouseout attribute on rendered html element
onmouseoverfalsefalseStringSet the html onmouseover attribute on rendered html element
onmouseupfalsefalseStringSet the html onmouseup attribute on rendered html element
onselectfalsefalseStringSet the html onselect attribute on rendered html element
openTemplatefalsefalseStringSet template to use for opening the rendered html.
parseContentfalsetruefalseBooleanParse returned HTML for Dojo widgets
requiredLabelfalsefalsefalseBooleanIf set to true, the rendered element will indicate that input is required
requiredPositionfalsefalseStringDefine required position of required form element (left|right)
separateScriptsfalsetruefalseStringRun scripts in a separate scope, unique for each tag
showErrorTransportTextfalsetruefalseBooleanSet whether errors will be shown or not
showLoadingTextfalsefalsefalseBooleanShow loading text on targets
srcfalsefalseStringSupply an image src for image type submit button. Will have no effect for types input and button.
stylefalsefalseStringThe css style definitions for element to use - it's an alias of cssStyle attribute.
tabindexfalsefalseStringSet the html tabindex attribute on rendered html element
targetsfalsefalseStringComma delimited list of ids of the elements whose content will be updated
templatefalsefalseStringThe template (other than default) to use for rendering the element
templateDirfalsefalseStringThe template directory.
titlefalsefalseStringSet the html title attribute on rendered html element
tooltipfalsefalseStringSet the tooltip of this particular component
tooltipConfigfalsefalseStringDeprecated. Use individual tooltip configuration attributes instead.
tooltipCssClassfalseStrutsTTClassicfalseStringCSS class applied to JavaScrip tooltips
tooltipDelayfalseClassicfalseStringDelay in milliseconds, before showing JavaScript tooltips
tooltipIconPathfalsefalseStringIcon path used for image that will have the tooltip
transportfalseXMLHTTPTransportfalseStringTransport used by Dojo to make the request
typefalseinputfalseStringThe type of submit to use. Valid values are input, button and image.
validatefalsefalsefalseBooleanPerform Ajax validation. 'ajaxValidation' interceptor must be applied to action
valuefalsefalseStringPreset the value of input element.

Examples

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Render an image submit:

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Render a button submit:

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Update target content with html returned from an action:

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Submit form(inside the form):

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Submit form(outside the form):

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Using beforeNotifyTopics:

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Using afterNotifyTopics and highlight target:

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Using errorNotifyTopics and indicator:

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20