setCollectionObject

setCollectionObject(obj: Object);

The setCollectionObject method of the Table class sets the object in the collection attached to the table to the value specified in the obj parameter.

This method ensures that the object referenced is in the displayed list of collection entries for a table sheet. This is equivalent to setting listbox.listObject := object; when a collection is attached to a list box by using the displayCollection method.

If the object is already one of the row entries in the displayed table (the matching row object), the setCollectionObject method call just results in setting the row property of the sheet to that row.

If the object is not in the displayed table rows, the current table rows from the collection are discarded. The iterator position within the collection is then adjusted so that the rebuilt display rows include the requested object. The row property of the sheet is then set to the row of the requested object.

An exception is raised if a collection is not currently attached to the sheet that is being referenced or the object cannot be found within the collection.