Hi,
I try to provide a drop down list as an optional widget in my node settings. First question: Should that be possible? If not, I could still use a @ValueSwitchWidget to show or hide my setting.
If yes, let me describe the issue:
I tried the following optional widgets. The first one (string value) works as expected while the second one (enum value) does show the checkbox but nothing else (no matter if checked or not).
@Widget(title = "Optional One", description = "...")
@OptionalWidget(defaultProvider = Opt1DefaultProvider.class)
Optional<String> m_opt1;
static final class Opt1DefaultProvider implements DefaultValueProvider<String> {
@Override
public String computeState(final NodeParametersInput context) throws StateComputationFailureException {
return "optional 1 value";
}
}
@Widget(title = "Optional Two", description = "...")
@OptionalWidget(defaultProvider = Opt2DefaultProvider.class)
Optional<Opt2Enum> m_opt2;
static final class Opt2DefaultProvider implements DefaultValueProvider<Opt2Enum> {
@Override
public Opt2Enum computeState(final NodeParametersInput context) throws StateComputationFailureException {
return Opt2Enum.TWO;
}
}
enum Opt2Enum {
@Label("one")
ONE,
@Label("two")
TWO,
@Label("three")
THREE;
}
When checking the checkbox of the second widget, I get the following error:
ERROR main KnimeBrowserView TypeError: Cannot use 'in' operator to search for 'includeUnknownValues' in TWO (source: https://org.knime.core.ui.dialog/uiext/defaultdialog/dist/NodeDialogApp-sQeR6LBA.js; line: 1267)
ERROR main KnimeBrowserView TypeError: Cannot read properties of undefined (reading 'initResizeHeight') (source: https://org.knime.core.ui.dialog/uiext/defaultdialog/dist/NodeDialogApp-sQeR6LBA.js; line: 1267)
I would be happy if anyone can help.
Antje