pp108 : TabPage

TabPage


A TabPage control is functionally equivalent to a Groupbox control and is used to group items in a tab.

TabPage controls can be bound to a model from which it fetches data. The controls in the TabPage, for which the reference attribute is defined, are bound to and display the values of the business object.

In order to improve the performance and reduce the loading time of a Web page containing a TabPage control, you can set the control as an load-on-demand control. This means that for load-on-demand controls, all child controls in it are rendered as plain HTML when an application is loaded for the first time. However, as no data or API is available for the child controls, they are not ready for use. On expanding the control, the child controls are initialized and their APIs are available for use.

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

Properties, Events, and Methods of the Control


The TabPage control has certain properties, events, and methods associated with it. They define the behavior of the control and can be set through the property page of the control 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.

Image

Sets the image to be displayed in the tab header.

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.

Tooltip

title

Sets the tool tip that appears on a control when the mouse is moved over it. Programmatically, this property is set by specifying the title property of the control.

Load content when tab page is selected

Sets the control as a load-on-demand control. This means that when a page is loaded for the first time at run time, the control is initialized (loaded with content) only when you click it.

Task Part

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

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.

view

Retrieves the view object of the data model bound to the control. For details, see Tabs.

Table 3. List of Methods

Event

Description

Data Bind

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

xforms-oninitialize

This event is fired after a load-on-demand tab page is selected. You can use this event to perform operations such as setting default values, and retrieving data from Web services and binding it to the child controls.

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.

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.

isinitialized()

This method returns the initialization status of child controls in a control that is set to load on demand, that is for which the Load content when tabpage is selected option is selected in the property sheet. Possible return values are:

  • true: the child controls are intitalized and ready for use.
  • false: the child controls are not initialized and are not ready for use. Only the plain HTML of the child controls is available in the Web page and no APIs are available.
    Note: If you need to initialize a load-on-demand control before a user clicks it, you can use the select() method to load it programmatically.

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.

blink() close() select()

For more information on this method, see Tabs.

show()

This method makes the control and its child controls visible.