Package com.orchestranetworks.ui.form

# Class UIFormPaneWithTabs

java.lang.Object
com.orchestranetworks.ui.form.UIFormPaneWithTabs

All Implemented Interfaces:
  `UIFormPane`

public final class UIFormPaneWithTabs extends Object implements UIFormPane
This layout divides the form into a set of `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`.

Since:
  5.3.0
See Also:
  - `UIFormPaneWithTabs.Tab`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `UIFormPaneWithTabs.Tab`
  This class offers a tab to have a `UIFormLabelSpec` for the title and thus can have a `UIFormLabelSpec.DocumentationPane`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ROOT_ID`
  HTML id used by the system to build the root tabbed pane.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UIFormPaneWithTabs()`
  Instantiates a new form pane with tabs (tabbed pane).

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addHomeTab(UIFormPane aPane)`
  Adds a home pane to the layout.
  `void`
  `addTab(UserMessage 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(String 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.
  `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.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.orchestranetworks.ui.form.UIFormPane

  `isPaddingEnabled`

- ## Field Details

  - ### ROOT_ID

    public static final String ROOT_ID
    HTML id used by the system to build the root tabbed pane.

    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.

    Since:
      5.8.0
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### UIFormPaneWithTabs

    public UIFormPaneWithTabs()
    Instantiates a new form pane with tabs (tabbed pane).

    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.

- ## Method Details

  - ### writePane

    public void writePane(UIFormPaneWriter aWriter, UIFormContext aContext)
    Description copied from interface: `UIFormPane`
    Specifies the HTML pane content.

    For details on when the EBX® user interface invokes this method, see Life cycle.

    Specified by:
      `writePane` in interface `UIFormPane`
    Parameters:
      `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.

  - ### getSelectedTabIndex

    @Deprecated public int getSelectedTabIndex()
    Deprecated.
    please use `getSelectedTabId()`
    Returns the selected tab index.
    Returns:
      the selected tab index
    See Also:
      - `setSelectedTabIndex(int)`

  - ### getSelectedTabId

    public String getSelectedTabId()
    Returns the tab id specified with the method `selectTab(String)`.

    If no tab id has been specified by `selectTab(String)`, this method will return `null`.

    Returns:
      the selected tab id,
      or `null` if no tab id has been specified by `selectTab(String)`
    Since:
      5.8.0
    See Also:
      - `selectTab(String)`

  - ### setSelectedTabIndex

    @Deprecated public void setSelectedTabIndex(int selectedTabIndex)
    Deprecated.
    please use `selectTab(String)`
    Specifies the selected tab when the page is displayed.

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

    Parameters:
      `selectedTabIndex` - the index of the selected tab when the page is displayed.

  - ### selectTab

    public void selectTab(String aTabIdToSelect)
    Specifies the id of the tab to select when the page is displayed.

    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.

    Parameters:
      `aTabIdToSelect` - the id of the tab to select when the page is displayed.
    Since:
      5.8.0
    See Also:
      - `getSelectedTabId()`

  - ### setHomeIconDisplayed

    @Deprecated public 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.
    Specifies if the first tab must display the default "home" icon in its label.

    Default value is `false` (no "home" icon).

    This feature only works for the `root tabbed pane`.

    Parameters:
      `displayHomeIcon` - `true` to display the "home" icon in the label of the first tab, `false` to not display it.

  - ### getId

    public String getId()
    Get the id of the tabbed pane set with the method `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.

    Returns:
      the id set with the method `setId(String)`
    Since:
      5.8.0
    See Also:
      - `setId(String)`

  - ### setId

    public void setId(String id)
    Specifies an id to the tabbed pane.

    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.

    Parameters:
      `id` - the id to set to this tabbed pane.
    See Also:
      - `getId()`

  - ### addTab

    public void addTab(String aTitle, UIFormPane aPane)
    Adds a new tab to the layout.

    Tabs are added in the order.

    Parameters:
      `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.
    Since:
      5.8.0

  - ### addTab

    public void addTab(UserMessage aTitle, UIFormPane aPane)
    Adds a new tab to the layout.

    Tabs are added in the order.

    Parameters:
      `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.

  - ### addTab

    public void addTab(UIFormPaneWithTabs.Tab aTab)
    Adds a new tab to this tabbed pane.

    Tabs are added in the order.

    Parameters:
      `aTab` - a tab with more features than a simple title
    Since:
      5.7.0

  - ### addHomeTab

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

    Parameters:
      `aPane` - specifies the content of the tab.
    Since:
      5.8.0
    See Also:
      - `addTab(String, UIFormPane)`

  - ### getPreviousTabSelected

    public String getPreviousTabSelected(UIFormContext aFormContext)
    Returns the tab id selected prior to the submit.

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

    Parameters:
      `aFormContext` - the current `UIFormContext`
    Returns:
      the tab id selected prior to submit,
      or `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.
    Since:
      5.8.0
    See Also:
      - `UIFormContext.getPreviousTabSelected(String)`