diff options
author | Juuso Valli <juuso@vaadin.com> | 2014-05-07 09:39:14 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-05-15 09:30:56 +0000 |
commit | 40a80c51803a109083d3949039448beeefd7f9da (patch) | |
tree | ad7a5d74eb4b8d02cc64bbaa018373911e41b75f /server | |
parent | 023568931d8eca775a9f6ab2e584e7ccfae83bd4 (diff) | |
download | vaadin-framework-40a80c51803a109083d3949039448beeefd7f9da.tar.gz vaadin-framework-40a80c51803a109083d3949039448beeefd7f9da.zip |
Fix Push inserts producing duplicate rows in Table (#13562)
Change-Id: I050553b233fb7024049c31d9495d90f4d88239c8
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/Table.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java index b4d79f304c..29dc52a9a6 100644 --- a/server/src/com/vaadin/ui/Table.java +++ b/server/src/com/vaadin/ui/Table.java @@ -2954,15 +2954,23 @@ public class Table extends AbstractSelect implements Action.Container, // (row caches emptied by other event) if (!containerChangeToBeRendered) { Integer value = (Integer) variables.get("reqfirstrow"); + int tableSize = size(); if (value != null) { reqFirstRowToPaint = value.intValue(); + // Sanity check + if (reqFirstRowToPaint < 0) { + reqFirstRowToPaint = -1; + } + if (reqFirstRowToPaint >= tableSize) { + reqFirstRowToPaint = tableSize - 1; + } } value = (Integer) variables.get("reqrows"); if (value != null) { reqRowsToPaint = value.intValue(); // sanity check - if (reqFirstRowToPaint + reqRowsToPaint > size()) { - reqRowsToPaint = size() - reqFirstRowToPaint; + if (reqFirstRowToPaint + reqRowsToPaint > tableSize) { + reqRowsToPaint = tableSize - reqFirstRowToPaint; } } } |