Step 1. Create an Employee Enquiry WAM
1. Create a new WAM with:
iiiEmpEnqMap
Employee Enquiry with Map
iiilay01
Create the WAM by copying the following code into the default WAM source:
Group_By Name(#empgroup) Fields((#SURNAME *OUT) (#GIVENAME *OUT) (#ADDRESS1 *OUT) (#ADDRESS2 *OUT) (#ADDRESS3 *OUT) (#POSTCODE *OUT) (#PHONEHME *OUT) (#PHONEBUS *OUT) (#DEPTMENT *OUT) (#SECTION *OUT) (#SALARY *OUT) (#STARTDTE *OUT) (#TERMDATE *OUT))
Define #ADDRESS Type(*string) Length(1000)
Webroutine Name(begin) Desc('Select Employee')
Web_Map For(*output) Fields(#empno)
Endroutine
Webroutine Name(DETAILS) Desc('Employee Details')
Web_Map For(*BOTH) Fields((#EMPNO *OUTPUT)(#ADDRESS *hidden))
Web_Map For(*OUTPUT) Fields(#empgroup)
Fetch Fields(#empgroup) From_File(PSLMST) With_Key(#EMPNO) Val_Error(*NEXT)
If_Status Is_Not(*OKAY)
Message Msgtxt('Employee not found')
Transfer Toroutine(begin)
Endif
Endroutine
2. Compile the WAM.
3. Add a push button to the begin web page.
a. Open the begin WebRoutine in the view.
b. Add a column to the fields table.
c. Add a push button in the new column.
d. Set up the button with a caption of Details and an of details.
e. Remove the * placeholder characters.
f. Save your changes.
4. Open the Details WebRoutine in the view.
a. Add a column to the fields table
b. With the top row in the new column selected, set its 14.
property toc. Click inside the new column and use the context menu to
. Your design should look like the following:
d. With the DIV still selected, select the
tab. Expand its property and set the following properties:
Property |
Value |
Height |
340px |
Margin-left |
50px |
Width |
340px |
Your design should look like the following:
e. Delete the * place holder characters from this column.
f. Save your changes.
g. Drop a
weblet into the DIV.h. Select the #ADDRESS.
and set its toEnter #ADDRESS in the
window.i. Save your changes.