12.16 Extend LANSA Drop Downs

LANSA provides you with two choices with visualizing your fields as drop downs. You can either visualize the field as a Visual Web component or the field can be defined to be a LANSA drop down in your LANSA Repository.

If your field is defined to be a LANSA drop down in your repository, LANSA will automatically visualize the field as a drop down. LANSA drop downs are useful when the data to populate the drop down is dynamic. Visual Web components are useful when the data is fairly static in nature.

When you compile your function, the LANSA drop down fields are identified as <RDML MERGE=”&DD<name>” FIELD=”<field>”> in the generated HTML.

LANSA allows you to extend the drop down in a number of ways. You can choose to:

The syntax to extend the LANSA drop down is:

<RDML MERGE="&DD<name>" FIELD="<field>" OFFSET=<position>" SPLIT
SIZE=<size>>

By default, you are unable to apportion the drop down data into its VALUE and description parts. For example, the drop down data was “ADMAdministration”, this will be displayed in the drop down. The same value is also returned to your program.

LANSA allows you to apportion the value of your drop down data. In the example above, you may want “ADM” to be returned as the VALUE to your program, but only display “Administration” in the drop down. You can achieve this by editing the RDML tag and extending the tag.

The OFFSET keyword instructs LANSA to start from the offset position when displaying the drop down data. In the example above, you may only want to show “Administration” in the drop down, without the department code, “ADM”. In this case, the offset position would be 4.

If you only extend the RDML tag by specifying the OFFSET keyword, the value returned to your application would be the drop down data. In the example, this would be “ADMAdministration”.

You can only use the SPLIT keyword if you specify an offset. If the SPLIT keyword is specified, the value returned to your application will be the VALUE portion of the apportioned data. In the example above, if the SPLIT keyword were specified, “ADM” is the value returned to your application. “Administration” will be the portion displayed to the user.

If you specify the SIZE keyword, you can convert the drop down into a list box. The size attribute determines the size of your list box. For example, if you specify SIZE=4, the LANSA drop down field will be visualized as a list box, with the size of the list box set to be 4 entries deep.