Step 2 Create the Employee Query Command Handler

VLF Windows Application Development

Step 2. Create the Employee Query Command Handler.

VFW126 – Using Space Objects (Optional)

1.  Create a new Reusable Part / Panel:

     Name: iiiVFW43

     Description: Reports Employee Query Command Handler

2.  Give the reusable part an ancestor of VF_AC010

3.  This command handler will display a list of employees from the space object selecting entries using the department code key.

     Total Salary is shown for selected employees.

     Note that the Employee Query displays all fields from the space object, which is different to the list view in the Salary command handler.

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

5.  Drop a Panel component at the bottom of the RP's panel and change the new panel's Name to Bottom. Adjust its height as required.

6.  Drop a Panel onto the top of the RP's panel and change the new panel's Name to Top. Adjust its height if required.

7.  Drop a list view into the center of the RP's panel. If necessary use the Layout Helper tab to ensure that the child components are correctly attached.

8.  Locate the file PSLMST in the Repository and drop fields EMPNO, SURNAME, GIVENAME, DEPTMENT, SECTION and SALARY into the list.

9.  Create an ItemGotSelection and ItemLostSelection event routine for the list view.

10. Drop field TOTSALARY onto the right hand side of the panel Bottom.

11. Select the panel Top and use the Design ribbon to give it a Flow Across manager. Open the Layout Helper tab and note that the default setting for Flow Rules is LeftToRight, which is what is required.

12. Select the Top panel on the Design view. On the Layout Helper, select the Category -  Margins on the Layout Manager Details tab. Use the All setting to give children on this panel a margin of 6 pixels on all four sides.

13. Drop the field DEPTMENT onto the panel Top. Change its Name to DEPT_IN

14. Drop a Push Button component onto the Top panel. Give it a Caption of Select and change its Name to PHBN_SELECT.

15. Create a Click event for the push button.

16. Save the reusable part.