Step 5 Complete the Transfer Employees to Section Command Handler

VLF Windows Application Development

Step 5. Complete the Transfer Employees to Section Command Handler

VFW112 – Drag and Drop between Components

1.  Switch to iiiVFW38 in the editor.

2.  Create Click events for the PHBN_REFRESH and PHBN_SAVE buttons.

3.  The Refresh push button click event should rebuild the DRAG_FROM list.

Evtroutine Handling(#PHBN_REFRESH.Click)
Execute Subroutine(BuildEmps)
Endroutine

 

4.  The Save push button click event should invoke the SaveChanges method in the DRAG_TO component (iiiVFW37).

Evtroutine Handling(#PHBN_SAVE.Click)
#DRAG_TO.SaveChanges
Endroutine

 

5.  Compile the Transfer Employees to Section command handler.

6.  Execute the Framework as Designer.

7.  Double click on a section in the instance list to open its Properties dialog.

8.  Select the Commands Enabled tab, select the Transfer command and plug in iiiVFW38. Use the Find dialog, which plugs in using the Identifier.

9.  Save and Restart the Framework.

10. Test the Transfer Employees command handler for a Section.

a.  Select the Departments business object, expand ADM and select a section.

b.  Select the Transfers command handler. The left hand (DRAG_FROM) List contains all employees for all department / sections except the currently selected department / section.

c.  The right hand list (DRAG_TO) contains employees in the selected department / section.

d.  Select one or more employees in DRAG_FROM and drop them on DRAG_LIST.  The employees are shown in DRAG_TO with their department and section currently selected in the instance list. These employees have been removed from the DRAG_FROM list. Note that the drag image is the selected list items.

e.  Click the Save to Employee File button to update the transferred employees, changing their department and section codes to the selected department and section.