neutrino36
(neutrino neutrino)
#1
How can I get the OK button in Cuba?
I want to set it visible(false) inside an if condition.
I’ve tried in onInit
Button commitAndCloseBtn = ((Button) getWindow().getComponent("windowCommitAndClose"));
System.out.println("ssss" + commitAndCloseBtn);
but returns null.
Best Regards,
-n
Pinyazhin
(Roman Pinyazhin)
#3
Hello,
windowCommitAndClose
is the id of the action, not a component’s id. Just define an id attribute for this button.
Or you can try this:
@Subscribe
public void onInit(InitEvent event) {
Action action = getWindow().getAction("windowCommitAndClose");
action.setVisible(false);
}
neutrino36
(neutrino neutrino)
#5
Thank you!
You made may day.