Step 3. Create the Selected Employees Viewer
VFW106 – Using a List Collection
1. Create new :
iiiVFW33
Selected Employees Viewer
2. Size the form approximately to 430 and 230.
3. Change the form's to Dialog, and to StayOnTopChild
4. Use the ribbon to give the form an .
5. Drop a into the center of the form and change the to SEL_LIST.
6. Drag and drop the field Fullname onto the list view, and change its to Remainder.
Your form should look like the following:
7. Save the form
8. Create a method routine named .
This method will be invoked by the method in the M - iiiVFW32.
The method needs to do the following:
a. Define an input map of Class(#PRIM_LCOL<iiiVFW31>), which is passed by reference.
b. Clear the selected employees list view, SEL_LIST
c. Read through the list collection EMPLOYEES using a For/Endfor loop.
d. For each entry set Fullname from the uEmployeeGivename and uEmployeeSurname properties
e. Add an entry to SEL_LIST
f. After processing the list collection show this form.
Your code should look like the following:
Mthroutine Name(uShow)
Define_Map For(*INPUT) Class(#PRIM_LCOL<#iiivfw31>) Name(#EMPLOYEES) Pass(*BY_REFERENCE)
Clr_List Named(#SEL_LIST)
For Each(#EMPLOYEE) In(#EMPLOYEES)
#FULLNAME := #EMPLOYEE.UEMPLOYEEGIVENAME + ' ' + #EMPLOYEE.UEMPLOYEESURNAME
Add_Entry To_List(#SEL_LIST)
Endfor
#COM_OWNER.SHOWFORM
Endroutine
9. Compile the form iiiVFW33.