pp108 : TabGroup

TabGroup

The TabGroup is a container that holds one or more TabPage controls. You can select each TabPage to access and work with it. A TabGroup cannot contain other TabGroups. On trying to insert a TabGroup in another TabGroup, a TabPage is automatically created and all controls of the TabGroup are added to it.

You can add a control bar and a pagination bar to the TabGroup. Using these bars, you can navigate between multiple records and add, delete, and refresh records.

For information about keyboard shortcuts available for the control, see Keyboard Shortcuts.

Properties, Events, and Method of the Control

The properties, events, and methods associated with the TabGroup define its behavior. You can set them either through the control's property sheet or programmatically using the APIs.

Table 1. List of Properties
Table 2. List of Events

Design-time property

Runtime property

Description

ID

Sets the string that identifies the control on an XForm. If not specified, a unique ID is automatically generated.

Model

Sets the ID of the data model from which the data (specified using the Reference property) is displayed in the control. If model is not specified, it is inherited from the parent control's model.

Reference (xql)

Sets the location or expression for the XPath that contains the data (value) displayed in the control. The XPath refers to the child node or descendants of the immediate parent control's reference.

Parent

Specifies the data binding from the parent. The selected parent is used as the starting point for data references.

Class Name

className

Sets or retrieves the class name applied on the control.

Resizable

Select to enable the resizing of control at run time.

Note:

  • It is not possible to resize the control beyond the XForm or its parent control.
  • This functionality is disabled if the position of the control is set to free or the layout of the parent control or XForm is set to free.

Orientation

Sets the position in which tabs display at runtime. The available options are Top, Right, Bottom, Left, and Stacked.

Text Direction

Sets the display direction of text in the tabs. The available options are Vertical and Horizontal.

Tabs at bottom

tabsatbottom

DEPRECATED. Use Orientation instead.Sets or retrieves the value that indicates whether the tab headers of the tabs on the control are placed at the top or bottom of the TabGroup. Values1,true, oryesplace the tab headers at the bottom of the TabGroup, while0,false, ornoplace the tab headers at its bottom. By default it isfalse(unchecked). For details, see Tabs.

Task Part

Creates a task part for the control. Selecting the check box, displays the Task Part pane.

Control bar

Denotes whether the control contains a control bar or not. When checked, a control bar appears on top of the TabGroup. By default, it is unchecked.

Pagination bar

Denotes whether the control contains a pagination bar or not. When checked, a pagination bar appears on top of the TabGroup. By default, it is unchecked.

businessObject

Retrieves the root node of the XML data associated with the control; the location of the data is specified by the Reference property.

currentContext

Retrieves the immediate parent of the data that the control represents. This data is the child node of the business object.

loadedTabs

Retrieves the integer that represents the number of TabPages loaded on the TabGroup control. For details, see Tabs.

navigator

Retrieves an object through which the Control bar and Pagination bar button objects can be accessed at runtime.

showTabs

Sets or retrieves a value that indicates whether the Caption Bar of TabPages on a TabGroup can be shown and hidden. Caption bar is where the tab headers are placed. Values 1, true, or yes show the caption bar, while 0, false, or no hide it. By default, it is set to true. For details, see Tabs.

view

Retrieves the view object of the data model bound to the control.

Event

Description

Data Bind This event is activated before the data is bound to a control.

On Tab Focus

This event is fired when a tab is set to focus.

On Tab Blur

This event is fired when a tab loses the input focus.

On Tab Load

This event is fired when a tab is loaded.

On Tabs Ready

This event is fired when the tabs component in the XForm is initialized. This is also fired when a tab is selected or when the title of the tab is set using the setTitle() method or when it is created using getTab() method.

On Tab Unload

This event is fired when a tab is unloaded.

Table 3. List of Methods

Method

Description

addListener()

This method registers the control to receive notifications for an event.

create()

This method is available for data-bound controls only. It creates an instance of the business object for the control.

disable()

This method disables the control on which it is invoked.

enable()

This method enables the control on which it is invoked.

find()

This method displays the Find dialog box. This is equivalent to clicking in the navigation bar.

getActiveTab()

This method returns the currently active or selected TabPage.

getBusinessObject()

This method retrieves data or business object.

getFirstDataset()

This method clears the current model's data and retrieves the first set of records from the application service.

getLastDataset()

This method clears the current model's data and retrieves the last set of records from the application service.

getNextDataset()

This method sends a request to the application service for the next set of records, if available.

getPreviousDataset()

This method sends a request to the application service for the previous set of records, if available.

hide()

This method hides controls and all associated child controls.

isEnabled()

This method retrieves the value that denotes whether the control is enabled or not.

rebind(oBusinessObject)

This method is available for all controls bound to a model. This method refreshes the control with data from the business object that is passed as a parameter. If no parameter is passed, the business object of the model's activeTuple node is used and the control is refreshed.

refresh()

This method reverts the latest unsaved changes, and binds the control to the latest business object.

remove()

This method is available only for data-bound controls. It removes the instances marked for deletion.

removeListener()

This method unregisters the control to cease receiving notifications for its events.

show()

This method makes the control and its child controls visible.