Here's how you can invoke a WEBEVENT form from a WAM form:
This function can be called the same way HandleEvent() function is called now.
document.LANSA.SEARCH.onclick = "HandleWebEvent('MYPROC', 'MYFUNC', null, 'WEFrame', 'ASURNAME', 'ASTDRENTRY')"
3. The parameters are HandleWebEvent(Process, Webevent, Form, Target, "ASURNAME", "ASTDRENTRY", ...), a variable number of parameters on the end can be passed for fields, the values of which are to be passed to the WebEvent. The parameters are all characters strings except for Form, which should be the actual form DHTML object (e.g. document.MYFORM). It is important to provide a single character prefix before the field name. The prefix is A for Alphanumeric, P for Packed and S for Signed fields, or Q for RDMLX fields. This prefix is required so that a WEBEVENT being invoked is able to exchange the passed field values.
5. As a result, a WebEvent LANSA function is executed passing the specified field values and a WebEvent page is shown in the Target Navigation panel (std_nav_panel), window, or your own <iframe> or <frame> HTML element.
How a WAM form can initiate a WEBEVENT form and pass information to it.
Consider a Search WAM form, which submits to a Browse WEBEVENT, but passing the entered SURNAME field value, and shows the result in Navigation panel (std_nav_panel) below the Search button.
1. In the LANSA Editor, drag and drop Navigation panel (std_nav_panel) weblet onto the page, as shown below, and enter 'WEFrame' for its name property. Select yes for its size_panel_to_content property, so that it resizes itself to full size of the WEBEVENT page it navigates to.
2. Click on the Search button and enter 'HandleWebEvent("MYPROC", "MYFUNC", null, "WEFrame", "ASURNAME", "ASTDRENTRY"); return false;' for the presubmit_js property of the Search button.
3. When you run this page in the browser, clicking on Search button will submit to a WEBEVENT, showing its page in the Navigation panel (std_nav_panel) weblet, on the same page.