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.

Quick inline data editing with Grid or Table

Auke te Winkel
6 years ago Oct 07, 2015 7:25am

Hi all,

for an enterprise application I'm looking at replacing Table with Grid. We need a view in which a user can quicklly move through rows and columns to edit data, using only the keyboard.

Our current table implementation is very slow, most likely because of the large amount of complex (composite) fields in the Table. One possible solution would be to show only fields on selected rows and plain text on others, but that does not seem possible Using read only fields for non-selected rows might be possible, but I doubt that it will significantly improve speed.

I've tried the Grid component and it is exactly what we want, except that editing is painfully slow. After selecting a row, hitting Enter is sufficient to edit the row, but you need to press Tab a couple of times before hitting Enter again triggers a save. What's more, after saving there is no longer a row/cell selected so it is not possible to move to the next row to edit.

Since I'm new to the Grid component, does anyone know possible solutions to achieve what we want?

Thanks!

Guttorm Vik
6 years ago Oct 13, 2015 10:26am

Hi,

We have had the same problem, so we've sponsored a modification. It is in alpha for now, but there is a test/demo application:
http://vasa.demo.vaadin.com/grid-unbuffered/

( Come to think of it, perhaps the solution would be even better if only the current *cell* had an editor, and not the current row? )

The demo also supports column resize now, which have been another reason for not switching to Grid.

So, we think this will solve our issues with Grid, but honestly I don't understand the usage model that Vaadin targeted with the original editing model. Does anyone like it?

I think perhaps the reasoning is that one row in a Grid is similar to a Form, and for Form we can have buffered editing where no changes are submitted until the user clicks "Ok" and all fields pass validation.

We don't like this for Forms either, but there we have always been able to do setBuffered(false)

Btw: Until Grid is ready for prime-time we will continue to use a Table class where we have overridden createField to only return Fields for the current row.
This makes an editable Table much quicker, and actually usable in IE8/9, but it is really hacky and you get lots of new and interesting bugs that you have to work around or live with.
 

Auke te Winkel
6 years ago Oct 13, 2015 2:57pm
Tatu Lund
6 years ago Oct 14, 2015 5:31am
Auke te Winkel
6 years ago Oct 14, 2015 7:50am
Teppo Kurki
6 years ago Oct 14, 2015 10:16am
Tetris Dev
6 years ago Oct 14, 2015 3:22pm
Auke te Winkel
6 years ago Dec 16, 2015 4:03pm
Auke te Winkel
6 years ago Mar 21, 2016 4:02pm
Ram p
5 years ago Jul 04, 2016 10:09am
Guttorm Vik
5 years ago Jul 05, 2016 9:24am
Marius Klein
5 years ago Sep 16, 2016 11:40am
Rob W
5 years ago Sep 16, 2016 2:35pm
Marius Klein
5 years ago Sep 20, 2016 8:15am
Brett Sutton
4 years ago Jul 05, 2017 12:54pm
Tatu Lund
4 years ago Jul 05, 2017 5:44pm
Vanitha R
3 years ago Dec 14, 2018 10:14am
Tatu Lund
3 years ago Dec 15, 2018 7:15pm
Vanitha R
3 years ago Dec 17, 2018 11:23am
Tatu Lund
3 years ago Dec 17, 2018 11:34am

Is sample code available as to how we could use it in Vaadin 7.

Yes, it is here -> https://github.com/TatuLund/GridFastNavigation/blob/master/GridFastNavigation-demo/src/main/java/org/vaadin/patrik/demo/DemoUI.java

The delete key does not remove the row from the grid.

That feature actually does not exists as is. Delete key empties the Field when applicable.

But I am familiar with the use case, since I was asked about it fairly recently: https://github.com/TatuLund/GridFastNavigation/issues/84

Vanitha R
3 years ago Dec 19, 2018 10:19am
Tatu Lund
3 years ago Dec 19, 2018 10:42am
Vanitha R
3 years ago Dec 19, 2018 10:45am
Vanitha R
3 years ago Dec 21, 2018 7:59am