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:
  • 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:
  • 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.
      Returns the selected tab index.
      Returns:
      the selected tab index
      See Also:
    • 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:
    • setSelectedTabIndex

      @Deprecated public void setSelectedTabIndex(int selectedTabIndex)
      Deprecated.
      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:
    • 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

      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:
    • 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:
    • 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: