AddComboItem - cWebCombo
Adds an item to the combo list
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| sValue | String | The value to return when the combo list item is selected |
| sDescription | String | The value to display for this combo list item |
Syntax
Procedure AddComboItem String sValue String sDescription
Call Example
Send AddComboItem sValue sDescription
Description
Adds an item to the combo list. This should be used in the OnFill event.
Sample
This sample shows how to add 3 items to a cWebCombo control that is not bound to a table column.
Object oFilterCombo is a cWebCombo
Set psLabel to "Filter on:"
Procedure OnFill
Forward Send OnFill
Send AddComboItem "" "None"
Send AddComboItem "NUMBER" "Number"
Send AddComboItem "NAME" "Name"
End_Procedure
End_Object
Use with CodeValidationTable
If you use a cWebCombo or cWebColumnCombo with a CodeValidationTable via a DataDictionary, the default will display the Code descriptions.
Sample
To display values instead of descriptions you can override AddComboItem like this:
Object oOrderHeaderTerms is a cWebCombo
Entry_Item OrderHeader.Terms
Set piColumnSpan to 5
Set piColumnIndex to 0
Set psLabel to "Terms:"
Set peLabelAlign to alignRight
Procedure AddComboItem String sValue String sDescription
Forward Send AddComboItem sValue sValue
End_Procedure
End_Object