public class Anchor extends AbstractValidateBean
A tag that creates an HTML <a/> element, that when clicked makes an asynchronous request(XMLHttpRequest). The url attribute must be build using the <s:url/> tag.
Examples
<div id="div1">Div 1</div> <s:url id="ajaxTest" value="/AjaxTest.action"/> <sx:a id="link1" href="%{ajaxTest}" target="div1"> Update Content </sx:a> <s:form id="form" action="AjaxTest"> <input type="textbox" name="data"> <sx:a>Submit form</sx:a> </s:form> <s:form id="form" action="AjaxTest"> <input type="textbox" name="data"> </s:form> <sx:a formId="form">Submit form</sx:a> <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:a beforeNotifyTopics="/before">Publish topics</sx:a> <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:a afterNotifyTopics="/after" highlightColor="red" href="%{#ajaxTest}">Publish topics</sx:a> <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:a errorNotifyTopics="/error" indicator="ind1" href="%{#ajaxTest}">Publish topics</sx:a>| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_NAME |
static String |
OPEN_TEMPLATE |
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 |
|---|
Anchor(com.opensymphony.xwork2.util.ValueStack stack,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
| Modifier and Type | Method and Description |
|---|---|
void |
evaluateExtraParams() |
String |
getDefaultOpenTemplate() |
protected String |
getDefaultTemplate() |
void |
setTargets(String targets) |
void |
setTheme(String theme) |
setAjaxAfterValidation, setValidategetTheme, setAfterNotifyTopics, setBeforeNotifyTopics, setCssClass, setCssStyle, setErrorNotifyTopics, setErrorText, setExecuteScripts, setFormFilter, setFormId, setHandler, setHighlightColor, setHighlightDuration, setHref, setId, setIndicator, setListenTopics, setLoadingText, setName, setNotifyTopics, setParseContent, setSeparateScripts, setShowErrorTransportText, setShowLoadingText, setTransportsetOpenTemplate, 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 OPEN_TEMPLATE
public static final String TEMPLATE
public static final String COMPONENT_NAME
protected String targets
public Anchor(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 setTheme(String theme)
setTheme in class AbstractRemoteBeanpublic void setTargets(String targets)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.