Consultor Eletrônico



Kbase 20681: 4GL: Error (4058) running an application window.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   07/12/2006
Status: Unverified

SYMPTOM(s):

Error (4058) running an application window in design mode from the AppBuilder.

**Attribute <attribute> for the <widget id> has an invalid value of <string>. (4058)

**Attribute SCREE-VALUE for the COMBO-BOX cbState has an invalid value of Middlesex. (4058)

The COMBO-BOX is populated programmatically by a procedure call similar to: RUN PopulateComboBox.

The RUN PopulateComboBox procedure call is made after the RUN enable_UI statement in the windows Main Block.

CAUSE:

Error 4058 indicates that the value used for the SCREEN-VALUE is not in the LIST-ITEMS of the COMBO-BOX . In this case, the COMBO-BOX was still empty when the application attempted to dispay it.

FIX:

The the solution is to ensure that the referenced SCREEN-VALUE is in the LIST-ITEMS of the COMBO-BOX. In this case, moving the call to populate the COMBO-BOX before the RUN enable_UI statement eliminated the error because the COMBO-BOX was properly initialized by the time we needed to reference it.
Be aware that if a COMBO-BOX or SELECTION_LIST is used in more than one FRAME and the LIST-ITEMS attribute is modified in one FRAME and the assignment to the SCREEN-VALUE is done in another frame the above error may also occur. In such cases, ensure that the LIST-ITEMS and SCREEN-VALUE attributes are assigned in the same FRAME. For example the following code snippet generates this error in the last statement due to FRAME scope ambiguity:
DEFINE VARIABLE mySelectionList AS CHARACTER VIEW-AS SELECTION-LIST SIZE 10 BY 10.
FORM mySelectionList WITH FRAME FisrtFrame.
mySelectionList:LIST-ITEMS IN FRAME FisrtFrame = "1,2,3".
FORM mySelectionList WITH FRAME SecondFrame.
mySelectionList:SCREEN-VALUE = "1".

The solution is to fully qualify the widget name with its FRAME name as follows in the last statement:
DEFINE VARIABLE mySelectionList AS CHARACTER VIEW-AS SELECTION-LIST SIZE 10 BY 10.
FORM mySelectionList WITH FRAME FisrtFrame.
mySelectionList:LIST-ITEMS IN FRAME FisrtFrame = "1,2,3".
FORM mySelectionList WITH FRAME SecondFrame.
mySelectionList:SCREEN-VALUE IN FRAME FisrtFrame = "3".