Page 1 of 1

Display Choice option (combo box)

Posted: Fri Nov 06, 2015 4:38 am
by Tracker
Hello,

I have a combo box which permits to choose a country.

Below the table who contains the country list :

ISO Country
Code Name
---- -------
US USA
FR France
IT Italia

My RPG program needs the ISO code and the user have to see only de country Name (not the code).
How to see only the Name and return only the code ?

Re: Display Choice option (combo box)

Posted: Fri Nov 06, 2015 6:11 am
by dieter
Hi,

i Think the solution is quite simple: The combo box has the attributes "choices" and "choice values". If you use a database driven selection there are the attributes "choice options field" and "choice values field". You have to use both fields (choices and values). Choices contains the data the user sees. Values contains the keys which are given to your RPG program. The bound field in your rpg program has to work with the values variable (eg. char(2)). It does not matter that the string which the user sees, is longer. That is not important for your rpg program.

I hove, my explanation is helpful.

Dieter

Re: Display Choice option (combo box)

Posted: Fri Nov 06, 2015 7:53 am
by Tracker
I would like that after clicking on the choice option ,the combo box displays option that choosen .not choice value .problem is not the length .

Re: Display Choice option (combo box)

Posted: Fri Nov 06, 2015 8:59 am
by dieter
Ah,i think now i understand your problem. You want that after the user has selected a value the option (long text) should be visisble in you combo box field. If this is correct, i think, a combo box is the wrong widget. If you use a drop down box you can have this behaviour. In a drop down box the user always sees the option text. In the background the value key is sent to your rpg program.

I think, the idea behind a combo box is, that the user can directly type the key. If he does not know the key he can select the key from the choice listing (long textes). It is normal that the selected value is a key, not the choices text.

Try a drop down box.

Dieter

Re: Display Choice option (combo box)

Posted: Fri Nov 06, 2015 11:00 am
by Scott Klement
I agree with Dieter. A combo box is the wrong widget for what you're trying to do. Since the combo box lets the user type any value (even one that's not in the drop-down list) it has to be able to show the actual values returned to the RPG program.

I think you probably want the regular "drop down" widget (aka select box widget).

Re: Display Choice option (combo box)

Posted: Fri Nov 06, 2015 1:02 pm
by Tracker
Thank you .I'll use drop down box.