Programmatically Control Visibility of Custom Components Groups in IDE

Let’s say I have a custom component called something like textbox_with_error_handeling

I add a few custom properties that can be grouped together in something called “Numerical Constraints”

The constraints are:
enforce_numerical_constraints of type bool
range_start of type number
range_end of type number

I’d like the ability to control if the range_start and range_end properties are greyed out or not, according to IF the enforce_numerical_constraints type is True. That way I don’t get into funky states, and if I have mutually exclusive sets of property groups, I don’t have inputs in them, such as if I had a enforce_string_constraints checked as well as the enforce_numerical_constraints also checked.

I’m adding a short gif to showcase more of what I’m talking about:
stuff

The corresponding components on the form usually have an enabled property, that you can use, to grey them out on the form. (Radio Button text doesn’t gray out, like it should, but you can code that up yourself.)

If you’re talking about greying them out in the Properties pane, that’s a different story. There is no facility there for disabling a property, conditionally or otherwise:

Are you asking for one?

1 Like

You can create an enabled property on the custom component and then use that to set the enabled property of those other components with the @property decorator:

1 Like

Hey thanks for taking the time to respond. I appreciate it

" If you’re talking about greying them out in the Properties pane , that’s a different story. There is no facility there for disabling a property, conditionally or otherwise:"

Yes, I am talking about the ability to disabling a property in the Properties Pane for custom components. Doing it conditionally.

I get maybe Anvil doesn’t want to open up the IDE completely, as that’s kinda their bread and butter, but it would be nice to have some programatic access to this part.

Of course if they want to open up the IDE, that would be super swell as well, maybe some kind of api…

:slight_smile:

Not quite what I was looking for, but thanks anyway!

Unless misunderstanding you, this will work if you’re add the property to the custom component – those all appear in the IDE panel. To make it useful and see the effect is why you need the property decorators.

Hey, sorry, I’m still not following. Can you drop a demo app showing what you are talking about? I’m talking more about enabling and disabling custom property groups in the IDE based off conditional logic.

So you want to write code that checks a custom bool property in the IDE?

Can you share what you’ve tried, cause I don’t know what you mean.

We used to have an example of this in the classic IDE.

if you add a DropDown toggling on/off include_placeholder toggles the placeholder text field.
But we haven’t added support internally for this in the new IDE.
So there’s currently no API surface to expose.

I’ll add it to our list.

1 Like

Yay! I’m super stoked for this.