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.
Grid not rendering after setColumns
Hi I have a View that changes the columns of a grid depending on the parameters on enter.
Once if a column was not visible and is set visible, the rendering does not work until I refresh the page.
public void enter(ViewChangeEvent event) {
String[] params=event.getParameters().split("/");
if(params.length==0){
setOffersContent();
}else if(params.length==1){
switch (params[0]) {
case "offers":
setOffersContent();
break;
case"requests":
setRequestsContent();
break;
case "exchanges":
setExchangeContent();
break;
default:
setOffersContent();
break;
}
}
}
private void setOffersContent(){
grid.getContainerDataSource().removeAllItems();
componentGridDecorator.addAll(DBImporter.getOffers());
grid.setColumns(NAME, CONTACT, LOCATION, OFFERAUTOS, STATUS);
}
private void setRequestsContent(){
grid.getContainerDataSource().removeAllItems();
componentGridDecorator.addAll(DBImporter.getRequests());
grid.setColumns(DETAILS, NAME, CONTACT, LOCATION, REQUESTAUTOS, STATUS);
}
I'm using ComponentRenderer Add-on but I have same problem without the addon and a ButtonRenderer.
The columns are shown but the content of is just plain text of the Object#toString() (e.g. "com.vaadin.ui.Button@4a3ec953")
If I refresh the page, the button and components are shown just fine.
Any ideas why this is happening? Should I open a ticket for this?