Loading...
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.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

PopupButton not repainting when replace contents of layout

David Wall
10 years ago Feb 17, 2012 4:02am
David Wall
10 years ago Feb 19, 2012 12:58am

I don't know if there's a subtle bug in PopupButton based on the problem I had above (removing the components from the VerticalLayout set as the component of the PopupButton), but the work-around is straightforward enough.

Instead of removing all components from the layout, I remove all components from the PopupButton itself (which removes my VerticalLayout), then create and populate the VerticalLayout and set that as the component for the PopupButton. Now it refreshes as expected.

Also, not sure, but PopupButton.setComponent (and addComponent) both just replace the 'component' object with the parameter passed in, but it doesn't do the same logic that removeComponent() does if an existing component is already set. Also, if you pass a null component to setComponent/addComponent, it'll get a null pointer exception.

David Wall
10 years ago Mar 19, 2012 11:49pm
David Wall
10 years ago Mar 20, 2012 12:17am