Indirect Property Binding

How do I create an indirect property binding? For instance, I have properties value1, value2, and selectedValue. I want to essentially “select” value1 or value2 to display using an indirect property binding with selectedValue.

I see the property() expression function but sadly it’s Perspective only. In Perspective it would be:

property("Root Container.value"+toStr({selectedValue}))

I’ve over-simplified this but the solution would be the same

Use either the case() or switch() expression functions. If only two choices, consider just using if().

Vision doesn't expose generic runtime property creation so your choices should all be present. (Runtime prop creation is possible, but not easy or supported. Except for Classic Chart datasets.)

Really not sure exactly what you are looking to do but the case statement should work for you.

@MMaynard

Yes, switch/case would work. I do actually have 10 options, so I was hoping for a simpler solution than the large switch/case. Guess not

If you can give us a bit more context we could come up with more elegant solutions.

Is this perspective or vision?

How are you choosing which value to use?

Vision. The selectedValue is bound to a tag. There are 10 different value properties (value1value10)

I'm adding property() for Vision to my Integration Toolkit to-do list.

3 Likes

Are the values closely related? Could you instead have a single dataset property and then use the lookup() expression?

3 Likes

If your referencing entire tab strip datasets, put them in vision client tags.

If you can get the tags all in the same folder you could then just use standard indirection on the control based off of the value of the selectedItemTag.

Create a custom property bound to the value of the SelectedItemTag and then reference it in the indirect binding.

IE.

SelectedItemTag = ‘Value1’

Bound indirect on the control

1 Like

Not talking about tag bindings here.

1 Like