Browse List selection in WEBEVENT functions

Date:Archived
Product/Release:LANSA for the Web
Abstract:How to configure Browse List selection in WEBEVENT functions
Submitted By:LANSA Technical Support

LANSA for the Web disables the selection image column in browse lists for WEBEVENT functions. This is because WEBEVENT functions terminate as soon as the display command is processed. This means that the function is no longer available to process your selection.

This example shows how to emulate a select browse list. This technique uses two working fields in an RDML function. One of the fields, say, ROWNUM, is used to return the row selected. The value of this field is read to determine the row number selected in the browse list.

This field, ROWNUM, is not declared in the definition of the browse list, i.e. it is not in the DEF_LIST command. It should not even be used in your display command. This field is used to store the value returned from the browser.

The other working field, say TMPFLD, is a temporary field, which sets the HTML to display the selection image. This field, TMPFLD, is used in the definition of the browse list, i.e. it is defined in the DEF_LIST command. This is an output field.

In the function, set the contents of the TMPFLD field for each row in the browse list. For example, to use radio buttons instead of a selection image, the HTML would be:

<INPUT TYPE="RADIO" NAME="SROWNUM" VALUE="rownumber">

Note that the field name is ROWNUM and not TMPFLD. This is because the ROWNUM field should be updated when the user selects a row in the browse list. In addition, the field name is prefixed with S. The prefix character denotes the field type for WEBEVENT functions. If ROWNUM was an alphanumeric field, the prefix character would be A and P if it was a packed field.

The parameter, rownumber, is set programmatically, dependent on the list entry being processed in the RDML function.

In the RDML function, the ROWNUM field is read to determine the row selected by the user.