cscombox box drop down

vexiteer

New Member
I am new to the whole progress development. I am curious if this is possible. I have two combo boxes pulling data from the same table.
If user goes into combox 1 I would like it to set the corresonding value in combobox 2 and vice versa. This doesn't seem like a hard thing.
 

walkeryan

Member
No it really isn't.
If you have both combo boxes populated with the same information then on the "value-changed" trigger of the first combo box set the screen-value of the first combo box to the second.
Ex.

ON "value-changed" OF comboBox1
DO:
comboBox2:SCREEN-VALUE = comboBox1:SCREEN-VALUE.
END.

Just reverse the values for the second combo box and put it in the comboBox2 value-changed trigger.
Enjoy.

Toss me some rep if you want and good luck with Progress
 

vexiteer

New Member
No it really isn't.
If you have both combo boxes populated with the same information then on the "value-changed" trigger of the first combo box set the screen-value of the first combo box to the second.
Ex.

ON "value-changed" OF comboBox1
DO:
comboBox2:SCREEN-VALUE = comboBox1:SCREEN-VALUE.
END.

Just reverse the values for the second combo box and put it in the comboBox2 value-changed trigger.
Enjoy.

Toss me some rep if you want and good luck with Progress


Thanks for your reply,

Here is my issue combox1 and combox2 hold different data like for instance combox1 will be a code like "123" and combox2 with be the description of that code like "test entry" so 123 description is test entry. If a user enters in 123 then I would like the description populated automatically and vice vera if the user selects test entry in the description combo box then I would like the code automatically populated. I have tried putting both values in the same combo box but don't think this will work out of me when I need to assign the values to a varialble and from there into a temp table.
I just think this can be down or am I crazy new progress programmer.
 

walkeryan

Member
Thanks for your reply,

Here is my issue combox1 and combox2 hold different data like for instance combox1 will be a code like "123" and combox2 with be the description of that code like "test entry" so 123 description is test entry. If a user enters in 123 then I would like the description populated automatically and vice vera if the user selects test entry in the description combo box then I would like the code automatically populated. I have tried putting both values in the same combo box but don't think this will work out of me when I need to assign the values to a varialble and from there into a temp table.
I just think this can be down or am I crazy new progress programmer.

Well in this case, you could use list-items for one combo box and list-item-pairs in the second to store the ids behind the description. Just a suggestion.
 

vexiteer

New Member
Not sure I follow how to add the id's behind the description. I have tried using the item pairs but i thought was for list like a,1 b,2 etc not sure how to put the table names in the item pairs or is that even possible.

Thanks.
 

walkeryan

Member
Not sure I follow how to add the id's behind the description. I have tried using the item pairs but i thought was for list like a,1 b,2 etc not sure how to put the table names in the item pairs or is that even possible.

Thanks.

No, if you know what :pRIVATE-DATA is, it's basically the same as the List-item-pairs only for combo boxes and selection lists, etc. It displays the first value that you add and hids the second value behind. Say you want to show an employees name but you want their employee ID stored behind as well.

Using list item pairs:
ComboBox1:Add-Last(Employee.EmployeeName , Employee.EmployeeID).

Now when you use ComboBox:Screen-Value to get the value out you will retrieve the employees ID, not their name that the user is seeing.

Using List-Items:
ComboBox2:Add-Last(Employee.EmployeeName).

***Notice there is no comma because its only list-items, the comma seperates the two values so progress know which is the displayed, and which is the hidden on you can reference with SCREEN-VALUE.***

So when you go to Call, or assign the Values of those combo boxes you will get:
string1 = ComboBox1:ScreenValue.
string2 = ComboBox2:ScreenValue.

string1 will display the employees ID, altho the user couldn't see it.
string2 will display the employees Name because its list items, not pairs, so it will show you the data the user sees.

The reason for List-Item-Pairs is the keep users from seeing private data that you dont want them to see but still gives your program access to it to use on querys, lookups, etc.

Also MAKE SURE, your comma is not in quotes or it will interpret it as a string and display it all.

Good luck.
 

vexiteer

New Member
Thanks for your suggestions this helped me figure it out. I ended up making both comboboxes list items pairs so that I could assign the screen values from both combo boxes to variables.
 
Top