org.apache.struts2.dojo.components
Class Div
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.Div
- All Implemented Interfaces:
- RemoteBean
public class Div
- extends AbstractRemoteBean
This tag generates an HTML div that loads its content using an XMLHttpRequest call, via
the dojo framework. When the "updateFreq" is set the built in timer will start automatically and
reload the div content with the value of "updateFreq" as the refresh period(in milliseconds).
Topics can be used to stop(stopTimerListenTopics) and start(startTimerListenTopics) this timer.
When used inside a "tabbedpanel" tag, each div becomes a tab. Some attributes are specific
to this use case, like:
- refreshOnShow: div content is realoded when tab is selected
- closable: Tab will have close button
- preload: load div content after page is loaded
Examples
<sx:div href="%{#url}">Initial Content</sx:div>
<img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/>
<sx:div href="%{#url}" updateFreq="2000" indicator="indicator">
Initial Content
</sx:div>
<form id="form">
<label for="textInput">Text to be submited when div reloads</label>
<input type=textbox id="textInput" name="data">
</form>
<sx:div
href="%{#url}"
updateFreq="3000"
listenTopics="/refresh"
startTimerListenTopics="/startTimer"
stopTimerListenTopics="/stopTimer"
highlightColor="red"
formId="form">
Initial Content
</sx:div>
Fields inherited from class org.apache.struts2.dojo.components.AbstractRemoteBean |
afterNotifyTopics, beforeNotifyTopics, errorNotifyTopics, errorText, executeScripts, formFilter, formId, handler, highlightColor, highlightDuration, href, indicator, listenTopics, loadingText, notifyTopics, parseContent, separateScripts, showErrorTransportText, showLoadingText, transport |
Fields inherited from class org.apache.struts2.components.UIBean |
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 |
Constructor Summary |
Div(com.opensymphony.xwork2.util.ValueStack stack,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
Methods inherited from class org.apache.struts2.dojo.components.AbstractRemoteBean |
getTheme, setAfterNotifyTopics, setBeforeNotifyTopics, setCssClass, setCssStyle, setErrorNotifyTopics, setErrorText, setExecuteScripts, setFormFilter, setFormId, setHandler, setHighlightDuration, setHref, setId, setIndicator, setListenTopics, setLoadingText, setName, setNotifyTopics, setParseContent, setSeparateScripts, setShowErrorTransportText, setShowLoadingText, setTheme, setTransport |
Methods inherited from class org.apache.struts2.components.UIBean |
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 |
Methods inherited from class org.apache.struts2.components.Component |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TEMPLATE
public static final String TEMPLATE
- See Also:
- Constant Field Values
TEMPLATE_CLOSE
public static final String TEMPLATE_CLOSE
- See Also:
- Constant Field Values
COMPONENT_NAME
public static final String COMPONENT_NAME
updateFreq
protected String updateFreq
autoStart
protected String autoStart
delay
protected String delay
startTimerListenTopics
protected String startTimerListenTopics
stopTimerListenTopics
protected String stopTimerListenTopics
refreshOnShow
protected String refreshOnShow
closable
protected String closable
preload
protected String preload
Div
public Div(com.opensymphony.xwork2.util.ValueStack stack,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
getDefaultOpenTemplate
public String getDefaultOpenTemplate()
- Specified by:
getDefaultOpenTemplate
in class ClosingUIBean
getDefaultTemplate
protected String getDefaultTemplate()
- Specified by:
getDefaultTemplate
in class UIBean
evaluateExtraParams
public void evaluateExtraParams()
- Overrides:
evaluateExtraParams
in class AbstractRemoteBean
setAutoStart
public void setAutoStart(String autoStart)
setDelay
public void setDelay(String delay)
setUpdateFreq
public void setUpdateFreq(String updateInterval)
setStartTimerListenTopics
public void setStartTimerListenTopics(String startTimerListenTopic)
setStopTimerListenTopics
public void setStopTimerListenTopics(String stopTimerListenTopic)
setRefreshOnShow
public void setRefreshOnShow(String refreshOnShow)
setClosable
public void setClosable(String closable)
setPreload
public void setPreload(String preload)
setHighlightColor
public void setHighlightColor(String highlightColor)
- Specified by:
setHighlightColor
in interface RemoteBean
- Overrides:
setHighlightColor
in class AbstractRemoteBean
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.