Configuration Page, Interactive Disable/Enable?

I’m trying to build something on my settings page similar to the Redudancy/Network Settings category.


I can set the enabled/disabled status of my text field (to test I’ve been using a validator), but how can I make it real-time interactive?

Here’s what I’ve got at the moment:

    public static final BooleanField UseDefaultDataPath = new BooleanField(META, "usedefault_data_path")
            .setDefault(true);
    public static final StringField DataPath = new StringField(META, "data_path")
            .setDefault("");

    static {
        UseDefaultDataPath.addValidator(new SValidatorI() {
            @Override
            public void onValidate(SFieldMeta sFieldMeta, SRecordInstance sRecordInstance) throws SException.Validation {
                if (sRecordInstance.getBoolean(UseDefaultDataPath))  {
                    DataPath.getFormMeta().setEnabled(false);
                } else {
                    DataPath.getFormMeta().setEnabled(true);
                }
            }
        });
    }

Do you find the solution ? I try to achieve exactly the same behavior

Nope, never found a solution.

perhaps @PGriffith has one ?

I'm pretty sure you'll have to use a custom RecordEditForm to include the methods a dynamic operation requires. It's Wicket. It's dying. (Gone in 8.3.) Nobody wants to touch it.

Ok I see, I was hoping anything more straighforward in 8.1 for this common usecase.

We have a React-based RecordEditForm alternative that's used in a few pages in the current 8.1 gateway, but as far as I know, it's not published anywhere, or if it is, there's no public usage examples, so good luck untangling that.

I would definitely recommend simply dropping the requirement for now.

Thanks for the clarification. It will stay as it.