Step 2 Handle Selected Items

VLF Windows Application Development

Step 2. Handle Selected Items

VFW052 – Build a Working List of Selected Items

1.  Create an ItemGotSelection event handling routine for the list view. Add code which:

  • Changes STD_TEXTS to YES
  • Updates entry in the list view
  • Add Salary to TOTSALARY

2.  Create an ItemLostSelection event handling routine. Add code which

  • Changes STD_TEXTS to blank
  • Updates entry in the list view
  • Subtracts Salary from TOTSALARY.

     Your code should look like the following:

Evtroutine Handling(#LTVW_1.ItemGotSelection) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
#std_texts := 'YES'
Upd_Entry In_List(#LTVW_1)
#TOTSALARY := #TOTSALARY + #salary
Endroutine
Evtroutine Handling(#LTVW_1.ItemLostSelection) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
#std_texts := *blanks
Upd_Entry In_List(#LTVW_1)
#TOTSALARY := #TOTSALARY - #salary
Endroutine

 

3.  Compile your component.

4.  Execute the Framework as Designer.

a.  Open the Reports business object properties dialog.

b.  Select the Commands Enabled tab.

c.  Select the Weekly action and define the Windows Component as iiiVFW07.

d.  Close the Properties dialog

5.  Save and Restart the Framework.

6.  Test the Weekly command handler for the Reports business object.

a.  Click on entries using the shift or control key to select multiple entries.

     The Selected column should be updated to YES and the Total Salary field should reflect the selected employees.

b.  Click on white space below the employee entries to unselect all entries. Total Salary should now be blank (zero value).