[
|../../index.htm#lansa/wamtut01_0690.htm]
You are here:
WAM050 – A Section Maintenance Application
To design and develop your WAM applications, just like any other new application, you need to begin by focusing on:
Avoid creating very large WAMs with too many WebRoutines. Each time a WebRoutine is invoked from the browser, the WAM loads and then unloads. Many small WAMs is a much better design and will be easier to maintain.
1. Create a new WAM.
Name: iiiSecMaint
Description: Section Maintenance
Layout weblet: iiilay01
Consider the first two screen captures shown in the Objectives section that show the Begin WebRoutine in operation. This WebRoutine initially displays a list of sections that is empty and an input field for a department code. An AutoComplete weblet will replace the Department Code input field. A Select push button invokes the Begin WebRoutine that builds a list of sections for the department and displays this list.
Consider what working lists will be needed to handle this web page and what logic will be necessary?
a. Define a work field DEPT_IN based on DEPTMENT, this will be the department code input field.
b. Define working list DEPTS, to support the AutoComplete weblet. The list contains the field DEPTMENT only.
c. Define working list SECTLIST, to support the list of sections containing STDSELECT, SECTION, SECDESC, SECADDR1. Note: All fields apart from STDSELECT should have an *output attribute.
d. Map STDRENTRY globally as a hidden field.
2. Define a WebRoutine named Begin, based on the following pseudo code
Map field DEPT_IN for * both
Map for *output the Sections working list, SECTLIST
Case of field STDRENTRY
Property |
Value |
|---|---|
sourceWrName |
AutoComplete |
Listname |
DEPTS |
valueField |
DEPTMENT |
Property |
Value |
|---|---|
currentrowhfield |
SECTION |
currentrownumvalue |
$SECTION |
Rentryvalue |
S |
tooltip |
Select a Section |
on_click_wrname |
Details |
8. Select a clickable image weblet. Set the relative_image_path by clicking in the Value column, and then using the Elipsis
button and select the /normal/16 folder and then select any suitable image. See the example following:
![]()
9. Select the column heading "Std *WEBEVENT template field" and delete it.
10. If the field SECTION has a dropdown field visualization defined in the Repository, it will not be displayed in the list – since it is an *output field. If necessary, select the field SECTION in the list and use the context menu to select the option Replace with an Output Field.
11. Select anywhere in the table containing "Department Code" and the AutoComplete weblet. Use the context menu, and select the option Table Items / Add columns… to add one column to the right. Add a push button into this new column and remove the * placeholder characters from this cell.
Set up the push button properties:
Property |
Value |
|---|---|
caption |
Select |
on_click_wrname |
Begin |
submitExtraFields |
Field Name: STDRENTRY |
|
Literal Value: S |
|
Note: Whenever possible, set a weblet property value by selection from its dropdown list. Using a list of values provided by the editor, when available, will help to minimize errors in your XSL.
12. Save your changes and run the web page in the browser. Your page should look like the following:
![]()
[
|../../index.htm#lansa/wamtut01_0690.htm]