Project

General

Profile

Bug #8239

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

Added by Radu Apetrii over 2 years ago. Updated almost 2 years ago.

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

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

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

History

#1 Updated by Radu Apetrii over 2 years ago

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

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 over 2 years 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 over 2 years ago

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

#4 Updated by Hynek Cihlar over 2 years 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 over 2 years ago

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

#6 Updated by Radu Apetrii almost 2 years ago

I re-checked this, and it was solved in the meantime. It can be closed.

#7 Updated by Hynek Cihlar almost 2 years ago

  • Status changed from WIP to Closed
  • % Done changed from 0 to 100

Radu, what issue/task branch resolved this?

#8 Updated by Radu Apetrii almost 2 years ago

Hynek Cihlar wrote:

Radu, what issue/task branch resolved this?

It was trunk revision 15114 that fixed the issue.

Also available in: Atom PDF