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 :
iiiVFW18
Employee Skills Browser.
Give the reusable part an ancestor of VF_AC010.
2. From the tab, give the reusable part a manager. On the tab give this a of Raised. The defines two panels and .
3. Select the left side Panel and change its to LEFT_PANEL.
Change the right side Panel's to RIGHT_PANEL.
4. Select LEFT_PANEL and give it an manager.
5. Drop a into the center of LEFT_PANEL. Change the List View's to SKILL_LIST.
6. On the 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 and 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 method routine, which redefines the ancestor method. Add logic to execute the ancestor 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)EndselectEndroutine
11. Execute the subroutine from the 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 business object, command .
14. 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.