Class UIFormPaneWithTabs.Tab
- Enclosing class:
- UIFormPaneWithTabs
UIFormLabelSpec
for the title and thus can have a UIFormLabelSpec.DocumentationPane.
It is designed to be added to a UIFormPaneWithTabs
by using the method UIFormPaneWithTabs.addTab(Tab).
The id can be set,
and be used to hide
or show a tab via JavaScript.
The initial hiding state can be set.
Example of implementation:
UIFormPaneWithTabs aPaneWithTabs = new UIFormPaneWithTabs();
aPaneWithTabs.addTab("Tab before example tab", new UITabBeforeExampleTabFormPane());
String exampleTabId = "exampleTabId";
Tab exampleTab = new Tab(new UIFormLabelSpec(new DocumentationPane(
"Example tab documentation pane"), "Example tab title"), new UIExampleTabFormPane());
exampleTab.setId(exampleTabId);
exampleTab.setInitiallyHidden();
aPaneWithTabs.addTab(exampleTab);
String showExampleTabJSfnName = "displayExampleTab";
String hideExampleTabJSfnName = "hideExampleTab";
UIButtonSpecJSActionToggle toggleExampleTabDisplay = new UIButtonSpecJSActionToggle(
UserMessage.createInfo("Display example tab"),
showExampleTabJSfnName + "()",
hideExampleTabJSfnName + "()");
aWriter.addButtonJavaScriptToggle(toggleExampleTabDisplay);
aWriter.addJS("function ").addJS(showExampleTabJSfnName).addJS("(){");
aWriter.addJS_showTab(exampleTabId);
aWriter.addJS("}");
aWriter.addJS("function ").addJS(hideExampleTabJSfnName).addJS("(){");
aWriter.addJS_hideTab(exampleTabId);
aWriter.addJS("}");
aWriter.includePane(aPaneWithTabs);
- Since:
- 5.7.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTab(UIFormPane aPane) Constructs a tab without title.Tab(UIFormLabelSpec aTitle, UIFormPane aPane) -
Method Summary
Modifier and TypeMethodDescriptiongetId()getPane()getTitle()booleanvoidSets an id for the tab.voidSets this tab to initially hidden on the browser screen.voidsetTitle(UIFormLabelSpec aTitle) Changes the tab title.
-
Constructor Details
-
Tab
Constructs a tab without title.This constructor is interesting for the first tab, a default title ("Main") will therefore be assigned.
-
Tab
-
-
Method Details
-
setId
Sets an id for the tab.The id attribute must respect the W3C Recommendation (in particular, by being unique in the page). See https://www.w3.org/TR/REC-html40/struct/global.html#adef-id for more information.
If no id is specified, an id will be generated.
If the list of tabs is dynamic to the record state (or an extra info), please set a fixed id. Otherwise, this tab won't be reselected after page reloading, record saving, etc.
- Parameters:
id- the id to set for the tab.- Since:
- 5.8.0
-
getId
- Returns:
- the id previously defined, or
null. - See Also:
-
getTitle
- Returns:
- the title previously defined, or
null.
-
setTitle
Changes the tab title.- Parameters:
aTitle- the new title- Since:
- 5.8.0
-
getPane
- Returns:
- the pane defined in the constructor
-
setInitiallyHidden
public void setInitiallyHidden()Sets this tab to initially hidden on the browser screen.The tab can be shown or hidden by a JavaScript function and the tab id.
-
isInitiallyHidden
public boolean isInitiallyHidden()- Returns:
trueif this tab will be initially hidden on the browser screen,falseif this tab will be initially displayed- See Also:
-