Project

General

Profile

Bug #10166

OE Bug: Unpredictable Sorting of Equal Items in Sorted Selection Lists and Combo Boxes

Added by Vladimir Tsichevski about 1 year ago. Updated about 1 year ago.

Status:
New
Priority:
Low
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

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

10166-selection-list-oe.png (4.44 KB) Vladimir Tsichevski, 06/16/2025 04:23 PM

10166-combo-items-oe.png (4.85 KB) Vladimir Tsichevski, 06/16/2025 04:23 PM

10166-combo-pairs-oe.png (4.91 KB) Vladimir Tsichevski, 06/16/2025 04:23 PM

History

#1 Updated by Vladimir Tsichevski about 1 year ago

Warning: This task is for documentation purposes only and outlines the OE behavior, which is unpredictable and should not be replicated in FWD!

Consider this demo example:

CURRENT-WINDOW:WIDTH-CHARS = 100.
DEFINE VARIABLE slSortedPairs AS CHARACTER FORMAT "x(30)" VIEW-AS SELECTION-LIST
    SORT
    INNER-LINES 20
    INNER-CHARS 30
    LIST-ITEM-PAIRS "a",1,"A",2,"a",3,"A",4,"a",5,"A",6
    .

DEFINE VARIABLE slSortedItems AS CHARACTER FORMAT "x(30)" VIEW-AS SELECTION-LIST
    SORT
    INNER-LINES 20
    INNER-CHARS 30
    LIST-ITEMS "a","A","a","A","a","A" 
    .

DEFINE FRAME f slSortedItems slSortedPairs WITH SIDE-LABELS SIZE 90 BY 20.

ENABLE ALL WITH FRAME f.
ON VALUE-CHANGED OF slSortedPairs DO:
  MESSAGE slSortedPairs:SCREEN-VALUE.
END.

WAIT-FOR CLOSE OF CURRENT-WINDOW.

This example sets up two sorted selection lists: one with LIST-ITEM-PAIRS and another with LIST-ITEMS. Both contain items (a and A) that the sorting algorithm treats as equal due to case-insensitive comparison. After sorting, the items appear in reverse order of their initial sequence, which this demo confirms.

However, the displayed item labels don’t match the expected order. We’d expect A, a, A, a, A, a, but the screen shows a, a, A, A, A, a instead. Other users have reported different orders, suggesting this behavior is unreliable.

The same issue pops up with COMBO-BOX widgets, as seen in this demo:

DEFINE VARIABLE cbSortedPairs AS CHARACTER FORMAT "x(30)" VIEW-AS COMBO-BOX
    SORT
    INNER-LINES 30
    LIST-ITEM-PAIRS "a",1,"A",2,"a",3,"A",4,"a",5,"A",6
    DROP-DOWN-LIST SIZE 50 BY 1.

DEFINE VARIABLE cbSortedItems AS CHARACTER FORMAT "x(30)" VIEW-AS COMBO-BOX
    SORT
    INNER-LINES 30
    LIST-ITEMS "a","A","a","A","a","A" 
    DROP-DOWN-LIST SIZE 50 BY 1.

DEFINE FRAME f cbSortedItems cbSortedPairs WITH SIDE-LABELS.

ENABLE ALL WITH FRAME f.
ON VALUE-CHANGED OF cbSortedItems DO:
  MESSAGE cbSortedItems:SCREEN-VALUE.
END.

ON VALUE-CHANGED OF cbSortedPairs DO:
  MESSAGE cbSortedPairs:SCREEN-VALUE.
END.

WAIT-FOR CLOSE OF CURRENT-WINDOW.


Also available in: Atom PDF