Example 2 - Simple Dynamic Picklist

Create a reusable part called FLDVIS02 using the source code following.  This is will provide picklist contents for DEPTMENT:

Function Options(*DIRECT)

Begin_Com Role(*EXTENDS #PRIM_OBJT *implements #Prim_dc.iDynamicPicklist)

Mthroutine Name(Load) Options(*redefine)


Select Fields(*all) From_File(Deptab)

#Picklist.Add( #Deptment #Deptdesc )





Use the option to add a dynamic picklist.  From the prompter, select FLDVIS02.

The following code will be added to the visualization source code:

Begin_Com Role(*Dynamic_Picklist #FLDVIS02) Name(#DynamicPicklist)


Begin_Com Role(*Visual #PRIM_EVPL) Name(#VisualPicklist) Appearance(DropDownList) Componentversion(1) Height(19) Width(209)


As with all picklists, dynamic or static, the NoMatchAction property needs to be set to determine what in the event of the underlying field value not being found in the picklist.  For most situations, ShowValue is probably the best choice.

The new Visual_host reusable can now be used as follows:

Define_Com Class(#Deptment.VisualPicklist) Name(#...)