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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
Grid: Copy a row from one grid into another grid
With a table i copy rows from one table to the other by this code
public void copydata(){
Object o = table1.getValue();
if(!table2.getItemIds().contains(o))
table2.addItem(o);
table2.setContainerDataSource(table2.getContainerDataSource());
}
How can i make it with a grid.
Here i have no grid1.getValue();
Last updated on
Table's getValue() returns the item ID of the currently selected item. In Grid, there's getSelectedRow() for that.
Also, you're using item IDs as row captions. I'm not sure if I remember correctly, but I think Grid doesn't support that, but you need to use a real or generated column.
I have no idea what you are doing with "table2.setContainerDataSource(table2.getContainerDataSource());"
Last updated on
You cannot reply to this thread.