Dynamic Disable Property Based on Checkbox in Xperience by Kentico Widget

2024/10/04 7:02 AM

I have two properties in my Xperience by Kentico widget:

  1. CheckBoxComponent:
    [CheckBoxComponent(Order = 11, Label = "Set same settings as Desktop for Tab")]

  2. NumberInputComponent:
    [NumberInputComponent(Order = 13, Label = "Slides To Scroll", Disabled = true)]

I want to dynamically set the Disabled value of the NumberInputComponent based on the CheckBoxComponent. If the checkbox is true, then the NumberInputComponent should be disabled, and if it's false, the NumberInputComponent should be enabled.

How can I achieve this in Xperience by Kentico?


Environment

Answers

2024/10/04 2:25 PM

You could use a configurator to dynamically change values, properties, visibility conditions, and validation rules for a widget property. I'm not sure if this allows you to change the disabled/enabled status.

You could also add a visibility condition which could show/hide the field based on value of a preceeding property.

If those don't solve your issue then you'll need to make a custom UI Form Component which could toggle between enabled/disabled using a configurator.

To answer this question, you have to login first.