Reference to an object instance to be stored for this item
Member of Tree View Item (PRIM_TVIT)
Data Type - PRIM_OBJT - Base object, use it as the ancestor of components which are not visualized
Lists typically have a simple correlation between the visible item and some kind of underlying data object e.g. A list of customers, employees or orders. Rather than relying on the field values in the list to manage the related data, or using a dictionary collection to store the link between the list item and a data object, RelatedReference provides a convenient, generic storage point that joins the list item to its data object.
In the AddEmployee routine, a data object is stored against a list item. In ItemGotFocus event, the RelatedReference is retrieved and used to populate a detailer of some sort.
Mthroutine Name(AddEmployee) Define_Map For(*Input) Class(#DataEmployee) Name(#Employee) Pass(*By_Reference) Add_entry To_list(#List) #List.Currentitem.RelatedReference <= #Employee Endroutine Evtroutine Handling(#List.ItemGotFocus) #Detailer.ShowEmployee((#list.CurrentItem.RelatedReference *as #DataEmployee)) Endroutine
LANSA Version 15, April 2020