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

All Implemented Interfaces:
    RemoteBean

This tag will generate event listeners for multiple events on multiple sources, making an asynchronous request to the specified href, and updating multiple targets.

Examples

<sx:bind href="%{#ajaxTest}" listenTopics="/makecall"/> <s:submit onclick="dojo.event.topic.publish('/makecall')"/> <img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/> <sx:bind id="ex1" href="%{#ajaxTest}" sources="button" targets="div1" events="onclick" indicator="indicator" /> <s:submit theme="simple" type="submit" value="submit" id="button"/> <sx:bind id="ex3" href="%{#ajaxTest}" sources="chk1" targets="div1" events="onchange" formId="form1" /> <form id="form1"> <s:checkbox name="data" label="Hit me" id="chk1"/> </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> <input type="button" id="button"> <sx:bind id="ex1" href="%{#ajaxTest}" beforeNotifyTopics="/before" sources="button" events="onclick"/> <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> <input type="button" id="button"> <sx:bind id="ex1" href="%{#ajaxTest}" highlightColor="red" afterNotifyTopics="/after" sources="button" events="onclick"/> <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> <input type="button" id="button"> <img id="ind1" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/> <sx:bind href="%{#ajaxTest}" indicator="ind1" errorNotifyTopics="/error" sources="button" events="onclick"/>
Field Summary
public static final  String TEMPLATE     
public static final  String OPEN_TEMPLATE     
protected  String targets     
protected  String sources     
protected  String events     
Fields inherited from org.apache.struts2.dojo.components.AbstractValidateBean:
validate,  ajaxAfterValidation
Fields inherited from org.apache.struts2.dojo.components.AbstractRemoteBean:
href,  errorText,  executeScripts,  loadingText,  listenTopics,  handler,  formId,  formFilter,  notifyTopics,  showErrorTransportText,  indicator,  showLoadingText,  beforeNotifyTopics,  afterNotifyTopics,  errorNotifyTopics,  highlightColor,  highlightDuration,  separateScripts,  transport,  parseContent
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 Bind(ValueStack stack,
    HttpServletRequest request,
    HttpServletResponse response) 
Method from org.apache.struts2.dojo.components.Bind Summary:
evaluateExtraParams,   getDefaultOpenTemplate,   getDefaultTemplate,   getTheme,   setAfterNotifyTopics,   setAjaxAfterValidation,   setBeforeNotifyTopics,   setCssClass,   setCssStyle,   setErrorNotifyTopics,   setErrorText,   setEvents,   setExecuteScripts,   setFormFilter,   setFormId,   setHandler,   setHighlightColor,   setHighlightDuration,   setHref,   setId,   setIndicator,   setListenTopics,   setLoadingText,   setName,   setNotifyTopics,   setSeparateScripts,   setShowErrorTransportText,   setShowLoadingText,   setSources,   setTargets,   setTheme,   setTransport,   setValidate
Methods from org.apache.struts2.dojo.components.AbstractValidateBean:
evaluateExtraParams,   setAjaxAfterValidation,   setValidate
Methods from org.apache.struts2.dojo.components.AbstractRemoteBean:
evaluateExtraParams,   getTheme,   setAfterNotifyTopics,   setBeforeNotifyTopics,   setCssClass,   setCssStyle,   setErrorNotifyTopics,   setErrorText,   setExecuteScripts,   setFormFilter,   setFormId,   setHandler,   setHighlightColor,   setHighlightDuration,   setHref,   setId,   setIndicator,   setListenTopics,   setLoadingText,   setName,   setNotifyTopics,   setParseContent,   setSeparateScripts,   setShowErrorTransportText,   setShowLoadingText,   setTheme,   setTransport
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.Bind Detail:
 public  void evaluateExtraParams() 
 public String getDefaultOpenTemplate() 
 protected String getDefaultTemplate() 
 public String getTheme() 
 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 setEvents(String events) 
 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 setListenTopics(String listenTopics) 
 public  void setLoadingText(String loadingText) 
 public  void setName(String name) 
 public  void setNotifyTopics(String notifyTopics) 
 public  void setSeparateScripts(String separateScripts) 
 public  void setShowErrorTransportText(String showError) 
 public  void setShowLoadingText(String showLoadingText) 
 public  void setSources(String sources) 
 public  void setTargets(String targets) 
 public  void setTheme(String theme) 
 public  void setTransport(String transport) 
 public  void setValidate(String validate)