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);
    }
});

Jouni,
Thanks very much.
It works

Jolanda