Summary
WAM005 - Create Your First WAM
Important Observations
- A WAM layout is created using Theme Layout Weblet #1 – One Column by default if a layout is not selected on the Create WAM dialog.
- If a WAM has not been compiled, if a WebRoutine is opened in the Design View, the web page will be generated using std_themelet1_1col weblet and the fields and lists mapped for output in the WebRoutine.
Note: In this case the web page will not be re-generated when the WAM is compiled unless the Generate XSL – All WebRoutines option is selected. There are more details on this subject in later exercises.
- Once a WAM is compiled, a web page with a WAM specific layout (that you can modify) and field entry controls is generated for each WebRoutine that can be edited in the Design view. You can drag and drop fields and lists marked FOR(*OUTPUT) or FOR(*BOTH) onto your page at any time from the Design view's WebRoutine Output tab.
- Weblets are reusable XSL snippets or components that can be plugged into either your WebRoutine page or other Weblets. There are standard Weblets that encapsulate HTML buttons, hyperlinks, menu items, radio buttons, dropdown lists, etc.
- When viewing a list of available Weblets in Weblet Templates view, you will notice a Weblet with a Description of Push button will also have a Details column showing std_button_v2. Std_button_v2.xsl is an XSL document consisting of one or more <xsl:template> element.
- The Compile options dialog, lets you choose whether or not to re-generate the XSL for existing WebRoutines. By default, a compile will always generate XSL for new WebRoutines ONLY. That is, the web page design for each new WebRoutine is generated automatically.
- The generated web page includes all fields and LISTS in your WEB_MAPs marked FOR(*OUTPUT) or FOR(*BOTH). Fields mapped with a FOR(*INPUT) keyword, are incoming fields to the WebRoutine. They are not available when creating the web page output by this WebRoutine.
- The compile generates a WAM-specific layout Weblet. Its name is WAM Identifier followed by _layout (e.g. iiifirst_layout) where iiifirst is the WAM's Identifier.
- The generated web page also has a Messages (std_messages) Weblet on the page, a WebRoutine description in a heading and a Hidden Content DIV where you may place objects that you do not want to be displayed on the page.
Tips & Techniques
- You can compile from either the LANSA Editor directly, or from the Repository or Last Opened tabs.
- It is not necessary to do a compile to generate the web page, since a build also generates it, but without doing a full compile.
- When compiling, the Generate XSL option always defaults to the New WebRoutines option.
- The Generate XSL All WebRoutines option will generate, or re-generate the XSL for ALL WebRoutines in the WAM and will lose any changes made to the web pages in the Design view.
- You can make a hidden field visible for debugging purposes.
What I Should Know
- How to create a Web Application Module (WAM).
- How to define a WebRoutine.
- How to use a WEB_MAP statement to define inputs and outputs to a WebRoutine.
- How to open the Design view for a specific WebRoutine.
- How to use some of the basic editing features of the Design view.
- What a compile generates.