public final class UIFormPaneWithTabs extends Object implements UIFormPane
tabs
.
Each tab is an UIFormPane
with a title.
More features (like using a documentation pane
in the title or showing
a tab with JavaScript) are available using
UIFormPaneWithTabs.Tab
.
UIFormPaneWithTabs.Tab
Modifier and Type | Class and Description |
---|---|
static class |
UIFormPaneWithTabs.Tab
This class offers a tab to have a
UIFormLabelSpec
for the title and thus can have a UIFormLabelSpec.DocumentationPane . |
Modifier and Type | Field and Description |
---|---|
static String |
ROOT_ID
HTML id used by the system to build the root tabbed pane.
|
Constructor and Description |
---|
UIFormPaneWithTabs()
Instantiates a new form pane with tabs (tabbed pane).
|
Modifier and Type | Method and Description |
---|---|
void |
addHomeTab(UIFormPane aPane)
Adds a home pane to the layout.
|
void |
addTab(String aTitle,
UIFormPane aPane)
Adds a new tab to the layout.
|
void |
addTab(UIFormPaneWithTabs.Tab aTab)
Adds a new tab to this tabbed pane.
|
void |
addTab(UserMessage aTitle,
UIFormPane aPane)
Adds a new tab to the layout.
|
String |
getId()
Get the id of the tabbed pane set with the method
setId(String) . |
String |
getPreviousTabSelected(UIFormContext aFormContext)
Returns the tab id selected prior to the submit.
|
String |
getSelectedTabId()
Returns the tab id specified with the method
selectTab(String) . |
int |
getSelectedTabIndex()
Deprecated.
please use
getSelectedTabId() |
void |
selectTab(String aTabIdToSelect)
Specifies the id of the tab to select when the page is displayed.
|
void |
setHomeIconDisplayed(boolean displayHomeIcon)
Deprecated.
Since 5.9.0, home icon is no longer displayed. If the first tab
title is empty, a default label will be displayed.
|
void |
setId(String id)
Specifies an id to the tabbed pane.
|
void |
setSelectedTabIndex(int selectedTabIndex)
Deprecated.
please use
selectTab(String) |
void |
writePane(UIFormPaneWriter aWriter,
UIFormContext aContext)
Specifies the HTML pane content.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isPaddingEnabled
public static final String ROOT_ID
A root tabbed pane is the topmost tabbed pane of the form.
It is the tabbed pane set as whole form content using
UIFormBody.setContent(UIFormPane)
.
For technical reasons (namely workspace's form HTML layout managed by JavaScript and CSS), the id of the root tabbed pane is fixed.
public UIFormPaneWithTabs()
Note: to ensure the best behavior about auto-select last tab,
it is recommended to set a fixed id
to the same tabbed pane throw pages.
public void writePane(UIFormPaneWriter aWriter, UIFormContext aContext)
UIFormPane
For details on when the EBX® user interface invokes this method, see Life cycle.
writePane
in interface UIFormPane
aWriter
- the UIFormPaneWriter
to use to add some built-in form rows,
widgets, or simple HTML and JavaScript.aContext
- a UIFormContext
to request data and environment.public int getSelectedTabIndex()
getSelectedTabId()
setSelectedTabIndex(int)
public String getSelectedTabId()
selectTab(String)
.
If no tab id has been specified by selectTab(String)
,
this method will return null
.
null
if no tab id has been
specified by selectTab(String)
selectTab(String)
public void setSelectedTabIndex(int selectedTabIndex)
selectTab(String)
The parameter must correspond to an existing tab
(otherwise an IndexOutOfBoundsException
will be raised).
So tabs must be added before calling this method.
Default is 0 (the first tab).
selectedTabIndex
- the index of the selected tab when the page is displayed.public void selectTab(String aTabIdToSelect)
If no tab has this id, the default tab will be selected.
The default tab can be the first tab if it's the first display of the form, or the last tab selected by the user.
aTabIdToSelect
- the id of the tab to select when the page is displayed.getSelectedTabId()
public void setHomeIconDisplayed(boolean displayHomeIcon)
Default value is false
(no "home" icon).
This feature only works for the root tabbed pane
.
displayHomeIcon
- true
to display the "home" icon in the label of the first tab,
false
to not display it.public String getId()
setId(String)
.
Note that if this tabbed pane is not a sub pane with tabs (that is a root tabbed pane), this id does not reflect the real id used by the system.
setId(String)
setId(String)
public void setId(String id)
This feature only works for sub tabbed panes (as an independent pane).
That is, this feature does not work for the root tabbed pane which has
a fixed id ROOT_ID
.
If no id is set, it will be generated.
If the structure of the page is dynamic to the record state (or an extra info), please set a fixed id. Otherwise, this tabbed pane won't be able to auto-select the previous tab after the form submit.
id
- the id to set to this tabbed pane.getId()
public void addTab(String aTitle, UIFormPane aPane)
Tabs are added in the order.
aTitle
- the label of the tab; can be null
for the first tab, if the
home icon is enabled
(otherwise, it is not recommended to use null
or an empty String).aPane
- specifies the content of the tab.public void addTab(UserMessage aTitle, UIFormPane aPane)
Tabs are added in the order.
aTitle
- the label of the tab; can be null
for the first tab, if the
home icon is enabled
(otherwise, it is not recommended to use null
or an empty String).aPane
- specifies the content of the tab.public void addTab(UIFormPaneWithTabs.Tab aTab)
Tabs are added in the order.
aTab
- a tab with more features than a simple titlepublic void addHomeTab(UIFormPane aPane)
Adds a home pane to the layout.
This should be the first tab, in that case a default title will be displayed (otherwise, it is not recommended to use this method).
aPane
- specifies the content of the tab.addTab(String, UIFormPane)
public String getPreviousTabSelected(UIFormContext aFormContext)
This method can only work if an id has been set to this tabbed pane.
This method is a shortcut to UIFormContext.getPreviousTabSelected(String)
.
If this tabbed pane is a root tabbed pane, this method cannot work.
In this case, UIFormContext.getPreviousTabSelected(String)
must be used with ROOT_ID
.
aFormContext
- the current UIFormContext
null
if this tabbed pane has no id,
or if it is the initial page load,
or if aTabbedPaneId
is not associated with a tabbed pane.UIFormContext.getPreviousTabSelected(String)