Dynamic View Services > Implementing a Representation Model > Implementing a Table Representation Model > Server-to-Component Updates
 
Server-to-Component Updates
As for the Tree example, the bridge classes and the association between representation attributes and editing functions are declared to the representation model interpreter. The classes TableR and RowR both declare indexed attributes:
ILS_RP_OBJECT_BEGIN(TableR)
ILS_RP_ATTR_STRING(TableR,title,setTitle)
ILS_RP_INDEXED_ATTR_STRING(TableR,column,setColumn,setColumnHeader)
ILS_RP_OBJECT_END(TableR)
 
 
ILS_RP_OBJECT_BEGIN(RowR)
ILS_RP_ATTR_REF(RowR,owner,setParent,TableR,)
ILS_RP_INDEXED_ATTR_STRING(RowR, column, setValue)
ILS_RP_INDEXED_ATTR_LONG(RowR, column, setValue)
ILS_RP_ATTR_STRING(RowR, color, setColor)
ILS_RP_OBJECT_END(RowR)
Note that the attribute column is declared twice for the type RowR, because this attribute supports two types of value: string and long.
Although the name of the associated modifier is setValue in both cases, the functions associated are different, namely:
void setValue(int index, IlsString value);
for string values, and
void setValue(int index, long value);
for long integer values.
The first parameter of the editing function for indexed attributes is the attribute index.
Note: The macro ILS_RP_INDEXED_ATTR_INT is equivalent to the macro ILS_RP_INDEXED_ATTR_LONG. This means that the parameter passed to the modifier is a long integer.

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