Step 1 Create the Weekly Command Handler

VLF Windows Application Development

Step 1. Create the Weekly Command Handler

VFW052 – Build a Working List of Selected Items

1.  Create a new Reusable Part / Panel:

     Name:  iiiVFW07

     Description: Select Items from List

2.  Change the Ancestor to VF_AC010.

3.  Select the Design ribbon. Click on the New Layout button to add an attachment manager to the reusable part.

4.  Drag and drop a Panel component at the bottom of the form.

5.  Drag and drop a List View component into the center of the top area.

6.  From the Home ribbon, open the Layout Helper tab from the Views dialog. Select your component iiiVFW07, for example click on the reusable part's title bar. On the Layout Helper, select the Child Details tab and ensure that PANL_1 is defined as Bottom and LTVW_1 is defined as Center.

7.  Save your component.

8.  On the Repository tab, find the file PSLMST and drag and drop fields EMPNO, SURNAME, GIVENAME and SALARY into the List View.

9.  On the Repository tab, expand Fields and drag and drop field STD_TEXTS into the List View.

10. Click on the column heading for STD_TEXTS and use the Details tab to change the Caption to Selected, and the CaptionType to Caption.

11. Select the list view and use the Details tab to ensure the SelectionStyle is Multiple.

12. Save your changes. Your design should look like the following.

13. In the Repository create a field TOTSALARY (it may already exist). The field should be Packed, 15.2 with an edit code which shows a negative sign (for example, edit code L).

a.  Add the field TOTSALARY onto PANL_1 at the bottom of the main panel.

b.  Change TOTSALARY MarginLeft property to 100. Adjust the Width property as required.

14. Create an Initialize event handling routine for the List View. Add code to:

  • Clear the list view
  • Change STD_TEXTS to blanks
  • Select the required fields from file PSLMST
  • Add and entry to the list view
  • End Select.

     Your code should look like the following:

Evtroutine Handling(#LTVW_1.Initialize) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Clr_List Named(#LTVW_1)
#std_texts := *blanks
Select Fields(#LTVW_1) From_File(pslmst)
Add_Entry To_List(#LTVW_1)
Endselect
Endroutine

 

15. Save your changes.