Page 1 of 1

Database Driven SelectBox order

Posted: Fri Jun 08, 2018 3:21 pm
by Wayne C.
This seems like a no-brainer, but I can't figure it out. Cannot get the choices for a dropdown list to come out in sorted (alphabetical) order.

choices database file: CHGCOD
choices options field: CHCD21
choices values field: CHCD21

order by: CHCD21

The choices seem to be displayed in random order. Am I missing something?

Re: Database Driven SelectBox order

Posted: Fri Jun 08, 2018 5:48 pm
by Scott Klement
To try to help you, I created my own table named CHGCOD using the following SQL statements:

Code: Select all

create table SKTEST/CHGCOD (
 CHCD21 char(10)          
)

insert into chgcod values
('ZZZZZZ'),              
('BBBBBB'),              
('111111'),              
('999999'),              
('AAAAAA')               
As you can see, the values aren't sorted in any particular order, and I did not specify any order on the table itself. Then, in Genie I added a dropdown like yours:
dropdown_properties.png
dropdown_properties.png (52.1 KiB) Viewed 1599 times
When I view it, the options are displayed in the sorted order:
dropdown_result.png
dropdown_result.png (9.01 KiB) Viewed 1599 times
I'm not sure how to help further, since I can't seem to recreate the problem. Can you tell me what I did differently?

Re: Database Driven SelectBox order

Posted: Mon Jun 11, 2018 12:22 pm
by Wayne C.
Thanks Scott for your response.

Re: Database Driven SelectBox order

Posted: Wed Jun 13, 2018 4:46 pm
by Scott Klement
Wayne... is the problem solved? I'm not sure where this stands, since I didn't seem to have the same problem you did. Do you still need help, here?