Hello,
We are migrating our application from version 10 (10.2B07) to version 11 (11.3 SP 2).
We notice a difference between the screen-value of a combobox (build with list-item-pairs)
Searching the knowledgebase I came across article 26653 that indicates a different behavior in version 9 and 10.
I didn't find an article about a difference between 10 and 11.
I tried the suggested startup-parameter (scrvalmode), but the behavior stays the same.
Someone who experienced the same behavior ?
kind regards
gerd
The version 11 behavior is correct. When you query the SCREEN-VALUE of a LIST-ITEM-PAIRS combo-box, the AVM retrieves the text of the item selected in the combo-box. In this case, that's an empty string. It searches the list for that string and returns the matching value. That's also an empty string in this case. In previous versions there was a bug in this logic that caused the internal data structure which stores the text of the selected item to be flagged as unknown. The matching value was copied to the same internal structure but the unknown flag wasn't turned off. The AVM now clears the unknown flag when copying the value string so SCREEN-VALUE no longer incorrectly returns the unknown value.
Although I think we have sorted out the behavior of blank items/values, I'd recommend avoiding using them if possible.
It might be helpful if you posted a code snippet showing the problem.
See program in attachment
in OE10 -> screen-value = ?
in OE11 -> screen-value = ""
Thanks Gerd - can confirm it's "" in 11.2.1. And there's no obvious gotchas either. I would say that the "" value is what I would expect based on your setup of the combo.
There have been several bug fixes having to do with items with blank labels or blank values in LIST-ITEM-PAIRS combo-boxes. LIST-ITEM-PAIRS wasn't originally designed to support blank labels/values and we have been trying to make them work in a consistent manner since we discovered that people used them that way. I'll take a look at your example to see why its behavior has changed.
The version 11 behavior is correct. When you query the SCREEN-VALUE of a LIST-ITEM-PAIRS combo-box, the AVM retrieves the text of the item selected in the combo-box. In this case, that's an empty string. It searches the list for that string and returns the matching value. That's also an empty string in this case. In previous versions there was a bug in this logic that caused the internal data structure which stores the text of the selected item to be flagged as unknown. The matching value was copied to the same internal structure but the unknown flag wasn't turned off. The AVM now clears the unknown flag when copying the value string so SCREEN-VALUE no longer incorrectly returns the unknown value.
Although I think we have sorted out the behavior of blank items/values, I'd recommend avoiding using them if possible.
Thanks Matt for the clarification !
Gerd