QuickStart Combo Box

LANSA WAM

QuickStart - Combo Box

Each entry in a combo box is defined by an entry in a working list or a set of items hardcoded in the combo box properties.

If you use a working list:

To use a working list to define the dropdown options, you need to create a webroutine that specifies a field to store the selected value and the working list of options in the WEB_MAP. When you open the XSL generated for the webroutine in the LANSA Editor:

1.  If the working list was not *HIDDEN on the WEB_MAP a default table representation of the working list will be included on the web page. Delete the table that visualizes the list. To do this, right-click in the list and select Delete Entire List from the pop-up menu.

2.  Click on the Weblets tab, select Standard Weblets from the drop-down list near the top and locate the Combo Box weblet.

3.  Drag the Combo Box weblet onto the field to store the value and release the left-mouse button. This will display with dropdown options.

4.  Click on the weblet to review the Details tab. Notice that the name and value properties have been set to indicate the field you dragged the weblet on to. The value property indicates that on presentation of the web page any value currently in this field will be used to set the selected drop down entry. When the drop down value is changed the appropriate value will be place in the field nominated on the name property – in this case the same field.

5.  Change the listname property to the working list passed on the WEB_MAP. The combo box representation should immediately change to represent the working list.

6.  Set the codefield and captionfield properties to the appropriate fields from the working list.

If you use the items property:

To use a set of items hardcoded in the combo box properties, you would need to create a webroutine that specifies a field in its WEB_MAP. When you open the XSL generated for the webroutine in the LANSA Editor:

1.  Click on the Weblets tab, select Standard Weblets from the drop-down list near the top and locate the Combo Box weblet.

2.  Drag the Combo Box weblet onto the field to store the value and release the left-mouse button. This will display with dropdown options.

3.  Click on the weblet to review the Details tab. Notice that the name and value properties have been set to indicate the field you dragged the weblet on to. The value property indicates that on presentation of the web page any value currently in this field will be used to set the selected drop down entry. When the drop down value is changed the appropriate value will be place in the field nominated on the name property – in this case the same field.

4.  Set up the list of items to be used as drop down options by selecting the ellipses button on the items property. Proceed to define the require entries for the drop down.