Consultor Eletrônico



Kbase P129767: SCREEN-VALUE attribute of of a COMBO-BOX using LIST-ITEM-PAIRS is unknown ("?") when a value not in
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/21/2008
Status: Unverified

FACT(s) (Environment):

Windows
OpenEdge 10.1B

SYMPTOM(s):

SCREEN-VALUE attribute of of a COMBO-BOX using LIST-ITEM-PAIRS is unknown ("?") when a value not in the list is typed into the fill-in.

Input is entered from the keyboard into the fill-in portion of the COMBO-BOX.

COMBO-BOX widget defined using LIST-ITEM-PAIRS attribute

COMBO-BOX widget defined using DROP-DOWN option

The keyboard input is not in the drop-down list portion of the COMBO-BOX.

On the VALUE-CHANGED event for the COMBO-BOX, the SCREEN-VALUE attribute is unknown ("?").

On the VALUE-CHANGED event for the COMBO-BOX, the INPUT-VALUE attribute is unknown ("?").

CAUSE:

This is expected behavior for a SIMPLE or DROP-DOWN combo box when the value entered into the fill-in is not an item in the list.

FIX:

Capture keystrokes as they are entered into the fill-in, and use the value obtained instead of the SCREEN-VALUE attribute. The following sample code will capture keyboard input in a CHARACTER variable that can be used elswhere in a program:
DEFINE VARIABLE myComboBoxKeyInput AS CHARACTER NO-UNDO.
ON ENTRY OF myComboBox DO:
ASSIGN myComboBoxKeyInput = "".
END.
ON ANY-PRINTABLE OF myComboBox DO:
myComboBoxKeyInput = myComboBoxKeyInput + CHR(LASTKEY).
END.
Code is also necessary to handle field editing keys such as BACKSPACE; for simplicity this code is not shown.