Modify the (ok) configuration of a developing node

#1

How to program the OK button of configuration of a node (in development), to validate some components that I need to validate before it is executed.

0 Likes

#2

When you click on OK (or Apply), the #configure() method of the NodeModel is called, so you can almost certainly (without knowing the details of what you want to do!) do what you want there.

Steve

3 Likes

#3

You can also override the saveAdditionalSettings() method in the NodeDialog, if you want to perform your validation before the settings are saved to the node. By throwing an exception in that method, you can prevent a user from configuring a node with an illegal value.

best,
Gabriel

2 Likes

#4

Thank you very much, I tried it and I think it is the best option.
Taday

0 Likes

#5

Hello, when programming the method saveAdditionalSettings (), I can validate using Execptions and I show a JOptionPane to inform the user of the error, but in doing so the dialog window closes.

  • I would like to know if in some way you can keep the dialog window open until the user fixes the incorrect parameters?
  • I already try creating the dialog window again but it does not work for me, what can I do?
0 Likes

#6

If you throw InvalidSettingsException in the saveAdditionalSettings(), does that prevent the settings dialog from closing?

Steve

2 Likes