Step 3 Modify Department Dropdown

VLF Windows Application Development

Step 3. Modify Department Dropdown

VFW074 – Create a Compound Reusable Part

1.  A change is required to iiiVFW13 to signal uDepartmentChanged when the departments dropdown is Initialized. The existing routine is as follows:

Evtroutine Handling(#CMBX_1.Initialize) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Clr_List Named(#CMBX_1)
Select Fields(#CMBX_1) From_File(deptab)
Add_Entry To_List(#CMBX_1)
Endselect
Get_Entry Number(1) From_List(#CMBX_1)
If_Status Is(*okay)
#CMBX_1.currentItem.focus := true
Endif
Endroutine

 

     Although the program is setting Focus for the first entry, this will not signal an ItemGotFocus event.

2.  Add code to signal the uDepartmentChanged event, as follows. New code is shown in red, italics.

Evtroutine Handling(#CMBX_1.Initialize) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Clr_List Named(#CMBX_1)
Select Fields(#CMBX_1) From_File(deptab)
Add_Entry To_List(#CMBX_1)
Endselect
Get_Entry Number(1) From_List(#CMBX_1)
If_Status Is(*okay)
#CMBX_1.currentItem.focus := true
Signal Event(uDepartmentChanged)
Endif
Endroutine

 

3.  Compile iiiVFW13.