In this step you will extend the WebRoutine Details to insert a new employee skill.

  1. Change the definition of list EMPSKLS so that SKILCODE is input capable, removing the hidden field SC. Your code should look like the following:
         Def_List Name(#empskls) Fields(#SKILCODE #GRADE #COMMENT #DATEACQ (#dateacqr *hidden) (#empno *hidden)) Type(*Working) Entrys(*max)
  2. Delete the definition of field SC and remove all code which refers to it.
  3. Define a Group_by SKL_LIST for fields SKILCODE, GRADE, COMMENT, DATEACQ, DATAECQR. This will be used to clear employee skills list fields before adding a blank entry for insert.
  4. Define a working list SKILLS containing fields SKILCODE, SKILDESC. This list will mapped for output to populate the skill code Dynamic select box.
    LANSA definition statements can be placed anywhere in your code. It is usual to place them at the top of the program code.
    Your new code should look like the following:
    Group_By Name(#skl_list) Fields(#skilcode #grade #comment #dateacq #dateacqr)
    Def_List Name(#skills) Fields(#skilcode #skildesc) Type(*Working) Entrys(*max)
     
  5. Add a new When clause to the Details WebRoutine, that will handle a request from the New Skill button to add a blank entry as the first entry in the employee skills list. This will allow insert of a new employee skill.
    The logic should be based on the following:

Property

Value

listName

SKILLS

codeField

SKILCODE

captionField

SKILDESC

15. Add a push button with image weblet into the into the single row table below the grid. Set up the button properties as:

Property

Value

caption

New Skill

left_relative_image

icons/normal/16/contract_16.png

on_click_wrname

Details

submitExtraFields

Field Name: STDRENTRY


Literal Value: N

     Adjust the width of the push button to display the caption as single line.    
     Remove the place holder characters from table cell.
16. Select the Details tab page and then Save your changes. Your Skills tab page should look like the following:

17. Retest your WAM. Select an employee and select the Skills tab. The Dynamic select box for skills should display the correct skill description in each row.