diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-05-07 13:06:34 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-05-10 14:22:27 +0000 |
commit | 55ea6dce33bec44140984633a6d3aee7910b89da (patch) | |
tree | 77701ce3368c8704ff8303cbcfaa0117abdb0e88 /client | |
parent | 19e27a15ca765de477fbe929a1cb6a7412c523f7 (diff) | |
download | vaadin-framework-55ea6dce33bec44140984633a6d3aee7910b89da.tar.gz vaadin-framework-55ea6dce33bec44140984633a6d3aee7910b89da.zip |
More specific workaround for no rows in TreeTable with pagelenght = 0 (#9203)
svn changeset:25915/svn branch:6.8
Conflicts:
client/src/com/vaadin/client/ui/VScrollTable.java
Change-Id: I3f5b9dc988f5911023f77f184f5bd6770bbd9f1b
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VScrollTable.java | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 4d61fba429..b03fa945cd 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -1113,10 +1113,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (firstvisible != lastRequestedFirstvisible && scrollBody != null) { // received 'surprising' firstvisible from server: scroll there firstRowInViewPort = firstvisible; - + /* - * Schedule the scrolling to be executed last so no updates to the rows - * affect scrolling measurements. + * Schedule the scrolling to be executed last so no updates to the + * rows affect scrolling measurements. */ Scheduler.get().scheduleFinally(lazyScroller); } @@ -2104,6 +2104,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * might have been (incorrectly) calculated earlier */ + /* + * TreeTable updates stuff in a funky order, so we must set the + * height as zero here before doing the real update to make it + * realize that there is no content, + */ + if (pageLength == totalRows && pageLength == 0) { + scrollBody.setHeight("0px"); + } + int bodyHeight; if (pageLength == totalRows) { /* @@ -3056,7 +3065,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, .hasNext(); columnIndex++) { if (it.next() == this) { break; - } + } } } final int cw = scrollBody.getColWidth(columnIndex); @@ -4796,8 +4805,20 @@ public class VScrollTable extends FlowPanel implements HasWidgets, prepx = 0; } preSpacer.getStyle().setPropertyPx("height", prepx); - int postpx = measureRowHeightOffset(totalRows - 1) - - measureRowHeightOffset(lastRendered); + int postpx; + if (pageLength == 0 && totalRows == pageLength) { + /* + * TreeTable depends on having lastRendered out of sync in some + * situations, which makes this method miss the special + * situation in which one row worth of post spacer to be added + * if there are no rows in the table. #9203 + */ + postpx = measureRowHeightOffset(1); + } else { + postpx = measureRowHeightOffset(totalRows - 1) + - measureRowHeightOffset(lastRendered); + } + if (postpx < 0) { postpx = 0; } |