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
.a. Open the
business object properties dialog.b. Select the
tab.c. Select the
action and define the Windows Component as iiiVFW07.d. Close the
dialog5.
the Framework.6. Test the
command handler for the 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).