Create an Entry with Picklist

Visual LANSA

Create an Entry with Picklist

Now you have set up the structure for any picklists in the property sheet. Next create an entry for the #OPTIONSA data class (Alpha Options) with an associated picklist:

1.

Base the data class for the entry on the elemental data class #PRIM_ALPH:

 

DEFINE_COM class(#PRIM_ALPH) name(#OPTIONSA)
 

 

2.

In the Initialize event of your property sheet add the picklist and create the items for it.  Then create the entry, associate the pick list with it and add the entry to the property sheet:

 

EXECUTE subroutine(ADD_PLIST)

EXECUTE subroutine(ADD_PITEM) with_parms('A' 'option A')
EXECUTE subroutine(ADD_PITEM) with_parms('B' 'option B')
EXECUTE subroutine(ADD_PITEM) with_parms('C' 'option C')
 
CHANGE field(#PROPERTY) to('''Alpha Options''')
* associate the picklist with the #OPTIONSA data class
SET com(#optionsa) picklist(#PL_COL<#Cur_Plist>)
* assign the picklist to the second column
CHANGE field(#VALUE) to('#OPTIONSA.TEXT')
* add the entry
ADD_ENTRY to_list(#PROP_1)
* assign the data class to the entry in the property sheet
SET com(#prop_1.CurrentItem) dataclass(#optionsa)
 

 

The definition of the Alpha Options entry with its associated picklist is now complete.

Ý 6.26.2 Picklists