Step 7 Include New Component Link into Employee Browse List

LANSA Web Functions

Step 7. Include New Component Link into Employee Browse List

In this step, you will create a component that will contain a link using an <A HREF> and an image (based on the value of the PHONEBUS field). This component will be included in the browse list used in function iiiFN11 and it will be used to call an Employee Details function (iiiFN12).

1.  Using the LANSA for the Web editor, create a new HTML page. 

2.  When the new page appears, delete all of the default HTML code.

3.  Add the following lines to the page (where iii is your course assigned ID and ppp=partition):

<a href="/cgi-bin/lansaweb?procfun+iiiproc03+iiifn012+ppp+funcparms+

EMPNO(A0050):<RDML MERGE="EMPNO">"  target="New Employee">

<img src="/IMAGES/<RDML MERGE="PHONEBUS">" border="0">

</a>

     Reminder: The <A HREF> link will not automatically exchange the WEBEEVENT data as it uses a new Web job. The Employee Number parameter is passed as part of the function call so that the iiiFN12 Employee Details function can retrieve the required data from the PSLMST file. The iiiFN12 Employee Details function is also opened in a new browser window.

4.  Save your document as iiiIMAGE with description Employee Image.

5.  Using the LANSA for the Web editor, open the Maintain Components window.

6.  Select Add, to add a new component as follows (where iii is your course assigned ID):

Component

iiiIMAGE

Type

Visual

 

 

Description

Employee Image Component

Page

iiiIMAGE

Mode

OUTPUT

 

  

7.  Working with your iiiPROC03 process, edit the function named iiiFN11 Employee List.

8.  Define a new field iiiIMAGE based on the #PHONEBUS field and add the iiiIMAGE field to the browse list iiiEMPLST. Also add the PHONEBUS (which contains the name of the employee image graphic file name) as a *HIDDEN field.

     Your function should appear as follows  (where iii is your course assigned ID):     

FUNCTION  (*DIRECT *WEBEVENT)
DEFINE    FIELD(#iiiIMAGE) REFFLD(#PHONEBUS)
DEF_LIST   NAME(#iiiEMPLST) FIELDS((#iiiIMAGE *NOID) (#EMPNO) (#GIVENAME) (#SURNAME) (#PHONEBUS *HIDDEN)) ENTRYS(9999)
CLR_LIST  NAMED(#iiiEMPLST)
SELECT    FIELDS((#iiiEMPLST)) FROM_FILE(PSLMST1) WITH_KEY(#iiiDEPTWK #iiiSECTWK) IO_STATUS(*STATUS) IO_ERROR(*NEXT) VAL_ERROR(*NEXT)                                           
ADD_ENTRY TO_LIST(#iiiEMPLST)
ENDSELECT
DISPLAY   FIELDS((#iiiDEPTWK) (#iiiSECTWK)) BROWSELIST(#iiiEMPLST) EXIT_KEY(*NO) MENU_KEY(*NO)

 

  

9.  Exit and save your RDML function.

10.   Compile your function.