IlsSwTable
Description
The class IlsSwTable is created whenever a representation of type IlsSwTable is created by the generic protocol based on your view specification. Each IlsSwTable object is associated with two Views data sources and memory tables that have been created by the Server data source:
The values of the Properties data source cells are notified through the table representation object. There is no predefined mapping for attributes that have been mapped to the columns of the Properties data source table. To overcome this, a default member function is called according to the type of the column. This default member function has been registered using ILS_RP_ATTR_DEFAULT macros. Its purpose is to set the received value in the first and unique row of the memory table associated with the Properties data source and in the column whose name matches the name of the representation attribute currently notified. The Main data source will be filled by instances of when corresponding Server objects will be notified.
Predefined Properties
All non-indexed predefined properties are properties of an IlsSwTable table representation or of its associated Views memory table.
All indexed predefined properties are column properties of the Views memory table.
| Note
Indexes of indexed properties are Server indexes and, therefore, begin at 1. |
Because these properties are recognized as predefined properties for IlsSwTable, you must not use their names as columns of the Properties data source. For instance, you cannot map a server object attribute to a column of the Properties data source named font.
Table Representation Attributes
-
column [] (string): Contains the name of the columns in the table. Note that it does not make sense to put any other type than string.
Views Table Properties
These are properties of IliMemoryTable objects. They can be set in Server Studio. IlsSwTable has the following predefined attributes:
-
title [] (string): Contains the title of the columns in the table. See the Views documentation about the difference between column names and column titles.
-
label [] (string): Contains the label of the columns in the table. See the Views documentation about the difference between column names and column labels.
-
alignment [] (string): Sets the alignment option to be used when displaying values in the column. Valid values for this string are: “Center”, “Right” and “Left”.
-
defaultValue [] (string): Contains the default value for the column when rows are added to the table.
-
null [] (boolean): specify whether the column can be null or not. If a column cannot be null, Views will display an error message if you try to validate a row with its column assigned to a null value.
All other non-indexed attributes are assumed to be properties and are put into the Properties data source. Any other indexed attributes are ignored.
More information about tables can be found in the Views documentation.
Graphical Properties
These properties are also Views table properties and use the property manager attached to the table to manage graphical attributes of any attached gadgets. These properties are managed by a set of rules defined by the property manager. You can use the following API to control the property manager used by the table.
void IlsSwTable::setTablePropertyManager(IliTablePropertyManager* propMgr)
IliTablePropertyManager* IlsSwTable::getTablePropertyManager();
By default, IlsSwTable use the default property manager defined for its associated Views memory table. (See the Views documentation for more information on the Property Manager.)
Reserved Property Names
The following attributes are reserved by this class for future use and should not be used: foreign, foreignValue, foreignDisplay, constrained and completion.
IlsSwTable uses the following properties internally:
-
rowType (string): This property is generated by Server Studio to specify the default row type that must be used when a row is created in a multiple-row-type tables.
-
collectorName (string): This property is generated by Server Studio to specify the default collector to use when a row is created in a multiple-row-type table.
See Multiple-Row-Type Tables for details.
User-Defined Properties
By default, when Server maps an attribute for which it cannot find any mapping method, it creates a new column in the Properties data source, except for predefined table properties. To handle specific table properties, you must:
-
derive the class IlsSwTable;
-
install your own mapping for this property.
Only then can you specify values for your property using the Edit Table Representation Properties dialog box in Server Studio. To differentiate the columnds of the Properties data source table from your own user-defined property, Server Studio uses a special comment in the dynamic view specification:
## tableProperties=myProperty1,myProperty2
In the following example, isLocked is a table property that has been defined by the user for the LockedSwTable representation object:
subscribe origin Node:
represent LockedSwTable InputTable
## tableProperties=isLocked
:
# Main data source columns
string column[1]="Link";
string column[2]="Origin";
string column[3]="capacity";
# Properties data source columns
string label=name;
int inputCapacity=inputCapacity;
int outputCapacity=outputCapacity;
# Table properties
boolean isLocked=(locker==(view.user?true:false));
propagate inputLines;
The LockedSwTable object must install a mapping to handle its representation attribute isLocked.
Callbacks
The class IlsSwTable features a set of callbacks.
This callback is called when the application is about to insert a new row into the memory table attached to the IlsSwTable object before an update is sent to the server. It is not called when a new row is added by server notification.
By default, adding a new row to the memory table creates a new server object and adds it to the relation represented by the IlsSwTable object (through the collector). If you just want to add an existing object to the relation, you must control the way the row is inserted. The InsertRowSymbol callback is one way of the methods available to manage this situation.
See the class IlsSwTable and the basic type IlsSwTableCallbackInsertRowType in the Reference Manual for a complete description.
This callback is called when the application is about to delete a row from the memory table attached to the IlsSwTable object before an update is sent to the server. It is not called when a row is deleted by server notification.
By default, deleting a row from the memory table sends an update to tell the server to delete the corresponding server object from the relation represented by IlsSwTable object (through the collector). You may want to perform an alternative action, such as calling the function onSuppress on the row or selecting a collector in case of multiple-row-type tables.
See the class IlsSwTable and the basic type IlsSwTableCallbackDeleteRowType in the Reference Manual for a complete description.






