Ripul
September 4, 2020, 1:26pm
#1
Hi, I am trying to add addDialogComponent dynamically after changing the value in the dropdown.
As of now code is working but it not reflecting, I have to manually minimize and maximize it too see the changes, and also it is updating not adding.
Please suggest
Ripul
September 5, 2020, 7:19pm
#2
Hi All,
Please do reply, it needs to be done in an urgent basis.
gab1one
September 7, 2020, 6:52am
#3
Hi @Ripul ,
You need to call the repaint
method on the Panel of the added Dialogcomponent, to update the dialog window after you have done the changes:
DialogComponentBoolean b = new DialogComponentBoolean(booleanModel, "label");
b.getComponentPanel().repaint();
best,
Gabriel
1 Like
Or you add the dialog component right away and set it visible when needed.
Best
Mark
1 Like
Ripul
September 8, 2020, 4:11pm
#5
Hi Thanks, i just tried this solution but it didn’t work.
Ripul
September 8, 2020, 4:23pm
#6
Thanks for your response, i tried by below code
DialogComponentGridTableOne dialogComponentGridTableOne = new DialogComponentGridTableOne(
new SettingsModelString("Name ", "Table Name "));
dialogComponentGridTableOne.getComponentPanel().setVisible(true);
addDialogComponent(dialogComponentGridTableOne);
didnt worked , still i need to minimise and maximise to see the changes.
Ripul
September 8, 2020, 4:39pm
#7
Hi i tried the below code
addDialogComponent(new DialogComponentGridTableOne(new SettingsModelString("Name ", "Table Name ")));
DialogComponentBoolean b = new DialogComponentBoolean(new SettingsModelBoolean(DemoNodeModel.BOOL, true), "Table Name ");
b.getComponentPanel().repaint();
@Ripul ,
here’s an example how it can be done.
final class ExampleDialog extends DefaultNodeSettingsPane {
ExampleDialog() {
final DialogComponentString diaComp =
new DialogComponentString(new SettingsModelString("foo", "hello world"), "42");
final DialogComponentBoolean visTrigger =
new DialogComponentBoolean(new SettingsModelBoolean("bar", true), "Set visible");
visTrigger.getModel().addChangeListener(e -> diaComp.getComponentPanel()
.setVisible(((SettingsModelBoolean)visTrigger.getModel()).getBooleanValue()));
addDialogComponent(visTrigger);
addDialogComponent(diaComp);
}
}
Best
Mark
2 Likes
Ripul
September 9, 2020, 5:15pm
#9
Hi Mark,
Thanks for your response, can you please update the for DialogComponentStringSelection (DropDown)
and hide and show two text box accordingly.
Thanks a lot for your response again.