4 9 Considerations for WEBEVENT Functions

LANSA Web Functions

4.9 Considerations for WEBEVENT Functions

Following are some important considerations when creating WEBEVENT functions:

  • You cannot call WEBEVENT functions from a process menu. You must not use the PROCESS keyword in your URL syntax. Since WEBEVENT functions terminate as soon as a DISPLAY or REQUEST command is executed, the LANSA job is terminated.
  • You must call WEBEVENT functions directly. You must use the PROCFUN keyword in your URL syntax.
  • Navigation between WEBEVENT functions can be handled by User Keys and Keywords.
  • If you are creating the function links manually, you should use the HandleEvent JavaScript function to process the call instead of using an anchor block (<A HREF>) tag. The HandleEvent function redirects the request to the same Web job at the Data/Application Server whereas the anchor block request starts a new Web job.
  • If you use navigation by using an HTML <A HREF=URL> , no data will be passed to the called WEBEVENT function.
  • WEBEVENT functions must not use commitment control as each function is effectively a new job. This style of application does not cater for database cursors.
  • WEBEVENT functions cannot use function keys such as Exit, Cancel, Add, Change, Delete, Prompt, etc. because the function has already terminated.
  • You must check the STDHEADER page you are using for your WEBEVENT function. All function keys must be enclosed within an <RDML BUTTON> LANSA tag. If a function key does not have an RDML BUTTON tag, you will need to enclose these function keys with a pairing of <RDML BUTTON="&WEBEVENT"> and </RDML> tags. Your header should have no function keys, i.e. no buttons.
  • WEBEVENT functions expect to have only one REQUEST or DISPLAY screen used per function. This does not mean that you cannot have more than one REQUEST statement, but simply that in the flow of logic only one statement should be encountered. A compiler warning message may be displayed if more than one REQUEST or DISPLAY is used in the function.
  • There will be RDML executed after the REQUEST or DISPLAY. The WEBEVENT function will terminate after the DISPLAY/REQUEST command is executed. No other logic will be executed after the HTML page for the function is sent. A compiler warning is issued if statements are encountered after the REQUEST or DISPLAY.
  • Do not use DISPLAY or REQUEST or POP_UP commands in a subroutine. These commands are not allowed in subroutines for *WEBEVENT functions.
  • Output fields are not exchanged between WEBEVENT functions. When the linked function is called, all form variables, hidden fields and any browse list data will be exchanged to the called function.
  • If you are using browse lists, the lists should match exactly in the calling and called WEBEVENT functions so that the data is passed properly.
  • Check that your INSERT or UPDATE or other validations commands do not use *LASTDIS.

 

 

WEB003 - Coding WEBEVENT Functions