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, validate
afterNotifyTopics, beforeNotifyTopics, errorNotifyTopics, errorText, executeScripts, formFilter, formId, handler, highlightColor, highlightDuration, href, indicator, listenTopics, loadingText, notifyTopics, parseContent, separateScripts, showErrorTransportText, showLoadingText, transport
accesskey, 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, value
actionMapper, 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) |
setParseContent
setOpenTemplate, start
addFormParameter, 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, setValue
addAllParameters, addParameter, altSyntax, completeExpressionIfAltSyntax, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findStringIfAltSyntax, findValue, findValue, findValue, getComponentStack, getParameters, getStack, popComponentStack, setActionMapper, setThrowExceptionsOnELFailure, setUrlHelper, stripExpressionIfAltSyntax, toString, usesBody
public 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 ClosingUIBean
protected String getDefaultTemplate()
getDefaultTemplate
in class UIBean
public void evaluateExtraParams()
evaluateExtraParams
in class AbstractValidateBean
public void setEvents(String events)
public void setSources(String sources)
public void setTargets(String targets)
public void setTheme(String theme)
setTheme
in class AbstractRemoteBean
public String getTheme()
getTheme
in class AbstractRemoteBean
public void setListenTopics(String listenTopics)
setListenTopics
in interface RemoteBean
setListenTopics
in class AbstractRemoteBean
public void setHref(String href)
setHref
in interface RemoteBean
setHref
in class AbstractRemoteBean
public void setErrorText(String errorText)
setErrorText
in interface RemoteBean
setErrorText
in class AbstractRemoteBean
public void setExecuteScripts(String executeScripts)
setExecuteScripts
in interface RemoteBean
setExecuteScripts
in class AbstractRemoteBean
public void setLoadingText(String loadingText)
setLoadingText
in interface RemoteBean
setLoadingText
in class AbstractRemoteBean
public void setHandler(String handler)
setHandler
in interface RemoteBean
setHandler
in class AbstractRemoteBean
public void setFormFilter(String formFilter)
setFormFilter
in interface RemoteBean
setFormFilter
in class AbstractRemoteBean
public void setFormId(String formId)
setFormId
in interface RemoteBean
setFormId
in class AbstractRemoteBean
public void setNotifyTopics(String notifyTopics)
setNotifyTopics
in interface RemoteBean
setNotifyTopics
in class AbstractRemoteBean
public void setShowErrorTransportText(String showError)
setShowErrorTransportText
in interface RemoteBean
setShowErrorTransportText
in class AbstractRemoteBean
public void setIndicator(String indicator)
setIndicator
in interface RemoteBean
setIndicator
in class AbstractRemoteBean
public void setShowLoadingText(String showLoadingText)
setShowLoadingText
in interface RemoteBean
setShowLoadingText
in class AbstractRemoteBean
public void setCssClass(String cssClass)
setCssClass
in interface RemoteBean
setCssClass
in class AbstractRemoteBean
public void setCssStyle(String cssStyle)
setCssStyle
in interface RemoteBean
setCssStyle
in class AbstractRemoteBean
public void setName(String name)
setName
in interface RemoteBean
setName
in class AbstractRemoteBean
public void setAfterNotifyTopics(String afterNotifyTopics)
setAfterNotifyTopics
in interface RemoteBean
setAfterNotifyTopics
in class AbstractRemoteBean
public void setBeforeNotifyTopics(String beforeNotifyTopics)
setBeforeNotifyTopics
in interface RemoteBean
setBeforeNotifyTopics
in class AbstractRemoteBean
public void setErrorNotifyTopics(String errorNotifyTopics)
setErrorNotifyTopics
in interface RemoteBean
setErrorNotifyTopics
in class AbstractRemoteBean
public void setId(String id)
setId
in class AbstractRemoteBean
public void setHighlightColor(String highlightColor)
setHighlightColor
in interface RemoteBean
setHighlightColor
in class AbstractRemoteBean
public void setHighlightDuration(String highlightDuration)
setHighlightDuration
in interface RemoteBean
setHighlightDuration
in class AbstractRemoteBean
public void setValidate(String validate)
setValidate
in class AbstractValidateBean
public void setAjaxAfterValidation(String ajaxAfterValidation)
setAjaxAfterValidation
in class AbstractValidateBean
public void setSeparateScripts(String separateScripts)
setSeparateScripts
in interface RemoteBean
setSeparateScripts
in class AbstractRemoteBean
public void setTransport(String transport)
setTransport
in interface RemoteBean
setTransport
in class AbstractRemoteBean
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.