Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Droplist with duplicated multiple bounded values - LC Designer ES3.5

Avatar

Level 2

Hi,

I'm trying to set (via js on the "Change" event) the value of text field (called "txtClientCurrency") with the selected item's bounded value in a droplist (called "droplistClientCountry").

temp_objects_1.png

The droplist contains the counteries and the binded values contains the currency code (e.g., SAR, EURO, US, etc...) and as you can imagine, some currencies are used by more than one country.

When I select, for example, "United State" from the droplist, the txtClientCurrency field is set correctly to "USD".

temp_selection_2.png

However, the droplist shows that the items I selected is "Ecuador"?!?

temp_result_3.png

I used the follwoing simple JScript to automate set value of the Currency edit box:

temp_script_4.png

What's the reason and how to avoid such behaivor?

BR,

Yasser

2 Replies

Avatar

Level 10

Hi Yasser,

That seems to be the way the dropdownlist (and the listbox) work, they need to have a unique bound value.  To avoid this you need to make the bound value unique but how depends on how it is popuplated in the first place.  Are they bound to a data source or populated in code.  If bound you could try having a hidden dropdownlist just for the currency code, set "specify item values" and match the two by their bound value.  If the dropdownlist is populated by code then maybe the bound value could be something like "United Stats_USD" and then when you populate txtClientCurrency you can use this.boundItem(selectedItem).split('_')[1].

Regards

Bruce

Avatar

Level 2

Hi Bruce,

Yup...I think this the way to go.

Maybe Adobe should look at this, because in real life, you could have one to many relationship between bounded values and selection items (like the countries/currency list)

Again,  thanks for the hel 🙂

BR,

Yasser