Consultor Eletrônico



Kbase P101031: COMBO-BOX returns wrong SCREEN-VALUE and INPUT-VALUE values in OE10
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/6/2006
Status: Unverified

FACT(s) (Environment):

OpenEdge 10.x

SYMPTOM(s):

COMBO-BOX doesn't return the correct value for SCREEN-VALUE

COMBO-BOX doesn't return the correct value for INPUT-VALUE

The problem occurs when one of the following action is performed:

Initializing the SCREEN-VALUE before widget is realized

Typing in the value for the COMBO-BOX

Using LIST-ITEM-PAIRS COMBO-BOX.

You get the correct value for SCREEN-VALUE and INPUT-VALUE when clicking on a list item.

CAUSE:

This is a known issue being investigated by Development

FIX:

Use the combo as LIST-ITEM and keep the parity list in a separate Temp-Table with two fields. Referring to this TT still give you the chance to simulate the LIST-ITEM-PAIRS combo-box behavior. This is the relevant code:

/* Defining the Temp-Table and populating it*/
DEFINE VARIABLE myListItemPairs AS CHARACTER NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
myListItemPairs = "France, FR,Suisse, CH,Etats unis, EU,Grande Bretagne, GB,Canada, CA,Bahames, BA".
DEFINE TEMP-TABLE ttNations
FIELD cName AS CHAR
FIELD cID AS CHAR.

DO i = 1 TO (NUM-ENTRIES (myListItemPairs)) / 2 :
CREATE ttNations.
ASSIGN
cName = ENTRY ( 2 * i - 1 , myListItemPairs )
cID = ENTRY ( 2 * i, myListItemPairs ).
END.
/* Using the Temp-Table to simulate a LIST-ITEM-PAIRS combo-box behavior. */
FIND FIRST ttNations WHERE cName = COMBO-BOX:INPUT-VALUE NO-LOCK NO-ERROR.
IF AVAIL(ttNations) THEN
DISPLAY ttNations.cID.