Add Items to the Collection

Visual LANSA

Add Items to the Collection

A Selectlist loop is used to add the selected employee objects to the list collection. The list collection is then set as the payload for the drag operation:

 

Selectlist Named(#DRAG_LIST)

Continue If('#Drag_List.Currentitem.Selected *ne True')
Set_Ref Com(#DragEmployee) To(*Create_as #Employee)
Set Com(#DragEmployee) Pempno(#Empno) Pgivename(#GiveName) Psurname(#Surname) Psalary(#Salary) Pdepartment(#Deptment) Ppostcode(#PostCode)
Invoke Method(#PayLoadList.Insert) Item(#DragEmployee)
Endselect
 

Set_Ref Com(#PayLoad) To(#PayLoadList)

 

Ý List Collection Example 2