Graphic Components > Table Component > Architecture of the Table Component > The Model

The table model provides the representation objects to be displayed in the associated table. It can be connected to a back-end application by means of an adapter. It refers to an attribute group IlpExtendedAttributeGroup to determine which attributes of the representation objects are to be displayed. Each time an attribute is added to or removed from this attribute group, a column is added to or removed from the table. (For more information on attributes, see Attribute API in the Business Objects and Data Sources documentation.)

Note
Each added column is arbitrarily placed at the end of the table, unless its position is defined as property index in the style sheets set to the table.

By default, the IlpTableView creates an instance of IlpTableListModel. This table model could be filled through an IlpDefaultListModel connected to a back end or could be used directly.

When the table is to be connected to a back-end application, a data source and a list adapter must be instantiated. Both the data source and the default list model must be connected to the adapter.

Managing Attributes (Columns)

Attributes contain the values of the representation objects, or of the business objects related to the representation objects, to be shown in the table. Attributes are displayed in the columns of the table.

Note
An attribute can also contain a computed value, that is, the result of a calculation, or refer to another attribute. See the Business Objects and Data Sources documentation.

The IlpAbstractTableModel class provides the following methods to manage these attributes:

Managing Representation Objects (Rows)

The IlpTableListModel class, which extends IlpAbstractTableModel, provides the following methods to manage the representation objects in a table. The representation objects correspond to the rows in the table. These rows must be instances of an implementation of IlpTableRow.

To add or remove representation objects when you do not use an adapter and a data source, you must use the following IlpDefaultListModel methods: