org.apache.struts2.components
Class TabbedPanel

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

Examples

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:form>
            <s:textfield name="tt" label="Test Text"/>  <br/>
            <s:textfield name="tt2" label="Test Text2"/>
        </s:form>
    </s:div>
    <s:div id="three" label="remote" theme="ajax" href="/AjaxTest.action" >
        This is the remote tab
    </s:div>
 </s:tabbedPanel>
 
 


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
openTemplate
 
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

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

private static final String COMPONENT_NAME

selectedTab

protected String selectedTab

closeButton

protected String closeButton

doLayout

protected String doLayout

templateCssPath

protected String templateCssPath

useSelectedTabCookie

protected String useSelectedTabCookie
Constructor Detail

TabbedPanel

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

evaluateExtraParams

protected void evaluateExtraParams()
Overrides:
evaluateExtraParams in class UIBean

getDefaultOpenTemplate

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

getDefaultTemplate

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
Returns:
The name of the template to be used as the default.

getComponentName

public String getComponentName()

setId

public void setId(String id)
Overrides:
setId in class Component

setSelectedTab

public void setSelectedTab(String selectedTab)

setCloseButton

public void setCloseButton(String closeButton)

setDoLayout

public void setDoLayout(String doLayout)

setTemplateCssPath

public void setTemplateCssPath(String templateCssPath)

setUseSelectedTabCookie

public void setUseSelectedTabCookie(String useSelectedTabCookie)


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