7.129.2 WEB_MAP Examples
In this example, the SearchQuery WebRoutine will display a page to allow a user to request a search. The fields are *OUTPUT only as no values are sent back to this Webroutine. The next Webroutine (Browse) will specify #SURNAME as in input. It requires #SURNAME, #STDRENTRY, and #STD_COUNT to be able to retrieve the next or previous.
WEBROUTINE NAME(SearchQuery) DESC('Search Criteria')
WEB_MAP FOR(*OUTPUT) FIELDS(#SURNAME (#STDRENTRY *HIDDEN))
ENDROUTINE
The Browse WebRoutine will allow the user to browse through the list of employees (#EMPLISTPG) a page at a time. It requires #SURNAME, #STDRENTRY, and #STD_COUNT to be able to retrieve the next or previous.
WEBROUTINE NAME(Browse) DESC('Browse Employees')
WEB_MAP FOR(*BOTH) FIELDS((#SURNAME *HIDDEN) (#STD_COUNT *HIDDEN) (#STDRENTRY *HIDDEN) (#STDPREV *HIDDEN) (#STDMORE *HIDDEN))
WEB_MAP FOR(*OUTPUT) FIELDS(#EMPLISTPG)
ENDROUTINE
Finally, the Details WebRoutine retrieves employee's details for display to user. The #EMPNO and #SURNAME are both sent and received, but displayed as output fields only. The #STDRENTRY field is used to communicate status with other Webroutines.
WEBROUTINE NAME(Details)
WEB_MAP FOR(*OUTPUT) FIELDS((#GIVENAME *OUTPUT) (#ADDRESS1 *OUTPUT) (#ADDRESS2 *OUTPUT) (#ADDRESS3 *OUTPUT) (#POSTCODE *OUTPUT) (#PHONEHME *OUTPUT) (#PHONEBUS *OUTPUT) (#STARTDTER *OUTPUT) (#TERMDATER *OUTPUT) (#DEPTDESC *OUTPUT) (#SECDESC *OUTPUT) (#SALARY *OUTPUT) (#MNTHSAL *OUTPUT) (#STARTDTE *OUTPUT) (#TERMDATE *OUTPUT))
WEB_MAP FOR(*BOTH) FIELDS((#EMPNO *OUTPUT) (#SURNAME *OUTPUT) (#STDRENTRY *HIDDEN) (#STD_COUNT *HIDDEN))
ENDROUTINE