FileDocCategorySizeDatePackage
TabbedPanel.javaAPI DocExample5419Mon Jul 23 13:26:36 BST 2007org.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).

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>

Fields Summary
public static final String
TEMPLATE
public static final String
TEMPLATE_CLOSE
private static final String
COMPONENT_NAME
protected String
selectedTab
protected String
closeButton
protected String
doLayout
protected String
templateCssPath
Constructors Summary
public TabbedPanel(com.opensymphony.xwork2.util.ValueStack stack, HttpServletRequest request, HttpServletResponse response)


           
        super(stack, request, response);
    
Methods Summary
protected voidevaluateExtraParams()

        super.evaluateExtraParams();

        if(selectedTab != null)
            addParameter("selectedTab", findString(selectedTab));
        if(closeButton != null)
            addParameter("closeButton", findString(closeButton));
        addParameter("doLayout", doLayout != null ? findValue(doLayout, Boolean.class) : Boolean.FALSE);
        if(labelPosition != null) {
            //dojo has some weird name for label positions
            if(labelPosition.equalsIgnoreCase("left"))
               labelPosition = "left-h";
            if(labelPosition.equalsIgnoreCase("right"))
                labelPosition = "right-h";
            addParameter("labelPosition", null);
            addParameter("labelPosition", labelPosition);
        }
        if(templateCssPath != null)
            addParameter("templateCssPath", findString(templateCssPath));
    
public java.lang.StringgetComponentName()

        return COMPONENT_NAME;
    
public java.lang.StringgetDefaultOpenTemplate()

        return TEMPLATE;
    
protected java.lang.StringgetDefaultTemplate()

        return TEMPLATE_CLOSE;
    
public voidsetCloseButton(java.lang.String closeButton)

        this.closeButton = closeButton;
    
public voidsetDoLayout(java.lang.String doLayout)

        this.doLayout = doLayout;
    
public voidsetId(java.lang.String id)

        // This is required to override tld generation attributes to required=true
        super.setId(id);
    
public voidsetSelectedTab(java.lang.String selectedTab)

      this.selectedTab = selectedTab;
    
public voidsetTemplateCssPath(java.lang.String templateCssPath)

        this.templateCssPath = templateCssPath;