Save This Page
Home » struts-2.0.11.2-src » org.apache » struts2 » components » [javadoc | source]
org.apache.struts2.components
public class: Submit [javadoc | source]
java.lang.Object
   org.apache.struts2.components.Component
      org.apache.struts2.components.UIBean
         org.apache.struts2.components.FormButton
            org.apache.struts2.components.Submit

All Implemented Interfaces:
    RemoteUICallBean

Render a submit button. The submit tag is used together with the form tag to provide asynchronous form submissions. The submit can have three different types of rendering: Please note that the button type has advantages by adding the possibility to seperate the submitted value from the text shown on the button face, but has issues with Microsoft Internet Explorer at least up to 6.0

Examples


<s:submit value="%{'Submit the form'}" />


Render an image submit:
<s:submit type="image" value="%{'Submit the form'}" src="submit.gif"/>


Render an button submit:
<s:submit type="button" value="%{'Submit the form'}"/>

THE FOLLOWING IS ONLY VALID WHEN AJAX IS CONFIGURED 'resultDivId' Deprecated. Use targets.

'targets' is a list of element ids whose content will be updated with the text returned from request.

'errorText' is the text that will be displayed when there is an error making the request.

'onLoadJS' Deprecated. Use 'notifyTopics'.

'preInvokeJS' Deprecated. Use 'notifyTopics'.

'executeScripts' if set to true will execute javascript sections in the returned text.

'loadingText' is the text that will be displayed on the 'targets' elements while making the request.

'handler' is the name of the function that will take care of making the AJAX request. Dojo's widget and dom node are passed as parameters).

'formId' is the id of the html form whose fields will be seralized and passed as parameters in the request.

'formFilter' is the name of a function which will be used to filter the fields that will be seralized. This function takes as a parameter the element and returns true if the element should be included.

'listenTopics' comma separated list of topics names, that will trigger a request 'indicator' element to be shown while the request executing 'showErrorTransportText': whether errors should be displayed (on 'targets')

'showLoadingText' show loading text on targets

'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:

Show the results in another div. If you want your results to be shown in a div, use the resultDivId where the id is the id of the div you want them shown in. This is an inner HTML approah. Your results get jammed into the div for you. Here is a sample of this approach:

Remote form replacing another div:
<div id='two' style="border: 1px solid yellow;">Initial content</div>
<s:form
id='theForm2'
cssStyle="border: 1px solid green;"
action='/AjaxRemoteForm.action'
method='post'
theme="ajax">

<input type='text' name='data' value='Struts User' />
<s:submit value="GO2" theme="ajax" resultDivId="two" />

</s:form >

Field Summary
public static final  String TEMPLATE     
protected  String href     
protected  String errorText     
protected  String executeScripts     
protected  String loadingText     
protected  String listenTopics     
protected  String handler     
protected  String formId     
protected  String formFilter     
protected  String src     
protected  String notifyTopics     
protected  String showErrorTransportText     
protected  String indicator     
protected  String showLoadingText     
protected  String beforeLoading     
protected  String afterLoading     
protected  String targets     
Fields inherited from org.apache.struts2.components.FormButton:
BUTTONTYPE_INPUT,  BUTTONTYPE_BUTTON,  BUTTONTYPE_IMAGE,  action,  method,  align,  type
Fields inherited from org.apache.struts2.components.UIBean:
request,  response,  templateSuffix,  template,  templateDir,  theme,  key,  cssClass,  cssStyle,  disabled,  label,  labelPosition,  requiredposition,  name,  required,  tabindex,  value,  title,  onclick,  ondblclick,  onmousedown,  onmouseup,  onmouseover,  onmousemove,  onmouseout,  onfocus,  onblur,  onkeypress,  onkeydown,  onkeyup,  onselect,  onchange,  accesskey,  tooltip,  tooltipConfig,  defaultTemplateDir,  defaultUITheme,  templateEngineManager
Fields inherited from org.apache.struts2.components.Component:
COMPONENT_STACK,  stack,  parameters,  id,  actionMapper
Constructor:
 public Submit(ValueStack stack,
    HttpServletRequest request,
    HttpServletResponse response) 
Method from org.apache.struts2.components.Submit Summary:
end,   evaluateExtraParams,   evaluateParams,   getDefaultTemplate,   setAfterLoading,   setBeforeLoading,   setErrorText,   setExecuteScripts,   setFormFilter,   setFormId,   setHandler,   setHref,   setIndicator,   setListenTopics,   setLoadingText,   setNotifyTopics,   setShowErrorTransportText,   setShowLoadingText,   setSrc,   setTargets,   setTheme,   supportsImageType
Methods from org.apache.struts2.components.FormButton:
evaluateExtraParams,   populateComponentHtmlId,   setAction,   setAlign,   setMethod,   setType,   supportsImageType
Methods from org.apache.struts2.components.UIBean:
addFormParameter,   buildTemplateName,   enableAncestorFormCustomOnsubmit,   end,   ensureAttributeSafelyNotEscaped,   escape,   evaluateExtraParams,   evaluateNameValue,   evaluateParams,   getDefaultTemplate,   getTemplate,   getTemplateDir,   getTheme,   getTooltipConfig,   getValueClassType,   mergeTemplate,   populateComponentHtmlId,   setAccesskey,   setCssClass,   setCssStyle,   setDefaultTemplateDir,   setDefaultUITheme,   setDisabled,   setKey,   setLabel,   setLabelposition,   setName,   setOnblur,   setOnchange,   setOnclick,   setOndblclick,   setOnfocus,   setOnkeydown,   setOnkeypress,   setOnkeyup,   setOnmousedown,   setOnmousemove,   setOnmouseout,   setOnmouseover,   setOnmouseup,   setOnselect,   setRequired,   setRequiredposition,   setTabindex,   setTemplate,   setTemplateDir,   setTemplateEngineManager,   setTheme,   setTitle,   setTooltip,   setTooltipConfig,   setValue
Methods from org.apache.struts2.components.Component:
addAllParameters,   addParameter,   altSyntax,   copyParams,   determineActionURL,   determineActionURL,   determineNamespace,   end,   end,   fieldError,   findAncestor,   findString,   findString,   findValue,   findValue,   findValue,   getComponentStack,   getId,   getParameters,   getStack,   popComponentStack,   setActionMapper,   setId,   start,   toString,   usesBody
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts2.components.Submit Detail:
 public boolean end(Writer writer,
    String body) 
    Overrides to be able to render body in a template rather than always before the template
 public  void evaluateExtraParams() 
 public  void evaluateParams() 
 protected String getDefaultTemplate() 
 public  void setAfterLoading(String afterLoading) 
 public  void setBeforeLoading(String beforeLoading) 
 public  void setErrorText(String errorText) 
 public  void setExecuteScripts(String executeScripts) 
 public  void setFormFilter(String formFilter) 
 public  void setFormId(String formId) 
 public  void setHandler(String handler) 
 public  void setHref(String href) 
 public  void setIndicator(String indicator) 
 public  void setListenTopics(String listenTopics) 
 public  void setLoadingText(String loadingText) 
 public  void setNotifyTopics(String notifyTopics) 
 public  void setShowErrorTransportText(String showErrorTransportText) 
 public  void setShowLoadingText(String showLoadingText) 
 public  void setSrc(String src) 
 public  void setTargets(String targets) 
 public  void setTheme(String theme) 
 protected boolean supportsImageType() 
    Indicate whether the concrete button supports the type "image".