diff options
author | Juuso Valli <juuso@vaadin.com> | 2014-05-07 09:39:14 +0300 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2014-05-23 21:56:54 +0300 |
commit | ce1764fb1bad1b82462d73fbfe293b676c2a9c00 (patch) | |
tree | 3e8165fb7ee0364da6aa1d8be74768e31c374e28 /server | |
parent | 3b420700c1a282cb8a6620299484cc1c002fbb3b (diff) | |
download | vaadin-framework-ce1764fb1bad1b82462d73fbfe293b676c2a9c00.tar.gz vaadin-framework-ce1764fb1bad1b82462d73fbfe293b676c2a9c00.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; } } } |