Combo Box - DataClass Property

Reference to a repository field or fundamental product data class used to control data entry

Member of Combo Box (PRIM_CMBX)

Data Type - PRIM_DC - Data class base class

Details

The DataClass property allows the default behavior of an edit to be overridden by the behavior of a repository data class.
 
By specifying a data class the edit will now follow the data entry rules for the field e.g. its type, length, decimal places etc.
 
The edit area of a combo box is a normal edit, and therefore has no formatting or length checking. Defining a data class results in a new variable that will be used for the data entry.

Example

In this example, a numeric data class is used to ensure that all values entered are numeric, despite the column in the combo box being defined as alphanumeric.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Height(271) Left(308) Top(220) Width(264) Clientwidth(248) Clientheight(232)
 
   Define_Com Class(#PRIM_CMBX) Name(#Combobox) Autoselect(False) Autoselectitem(False) Displayposition(1) Left(16) Parent(#COM_OWNER) Tabposition(1) Top(16) Value('ABCDE') Width(217) Height(33) Fixedheight(False) Dataclass(#NumberDataClass)
   Define_Com Class(#PRIM_CBCL) Name(#CBCL_1) Displayposition(1) Parent(#Combobox) Source(#xDemoAlpha128)
 
   Define_Com Class(#xDemoNumber) Name(#NumberDataClass)
 
   Evtroutine Handling(#Combobox.Enter)
 
      #xDemoAlpha128 := #NumberDataClass.Asstring
      Add_Entry To_List(#Combobox)
 
   Endroutine
 
End_Com

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2