diff options
Diffstat (limited to 'server/src/com/vaadin/ui')
-rw-r--r-- | server/src/com/vaadin/ui/Table.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java index b4d79f304c..a8265662ea 100644 --- a/server/src/com/vaadin/ui/Table.java +++ b/server/src/com/vaadin/ui/Table.java @@ -2957,12 +2957,19 @@ public class Table extends AbstractSelect implements Action.Container, if (value != null) { reqFirstRowToPaint = value.intValue(); } + value = (Integer) variables.get("reqrows"); if (value != null) { reqRowsToPaint = value.intValue(); + int size = size(); // sanity check - if (reqFirstRowToPaint + reqRowsToPaint > size()) { - reqRowsToPaint = size() - reqFirstRowToPaint; + + if (reqFirstRowToPaint >= size) { + reqFirstRowToPaint = size; + } + + if (reqFirstRowToPaint + reqRowsToPaint > size) { + reqRowsToPaint = size - reqFirstRowToPaint; } } } |