Expand my Community achievements bar.

SOLVED

Drop Down List Bound Item Help

Avatar

Former Community Member

In my drop down list I have many different time zones and they are all binded to the UTC offset number. The problem is is that when I click a time zone (for instance Russia), it reverts back to the time zone preceding it alphabetically with the same UTC offset. This is problematic because many different countries share the same UTC offset (it is -14 to 14).

I am wondering if there is a way to stop the drop down list from automatically changing to a different time zone that has the same offset or if there is a way to go into the drop down list and add all the offsets as variables.

I am new to JS so if possible phrase it for a beginner. I have never used livecycle before but am familiar with C++ and Java and am having a hard time adjusting. With all of the resources out there it is hard to find a good place to get a solid background in livecycle so if anyone has any recommendations on good reference material I would be interested in that as well.


Thank you.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The issue is that the bound value represents the value of the object, so that it will always display the first display item that matches the bound value.

We know from one of the LC Designer methods, setItems(), that Adobe will at some point in the future allow us to bind multiple bound values to a dropdown object. However for the time being you can only have a single bound value.

But there is still a workaround. If you set the bound values of the display items to include the country. So for example for a display item "Russia", the bound value would be "Russia, -14 to 14".

This is a unique value in the dropdown, so it will solve the current problem.

The last step would be to parse out the parts of the bound value, so that you get to the UTC offset, which you can then use in your script.

There is an example here: http://assure.ly/HjRnIN.

Hope that helps,

Niall

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Hi,

The issue is that the bound value represents the value of the object, so that it will always display the first display item that matches the bound value.

We know from one of the LC Designer methods, setItems(), that Adobe will at some point in the future allow us to bind multiple bound values to a dropdown object. However for the time being you can only have a single bound value.

But there is still a workaround. If you set the bound values of the display items to include the country. So for example for a display item "Russia", the bound value would be "Russia, -14 to 14".

This is a unique value in the dropdown, so it will solve the current problem.

The last step would be to parse out the parts of the bound value, so that you get to the UTC offset, which you can then use in your script.

There is an example here: http://assure.ly/HjRnIN.

Hope that helps,

Niall

Avatar

Former Community Member

That looks like a great solution to the issue I am having.

It brings me to another question though, I cannot get it to work because I am unfamiliar with the hierarchy tab on the left and I notice it goes:
Page 1

     Header

     aspects

When I put the code in, I only get one box "Aspect 1" and it does not contain the value of the time zone selected from the drop down box. Can you point me in the direction of some reading that explains the hierarchy and how I can change it to use this code? Or briefly explain it to me.

Thanks,

David

Avatar

Level 10

Hi David,

For starters it is worth getting your workspace set up to show the most commonly used palettes. For example the hierarchy palette (5) is used very often:

LC Designer Workspace.png

You will also need to increase the height of the Script Editor (5), as this is where you insert script into the various events of an object.

In the example posted above, the script is in the exit event of the dropdown. This separates out the bound value, by splitting it into an array at the ",". This will create an array of ["Russia", "-14 to 14"]. You can disregard the first item in the array and just use the second item.

In your case, you do not need to use the "Aspect" subforms or script. These are just in the example, to highlight the behaviour.

Hope that helps,

Niall