Class TabbedPanel

  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.TabbedPanel

public class TabbedPanel
extends ClosingUIBean

The tabbedpanel widget is primarily an AJAX component, where each tab can either be local content or remote content (refreshed each time the user selects that tab).

If the useSelectedTabCookie attribute is set to true, the id of the selected tab is saved in a cookie on activation. When coming back to this view, the cookie is read and the tab will be activated again, unless an actual value for the selectedTab attribute is specified.

If you want to use the cookie feature, please be sure that you provide a unique id for your tabbedpanel component, since this will also be the identifying name component of the stored cookie.


The following is an example of a tabbedpanel and panel tag utilizing local and remote content.

 <s:tabbedPanel id="test" >
    <s:div id="one" label="one" theme="ajax" labelposition="top" >
        This is the first pane<br/>
            <s:textfield name="tt" label="Test Text"/>  <br/>
            <s:textfield name="tt2" label="Test Text2"/>
    <s:div id="three" label="remote" theme="ajax" href="/AjaxTest.action" >
        This is the remote tab

Field Summary
protected  String closeButton
private static String COMPONENT_NAME
protected  String doLayout
protected  String selectedTab
static String TEMPLATE
static String TEMPLATE_CLOSE
protected  String templateCssPath
protected  String useSelectedTabCookie
Fields inherited from class org.apache.struts2.components.ClosingUIBean
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
TabbedPanel(ValueStack stack, HttpServletRequest request, HttpServletResponse response)
Method Summary
protected  void evaluateExtraParams()
 String getComponentName()
 String getDefaultOpenTemplate()
protected  String getDefaultTemplate()
          A contract that requires each concrete UI Tag to specify which template should be used as a default.
 void setCloseButton(String closeButton)
 void setDoLayout(String doLayout)
 void setId(String id)
 void setSelectedTab(String selectedTab)
 void setTemplateCssPath(String templateCssPath)
 void setUseSelectedTabCookie(String useSelectedTabCookie)
Methods inherited from class org.apache.struts2.components.ClosingUIBean
setOpenTemplate, start
Methods inherited from class org.apache.struts2.components.UIBean
addFormParameter, buildTemplateName, enableAncestorFormCustomOnsubmit, end, ensureAttributeSafelyNotEscaped, 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, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findValue, findValue, findValue, getComponentStack, getId, getParameters, getStack, popComponentStack, setActionMapper, toString, usesBody
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final String TEMPLATE
See Also:
Constant Field Values


public static final String TEMPLATE_CLOSE
See Also:
Constant Field Values


private static final String COMPONENT_NAME


protected String selectedTab


protected String closeButton


protected String doLayout


protected String templateCssPath


protected String useSelectedTabCookie
Constructor Detail


public TabbedPanel(ValueStack stack,
                   HttpServletRequest request,
                   HttpServletResponse response)
Method Detail


protected void evaluateExtraParams()
evaluateExtraParams in class UIBean


public String getDefaultOpenTemplate()
Specified by:
getDefaultOpenTemplate in class ClosingUIBean


protected String getDefaultTemplate()
Description copied from class: UIBean
A contract that requires each concrete UI Tag to specify which template should be used as a default. For example, the CheckboxTab might return "checkbox.vm" while the RadioTag might return "radio.vm". This value not begin with a '/' unless you intend to make the path absolute rather than relative to the current theme.

Specified by:
getDefaultTemplate in class UIBean
The name of the template to be used as the default.


public String getComponentName()


public void setId(String id)
setId in class Component


public void setSelectedTab(String selectedTab)


public void setCloseButton(String closeButton)


public void setDoLayout(String doLayout)


public void setTemplateCssPath(String templateCssPath)


public void setUseSelectedTabCookie(String useSelectedTabCookie)

Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.