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);
}
}
});
}