Step 3 Create the Selected Employees Viewer

VLF Windows Application Development

Step 3. Create the Selected Employees Viewer

VFW106 – Using a List Collection

1.  Create new Form / Basic Form:

     Name: iiiVFW33

     Description: Selected Employees Viewer

2.  Size the form approximately to Height 430 and Width 230.

3.  Change the form's FrameStyle to Dialog, and FormStyle to StayOnTopChild

4.  Use the Design ribbon to give the form an Attachment manager.

5.  Drop a List View into the center of the form and change the List View's Name to SEL_LIST.

6.  Drag and drop the field Fullname onto the list view, and change its WidthType to Remainder.

     Your form should look like the following:

7.  Save the form

8.  Create a method routine named uShow.

     This method will be invoked by the SelectionChanged method in the Monthly Command Handler for Reports - iiiVFW32.

     The uShow 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.