Pre-Selecting Dropdown value in Perspective

We have an in-house app that I’m working on shifting over to the Perspective module for better mobile access (and to learn the Perspective layout).

In the vision module you can bind “Selected Value” to a named query, if that result is in the “data” dataset then the Dropdown box will show that selected value.
Specific Example: dropdown called “Status” has 5 different values pulled from a Named Query. “Selected Value” is bound to another named query that pulls the specific status for a device.

If I try to replicate that function in perspective I can’t get the dropdown component to change from the placeholder unless I click on it myself and select a value.

When I click on it and select something I see the props.value go to the right integer value.
if I try to manually input the same integer there the value turns yellow(?) and nothing else happens.
Same thing with a binding - when I select a device the value changes correctly, but the dropdown doesn’t reflect the new value.

Am I missing something, or is there some other way to replicate this ability?


I’m afraid we might need a more detailed breakdown of your setup, as supplying the value of any configured label:value pair for a Dropdown results in the “pre-selected” label being displayed as selected for me.
After supplying options but not setting props.value:

After setting props.value to 1:

I use Named Queries to populate many Dropdowns across several projects - including the props.value property, and I’ve experienced no issues across any recent builds.

I was starting to get some screenshots and I noticed your values were all yellow/orange, while mine were green.
turns out my transform was forcing everything to strings, which then didn’t match up.
I modified the transform to keep the values as int and now it works as expected.


1 Like