Step 1 Create Employee Skills Command Handler

VLF Windows Application Development

Step 1. Create Employee Skills Command Handler

VFW084 – A  Business Object Browser and Detailer

This is the Business Object Browser, which will be referred to as the BOB.

1.  Create a new Reusable Part / Panel:

     Name: iiiVFW18

     Description: Employee Skills Browser.

     Give the reusable part an ancestor of VF_AC010.

2.  From the Design tab, give the reusable part a Split Vertically manager. On the Layout Helper tab give this a Divider Style of Raised. The Vertical Splitter defines two panels PANEL_1 and PANEL_2.

3.  Select the left side Panel and change its Name to LEFT_PANEL.

     Change the right side Panel's Name to RIGHT_PANEL.

4.  Select LEFT_PANEL and give it an Attachment layout manager.

5.  Drop a List View into the center of LEFT_PANEL. Change the List View's Name to SKILL_LIST.

6.  On the Repository tab, select the file PSLSKL and drag and drop SKILCODE, GRADE, COMMENT and DATEACQ into the list view SKILL_LIST

7.  Select each column heading and change the Caption and Caption Type as shown:

Field

Property

Value

SKILCODE

Caption

Code

CaptionType

Caption

GRADE

Caption

Grade

CaptionType

Caption

COMMENT

Caption

Comment

CaptionType

Caption

DATEACQ

Caption

Date Acquired

CaptionType

Caption

 

8.  Create a uExecute method routine, which redefines the ancestor method. Add logic to execute the ancestor uExecute method:

Mthroutine Name(uExecute) Options(*redefine)
#com_ancestor.uExecute
Endroutine

 

9.  Add logic to get the current instance list entry and return AKey1.

Mthroutine Name(uExecute) Options(*redefine)
#com_ancestor.uExecute
#avlistmanager.getCurrentInstance Akey1(#empno)
Endroutine

 

10. The SKILL_LIST list view will need to be built, initially when the command handler is invoked and also whenever the Business Object Detailer has added or changed an employee skill. Create a subroutine to populate the list view. Your code should look like the following:

Subroutine Name(buildlist)Clr_List Named(#SKIlL_LIST)Select Fields(#SKILl_LIST) From_File(pslskl) With_Key(#empno)Add_Entry To_List(#SKIlL_LIST)Endselect

Endroutine

 

11. Execute the subroutine from the uExecute method:

Mthroutine Name(uExecute) Options(*redefine)
#com_ancestor.uExecute
#avlistmanager.getCurrentInstance Akey1(#empno)
Execute Subroutine(buildlist)
Endroutine

 

12. Compile your new command handler.

13. Open your Framework and plug in iiiVFW18 as the command handler for Employee business object, command Skills 2.

14. Save and Restart your Framework. Select an employee and then select the Skills 2 command handler tab. Check that the list view is populated as expected. Not all employees have skill records.

15. Close the Framework.