Project

General

Profile

Bug #8239

SELECTION-LIST set SCREEN-VALUE regression from trunk rev. 14821

Added by Radu Apetrii 3 months ago. Updated 3 months ago.

Status:
WIP
Priority:
Normal
Assignee:
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

8239.patch Magnifier (5.77 KB) Radu Apetrii, 02/01/2024 10:06 AM

History

#1 Updated by Radu Apetrii 3 months ago

  • Assignee set to Radu Apetrii
  • Status changed from New to WIP

Starting from trunk rev. 14821, there has been a regression with setting SCREEN-VALUE to a SELECTION-LIST. From my investigations, this could have potentially happened to EDITOR and TOGGLE-BOX too.

A small example that raises the error ** Attribute SCREEN-VALUE for the SELECTION-LIST <name> has an invalid value of . (4058) is:

define variable sl as character 
  view-as selection-list
  list-item-pairs "A", "A", "B", "B" 
  size 20 by 20.

define frame f-main sl.
enable all with frame f-main.
do with frame f-main:
    sl:SCREEN-VALUE = "".
    message sl:SCREEN-VALUE.
end.

When working with a SELECTION-LIST, if one tries to set the "" value to the widget, the program actually treats that value as ?. Thus, the correct output of this example is ? and no errors should be raised.

#2 Updated by Radu Apetrii 3 months ago

When doing the changes from trunk 14821 and 14830, I managed to disrupt the workflow of the program when handling a few setScreenValue functions. Because I added another GenericWidget.setScreenValue function, this time with 4 parameters, the call of widget.setScreenValue from GenericFrame.setScreenValue changed from 3 arguments given to 4. This is important when considering the following flow:
  • Before any of my changes:
    • widget.setScreenValue(3 arguments) inside GenericFrame -> SelectionList.setScreenValue(3 parameters) -> ControlSetEntity.setScreenValue(3 parameters) if super is called (in this case it is not, but it could appear in other widgets).
  • With the changes, widget.setScreenValue(3 arguments) became widget.setScreenValue(4 arguments), and ControlSetEntity.setScreenValue(3 parameters) became ControlSetEntity.setScreenValue(4 parameters).
  • After the changes:
    • widget.setScreenValue(4 arguments) inside GenericFrame -> ControlSetEntity.setScreenValue(4 parameters)
    • Note that SelectionList.setScreenValue(3 parameters) is skipped because I forgot to update the function so that it uses 4 parameters. This resulted in some validations being left behind and not being called at all.

This might have happened for EditorWidget and ToggleBoxWidget too as I noticed that I did not do any updates there. I'll post a patch here and wait for some feedback. Also, both the example from #8239-1 and the test from a large customer application work well with the patch.

#3 Updated by Hynek Cihlar 3 months ago

The changes in 8239.patch look good. Please regression-test them.

#4 Updated by Hynek Cihlar 3 months ago

Hynek Cihlar wrote:

The changes in 8239.patch look good. Please regression-test them.

I meant both GUI and ChUI.

#5 Updated by Radu Apetrii 3 months ago

ChUI tests fail. I'm investigating the error right now.

Also available in: Atom PDF