HDIV API 2.0.4

org.hdiv.components
Class AnchorHDIV

java.lang.Object
  extended by org.apache.struts2.components.Component
      extended by org.apache.struts2.components.UIBean
          extended by org.apache.struts2.components.ClosingUIBean
              extended by org.apache.struts2.components.AbstractRemoteCallUIBean
                  extended by org.apache.struts2.components.Anchor
                      extended by org.hdiv.components.AnchorHDIV
All Implemented Interfaces:
org.apache.struts2.components.RemoteUICallBean

public class AnchorHDIV
extends org.apache.struts2.components.Anchor

A tag that creates a HTML <a href='' /> that when clicked calls a URL remote XMLHttpRequest call via the dojo framework.

THE FOLLOWING IS ONLY VALID WHEN AJAX IS CONFIGURED

'resultDivId' Deprecated. Use targets.

'targets' is a list of element ids whose content will be updated with the text returned from request.

'errorText' is the text that will be displayed when there is an error making the request.

'onLoadJS' Deprecated. Use 'notifyTopics'.

'preInvokeJS' Deprecated. Use 'notifyTopics'.

'executeScripts' if set to true will execute javascript sections in the returned text.

'loadingText' is the text that will be displayed on the 'targets' elements while making the request.

'handler' is the name of the function that will take care of making the AJAX request. Dojo's widget and dom node are passed as parameters).

'formId' is the id of the html form whose fields will be seralized and passed as parameters in the request.

'formFilter' is the name of a function which will be used to filter the fields that will be seralized. This function takes as a parameter the element and returns true if the element should be included.

'listenTopics' comma separated list of topics names, that will trigger a request 'indicator' element to be shown while the request executing 'showErrorTransportText': whether errors should be displayed (on 'targets')

'showLoadingText' show loading text on targets

'notifyTopics' comma separated list of topics names, that will be published. Three parameters are passed:

Examples

 
 <s:a id="link1" theme="ajax" href="/DoIt.action" errorText="An error ocurred" loadingText="Loading...">
     <img border="none" src="<%=request.getContextPath()%>/images/delete.gif"/>
     <s:param name="id" value="1"/>
 </s:a>
 
 

Results in

 
 <a dojoType="BindAnchor" executeScripts="true" id="link1" href="/DoIt.action?id=1" errorText="An error ocurred"></a>
 
 

Here is an example that uses the beforeLoading. This example is in altSyntax=true:

 
 <s:a id="test" theme="ajax" href="/simpeResult.action" beforeLoading="confirm('Are you sure?')">
  A
 </s:a>
 
 

Author:
Gorka Vicente

Field Summary
static java.lang.String COMPONENT_NAME
           
static java.lang.String OPEN_TEMPLATE
           
static java.lang.String TEMPLATE
           
 
Fields inherited from class org.apache.struts2.components.Anchor
targets
 
Fields inherited from class org.apache.struts2.components.AbstractRemoteCallUIBean
afterLoading, beforeLoading, errorText, executeScripts, formFilter, formId, handler, href, indicator, listenTopics, loadingText, notifyTopics, showErrorTransportText, showLoadingText
 
Fields inherited from class org.apache.struts2.components.UIBean
accesskey, cssClass, cssStyle, defaultTemplateDir, defaultUITheme, disabled, key, label, labelPosition, name, onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onselect, request, required, requiredposition, response, tabindex, template, templateDir, templateEngineManager, templateSuffix, theme, title, tooltip, tooltipConfig, value
 
Fields inherited from class org.apache.struts2.components.Component
actionMapper, COMPONENT_STACK, id, parameters, stack
 
Constructor Summary
AnchorHDIV(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Method Summary
 void evaluateExtraParams()
           
 org.hdiv.dataComposer.IDataComposer getDataComposer()
           
 java.lang.String getDefaultOpenTemplate()
           
protected  java.lang.String getDefaultTemplate()
           
 java.lang.String getHDIVParameter()
           
 
Methods inherited from class org.apache.struts2.components.Anchor
setAfterLoading, setBeforeLoading, setTargets
 
Methods inherited from class org.apache.struts2.components.AbstractRemoteCallUIBean
setErrorText, setExecuteScripts, setFormFilter, setFormId, setHandler, setHref, setIndicator, setListenTopics, setLoadingText, setNotifyTopics, setShowErrorTransportText, setShowLoadingText
 
Methods inherited from class org.apache.struts2.components.ClosingUIBean
setOpenTemplate, start
 
Methods inherited from class org.apache.struts2.components.UIBean
addFormParameter, buildTemplateName, enableAncestorFormCustomOnsubmit, end, escape, evaluateNameValue, evaluateParams, getTemplate, getTemplateDir, getTheme, getTooltipConfig, getValueClassType, mergeTemplate, populateComponentHtmlId, setAccesskey, setCssClass, setCssStyle, setDefaultTemplateDir, setDefaultUITheme, setDisabled, setKey, setLabel, 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, setValue
 
Methods inherited from class org.apache.struts2.components.Component
addAllParameters, addParameter, altSyntax, copyParams, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findValue, findValue, findValue, getComponentStack, getId, getParameters, getStack, popComponentStack, setActionMapper, setId, toString, usesBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPEN_TEMPLATE

public static final java.lang.String OPEN_TEMPLATE
See Also:
Constant Field Values

TEMPLATE

public static final java.lang.String TEMPLATE
See Also:
Constant Field Values

COMPONENT_NAME

public static final java.lang.String COMPONENT_NAME
Constructor Detail

AnchorHDIV

public AnchorHDIV(com.opensymphony.xwork2.util.ValueStack stack,
                  javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
Method Detail

evaluateExtraParams

public void evaluateExtraParams()
Overrides:
evaluateExtraParams in class org.apache.struts2.components.Anchor

getDefaultOpenTemplate

public java.lang.String getDefaultOpenTemplate()
Overrides:
getDefaultOpenTemplate in class org.apache.struts2.components.Anchor

getDefaultTemplate

protected java.lang.String getDefaultTemplate()
Overrides:
getDefaultTemplate in class org.apache.struts2.components.Anchor

getHDIVParameter

public java.lang.String getHDIVParameter()
Returns:
Returns the HDIV state parameter.

getDataComposer

public org.hdiv.dataComposer.IDataComposer getDataComposer()
Returns:
Returns data composer from request

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.