Boolean set/reset for "Enable" in perspective change script

Good Morning,

I want to add a change script to a dropdown menu that locks the selection when certain conditions are met. I think the best way to do this is to disable the dropdown and re-enable it when a reset button is pressed.

Here’s the pseudocode for what I’m trying to achieve:

If combination_valid = true, then dropdown_enable = false
Else if reset = true, then dropdown_enable = true and set to required value

I did have an attempt to write it but could not get it working correctly. Any help would be great. I am not sure on how to address the bit in the script e.g self.something.something...

Here is an image of the dropdowns
image

Thanks,
Ryan

You should just be binding to the enabled prop with an expression binding. Scripts should be a last resort.

Just add your conditions, no need for an if.

Eg

{view.custom.cond1} &&
{view.custom.cond2}  
4 Likes