Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Repaint screen on useraction
Hi,
I'm new to vaadin, so this is probably a simple question, but I don't see the answer.
I have Panel, with a gridlayout. On that panel are radiobuttons (OptionGroup). Depending on the selected button a part of an other gridlayout, included in the first gridlayout, should be shown or not.
I added a listeren to the optiongroup to repaint the screen, but it doesn't work. A snippet of the code is:
optiongroup.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
getApplication().getMainWindow().requestRepaintAll();
}});
So on an useraction, the screen should be changed. Any suggestions how to do this?
Thanks in advance,
Jolanda
You should never need to explicitly call repaints when doing basic Vaadin UI programming.
What you need to do in your optiongroup listener, is toggle the visibility of the button you need to show.
optiongroup.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
myButton.setVisible(true/false);
}
});