Rogue Wave Server/Rogue Wave Views Integration > Server/Views Mapping > Server/Views Representation Model > IlsSwTable
 
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 Rogue Wave Views data sources and memory tables that have been created by the Server data source:
*The Properties data source
*The Main 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 IlsSwRow 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 Rogue Wave Views memory table.
All indexed predefined properties are column properties of the Rogue Wave Views memory table.
Note: Indexes of indexed properties are Rogue Wave 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.
*editRight (boolean): Specifies whether the table can be modified.
Rogue Wave Views Table Properties
These are properties of IliMemoryTable objects. They can be set in Rogue Wave Server Studio. IlsSwTable has the following predefined attributes:
*title [] (string): Contains the title of the columns in the table. See the Rogue Wave Views documentation about the difference between column names and column titles.
*label [] (string): Contains the label of the columns in the table. See the Rogue Wave Views documentation about the difference between column names and column labels.
*format [] (string): Contains the format to be used when displaying values in the column.
*mask [] (string): Contains the mask to be used when entering values in the column.
*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”.
*width [] (long): Contains the display width of the column.
*visible [] (boolean): Controls whether the column is displayed or hidden.
*readOnly [] (boolean): Controls whether the column is read-only or not.
*defaultValue [] (string): Contains the default value for the column when rows are added to the table.
*length [] (int): specify the maximum length of the column.
*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 Rogue Wave Views documentation.
Graphical Properties
These properties are also Rogue Wave 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 Rogue Wave Views documentation for more information on the Property Manager.)
*background (string): specify the background color of a table
*foreground (string): specify the foreground color of a table
*font (string): specify the font used by the table
*background [] (string): specify the background color of a table column
*foreground [] (string): specify the foreground color of a table column
*font (string) []: specify the font used by the table column
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 Rogue Wave 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 Rogue Wave 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 Rogue Wave 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 Rogue Wave Server Studio. To differentiate the columnds of the Properties data source table from your own user-defined property, Rogue Wave 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.
*InsertRowSymbol
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.
*DeleteRowSymbol
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 IlsRpObject::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.
Others callbacks are documented in the Reference Manual.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.