public class Bind extends AbstractValidateBean
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"/>| Modifier and Type | Field and Description |
|---|---|
protected String |
events |
static String |
OPEN_TEMPLATE |
protected String |
sources |
protected String |
targets |
static String |
TEMPLATE |
ajaxAfterValidation, validateafterNotifyTopics, beforeNotifyTopics, errorNotifyTopics, errorText, executeScripts, formFilter, formId, handler, highlightColor, highlightDuration, href, indicator, listenTopics, loadingText, notifyTopics, parseContent, separateScripts, showErrorTransportText, showLoadingText, transportaccesskey, cssClass, cssErrorClass, cssErrorStyle, cssStyle, defaultTemplateDir, defaultUITheme, disabled, dynamicAttributes, errorPosition, id, javascriptTooltip, key, label, labelPosition, labelSeparator, name, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselect, request, requiredLabel, requiredPosition, response, standardAttributesMap, tabindex, template, templateDir, templateEngineManager, templateSuffix, theme, title, tooltip, tooltipConfig, tooltipCssClass, tooltipDelay, tooltipIconPath, uiThemeExpansionToken, valueactionMapper, COMPONENT_STACK, parameters, stack, throwExceptionOnELFailure| Constructor and Description |
|---|
Bind(com.opensymphony.xwork2.util.ValueStack stack,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
setParseContentsetOpenTemplate, startaddFormParameter, buildTemplateName, copyParams, enableAncestorFormCustomOnsubmit, end, ensureAttributeSafelyNotEscaped, escape, evaluateNameValue, evaluateParams, getId, getStandardAttributes, getTemplate, getTemplateDir, getTooltipConfig, getValueClassType, mergeTemplate, populateComponentHtmlId, setAccesskey, setCssErrorClass, setCssErrorStyle, setDefaultTemplateDir, setDefaultUITheme, setDisabled, setDynamicAttributes, setErrorPosition, setJavascriptTooltip, setKey, setLabel, setLabelposition, setLabelSeparator, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setRequiredLabel, setRequiredPosition, setTabindex, setTemplate, setTemplateDir, setTemplateEngineManager, setTitle, setTooltip, setTooltipConfig, setTooltipCssClass, setTooltipDelay, setTooltipIconPath, setUIThemeExpansionToken, setValueaddAllParameters, addParameter, altSyntax, completeExpressionIfAltSyntax, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findStringIfAltSyntax, findValue, findValue, findValue, getComponentStack, getParameters, getStack, popComponentStack, setActionMapper, setThrowExceptionsOnELFailure, setUrlHelper, stripExpressionIfAltSyntax, toString, usesBodypublic static final String TEMPLATE
public static final String OPEN_TEMPLATE
protected String targets
protected String sources
protected String events
public Bind(com.opensymphony.xwork2.util.ValueStack stack,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
public String getDefaultOpenTemplate()
getDefaultOpenTemplate in class ClosingUIBeanprotected String getDefaultTemplate()
getDefaultTemplate in class UIBeanpublic void evaluateExtraParams()
evaluateExtraParams in class AbstractValidateBeanpublic void setEvents(String events)
public void setSources(String sources)
public void setTargets(String targets)
public void setTheme(String theme)
setTheme in class AbstractRemoteBeanpublic String getTheme()
getTheme in class AbstractRemoteBeanpublic void setListenTopics(String listenTopics)
setListenTopics in interface RemoteBeansetListenTopics in class AbstractRemoteBeanpublic void setHref(String href)
setHref in interface RemoteBeansetHref in class AbstractRemoteBeanpublic void setErrorText(String errorText)
setErrorText in interface RemoteBeansetErrorText in class AbstractRemoteBeanpublic void setExecuteScripts(String executeScripts)
setExecuteScripts in interface RemoteBeansetExecuteScripts in class AbstractRemoteBeanpublic void setLoadingText(String loadingText)
setLoadingText in interface RemoteBeansetLoadingText in class AbstractRemoteBeanpublic void setHandler(String handler)
setHandler in interface RemoteBeansetHandler in class AbstractRemoteBeanpublic void setFormFilter(String formFilter)
setFormFilter in interface RemoteBeansetFormFilter in class AbstractRemoteBeanpublic void setFormId(String formId)
setFormId in interface RemoteBeansetFormId in class AbstractRemoteBeanpublic void setNotifyTopics(String notifyTopics)
setNotifyTopics in interface RemoteBeansetNotifyTopics in class AbstractRemoteBeanpublic void setShowErrorTransportText(String showError)
setShowErrorTransportText in interface RemoteBeansetShowErrorTransportText in class AbstractRemoteBeanpublic void setIndicator(String indicator)
setIndicator in interface RemoteBeansetIndicator in class AbstractRemoteBeanpublic void setShowLoadingText(String showLoadingText)
setShowLoadingText in interface RemoteBeansetShowLoadingText in class AbstractRemoteBeanpublic void setCssClass(String cssClass)
setCssClass in interface RemoteBeansetCssClass in class AbstractRemoteBeanpublic void setCssStyle(String cssStyle)
setCssStyle in interface RemoteBeansetCssStyle in class AbstractRemoteBeanpublic void setName(String name)
setName in interface RemoteBeansetName in class AbstractRemoteBeanpublic void setAfterNotifyTopics(String afterNotifyTopics)
setAfterNotifyTopics in interface RemoteBeansetAfterNotifyTopics in class AbstractRemoteBeanpublic void setBeforeNotifyTopics(String beforeNotifyTopics)
setBeforeNotifyTopics in interface RemoteBeansetBeforeNotifyTopics in class AbstractRemoteBeanpublic void setErrorNotifyTopics(String errorNotifyTopics)
setErrorNotifyTopics in interface RemoteBeansetErrorNotifyTopics in class AbstractRemoteBeanpublic void setId(String id)
setId in class AbstractRemoteBeanpublic void setHighlightColor(String highlightColor)
setHighlightColor in interface RemoteBeansetHighlightColor in class AbstractRemoteBeanpublic void setHighlightDuration(String highlightDuration)
setHighlightDuration in interface RemoteBeansetHighlightDuration in class AbstractRemoteBeanpublic void setValidate(String validate)
setValidate in class AbstractValidateBeanpublic void setAjaxAfterValidation(String ajaxAfterValidation)
setAjaxAfterValidation in class AbstractValidateBeanpublic void setSeparateScripts(String separateScripts)
setSeparateScripts in interface RemoteBeansetSeparateScripts in class AbstractRemoteBeanpublic void setTransport(String transport)
setTransport in interface RemoteBeansetTransport in class AbstractRemoteBeanCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.