Multi-select in Vaadin Grid is not correctly selecting items in Grid

751 views Asked by At

I'm using the same code in two grids and in one table SelectionMode.MULTI works as expected but in the other grid right after I select it (I can see the selection appear) within the blink of an eye the row is unselected. If I bring it back to SelectionMode.SINGLE then everything works. As well this weird behavior is across multiple browsers. It's the exact same code and everything looks correct.

Therefore I would love some help as to where to even start debugging this? I tried to even add hooks into the SelectionListener and it's firing correctly, so it's not as if it's being re-selected (unselected). I'm at a complete lost as to where or how to debug this weird behavior...

I also looked for anything like grid.setItems() and other than the initialization there are no calls to setItems().

What's even weirder is that I can do select all (clicking on the box in the column header) and all items are selected. I can then unselect the rows I don't want. However once I unselect a row I can no longer re-select it unless I do select all...

UPDATE: This issue just got much weirder. One grid was for Invoices and the other was for Receipts. They both extended the same parent class. Invoices always worked but Receipts didn't. As part of my testing I used the parent class and assigned Invoices in my Receipt Grid code and it worked. And if I did the reverse (Receipts in my Invoice Grid) I had the same issue in my Invoice Grid. I then decided to try to have Receipt extend Invoice, which although incorrect, did resolved the issue!! With that in mind I'm completely baffled with why this would ever resolve/cause this issue! Any idea as to how this is even possible would be extremely because I'm completely baffled why this can even happen at all...

I also asked for helped in the Vaadin forums where you can see the exact code difference.

0

There are 0 answers