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

All Implemented Interfaces:
    RemoteBean

Renders a submit button that can submit a form asynchronously. 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

<sx:submit value="%{'Submit'}" /> <sx:submit type="image" value="%{'Submit'}" label="Submit the form" src="submit.gif"/> <sx:submit type="button" value="%{'Submit'}" label="Submit the form"/> <div id="div1">Div 1</div> <s:url id="ajaxTest" value="/AjaxTest.action"/> <sx:submit id="link1" href="%{ajaxTest}" target="div1" /> <s:form id="form" action="AjaxTest"> <input type="textbox" name="data"> <sx:submit /> </s:form> <s:form id="form" action="AjaxTest"> <input type="textbox" name="data"> </s:form> <sx:submit formId="form" /> <script type="text/javascript"> dojo.event.topic.subscribe("/before", function(event, widget){ alert('inside a topic event. before request'); //event: set event.cancel = true, to cancel request //widget: widget that published the topic }); </script> <sx:submit beforeNotifyTopics="/before" /> <script type="text/javascript"> dojo.event.topic.subscribe("/after", function(data, request, widget){ alert('inside a topic event. after request'); //data : text returned from request(the html) //request: XMLHttpRequest object //widget: widget that published the topic }); </script> <sx:submit afterNotifyTopics="/after" highlightColor="red" href="%{#ajaxTest}" /> <script type="text/javascript"> dojo.event.topic.subscribe("/error", function(error, request, widget){ alert('inside a topic event. on error'); //error : error object (error.message has the error message) //request: XMLHttpRequest object //widget: widget that published the topic }); </script> <img id="ind1" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/> <sx:submit errorNotifyTopics="/error" indicator="ind1" href="%{#ajaxTest}" />
Field Summary
public static final  String OPEN_TEMPLATE     
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 targets     
protected  String beforeNotifyTopics     
protected  String afterNotifyTopics     
protected  String errorNotifyTopics     
protected  String highlightColor     
protected  String highlightDuration     
protected  String validate     
protected  String ajaxAfterValidation     
protected  String separateScripts     
protected  String transport     
protected  String parseContent     
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.ClosingUIBean:
openTemplate
Fields inherited from org.apache.struts2.components.UIBean:
request,  response,  templateSuffix,  template,  templateDir,  theme,  key,  id,  cssClass,  cssStyle,  cssErrorClass,  cssErrorStyle,  disabled,  label,  labelPosition,  labelSeparator,  requiredposition,  name,  required,  tabindex,  value,  title,  onclick,  ondblclick,  onmousedown,  onmouseup,  onmouseover,  onmousemove,  onmouseout,  onfocus,  onblur,  onkeypress,  onkeydown,  onkeyup,  onselect,  onchange,  accesskey,  tooltip,  tooltipConfig,  javascriptTooltip,  tooltipDelay,  tooltipCssClass,  tooltipIconPath,  dynamicAttributes,  defaultTemplateDir,  defaultUITheme,  templateEngineManager
Fields inherited from org.apache.struts2.components.Component:
COMPONENT_STACK,  stack,  parameters,  actionMapper,  throwExceptionOnELFailure
Constructor:
 public Submit(ValueStack stack,
    HttpServletRequest request,
    HttpServletResponse response) 
Method from org.apache.struts2.dojo.components.Submit Summary:
end,   evaluateExtraParams,   evaluateParams,   getDefaultOpenTemplate,   getDefaultTemplate,   getTheme,   setAction,   setAfterNotifyTopics,   setAjaxAfterValidation,   setBeforeNotifyTopics,   setCssClass,   setCssStyle,   setErrorNotifyTopics,   setErrorText,   setExecuteScripts,   setFormFilter,   setFormId,   setHandler,   setHighlightColor,   setHighlightDuration,   setHref,   setId,   setIndicator,   setLabel,   setListenTopics,   setLoadingText,   setName,   setNotifyTopics,   setParseContent,   setSeparateScripts,   setShowErrorTransportText,   setShowLoadingText,   setSrc,   setTargets,   setTheme,   setTransport,   setType,   setValidate,   setValue,   supportsImageType
Methods from org.apache.struts2.components.FormButton:
evaluateExtraParams,   populateComponentHtmlId,   setAction,   setActionMapper,   setAlign,   setMethod,   setType,   supportsImageType
Methods from org.apache.struts2.components.ClosingUIBean:
getDefaultOpenTemplate,   setOpenTemplate,   start
Methods from org.apache.struts2.components.UIBean:
addFormParameter,   buildTemplateName,   enableAncestorFormCustomOnsubmit,   end,   ensureAttributeSafelyNotEscaped,   escape,   evaluateExtraParams,   evaluateNameValue,   evaluateParams,   getDefaultTemplate,   getId,   getTemplate,   getTemplateDir,   getTheme,   getTooltipConfig,   getValueClassType,   mergeTemplate,   populateComponentHtmlId,   setAccesskey,   setCssClass,   setCssErrorClass,   setCssErrorStyle,   setCssStyle,   setDefaultTemplateDir,   setDefaultUITheme,   setDisabled,   setDynamicAttributes,   setId,   setJavascriptTooltip,   setKey,   setLabel,   setLabelSeparator,   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,   setTooltipCssClass,   setTooltipDelay,   setTooltipIconPath,   setValue
Methods from org.apache.struts2.components.Component:
addAllParameters,   addParameter,   altSyntax,   altSyntax,   completeExpressionIfAltSyntax,   copyParams,   determineActionURL,   determineNamespace,   end,   end,   fieldError,   findAncestor,   findString,   findString,   findStringIfAltSyntax,   findValue,   findValue,   findValue,   getComponentStack,   getParameters,   getStack,   popComponentStack,   setActionMapper,   setThrowExceptionsOnELFailure,   start,   stripExpressionIfAltSyntax,   stripExpressionIfAltSyntax,   toString,   usesBody
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts2.dojo.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() 
 public String getDefaultOpenTemplate() 
 protected String getDefaultTemplate() 
 public String getTheme() 
 public  void setAction(String action) 
 public  void setAfterNotifyTopics(String afterNotifyTopics) 
 public  void setAjaxAfterValidation(String ajaxAfterValidation) 
 public  void setBeforeNotifyTopics(String beforeNotifyTopics) 
 public  void setCssClass(String cssClass) 
 public  void setCssStyle(String cssStyle) 
 public  void setErrorNotifyTopics(String errorNotifyTopics) 
 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 setHighlightColor(String highlightColor) 
 public  void setHighlightDuration(String highlightDuration) 
 public  void setHref(String href) 
 public  void setId(String id) 
 public  void setIndicator(String indicator) 
 public  void setLabel(String label) 
 public  void setListenTopics(String listenTopics) 
 public  void setLoadingText(String loadingText) 
 public  void setName(String name) 
 public  void setNotifyTopics(String notifyTopics) 
 public  void setParseContent(String parseContent) 
 public  void setSeparateScripts(String separateScripts) 
 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) 
 public  void setTransport(String transport) 
 public  void setType(String type) 
 public  void setValidate(String validate) 
 public  void setValue(String value) 
 protected boolean supportsImageType() 
    Indicate whether the concrete button supports the type "image".