summaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/terminal/gwt
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-03-31 09:10:43 +0000
committerArtur Signell <artur.signell@itmill.com>2009-03-31 09:10:43 +0000
commita5eecfa4f802061110b9941237b65f8a84ba3edd (patch)
tree37360873710938017e106a7091fba07a017969d9 /src/com/itmill/toolkit/terminal/gwt
parent5a29c5b3faf7285c888d95c518b7c20ed46ee739 (diff)
downloadvaadin-framework-a5eecfa4f802061110b9941237b65f8a84ba3edd.tar.gz
vaadin-framework-a5eecfa4f802061110b9941237b65f8a84ba3edd.zip
Merged fix for #2747: Wrapping link-style Button text inside Table breaks the height calculation of Table
http://dev.itmill.com/ticket/2747 svn changeset:7243/svn branch:6.0
Diffstat (limited to 'src/com/itmill/toolkit/terminal/gwt')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
index 7470662828..bd832749fa 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
@@ -574,7 +574,8 @@ public class IScrollTable extends FlowPanel implements Table, ScrollListener {
boolean verticalScrollbarVisible = (pageLength < totalRows);
if (verticalScrollbarVisible) {
- // There will be a vertical scrollbar and its width is not included in availW
+ // There will be a vertical scrollbar and its width is not included
+ // in availW
availW -= Util.getNativeScrollbarSize();
}
@@ -651,8 +652,17 @@ public class IScrollTable extends FlowPanel implements Table, ScrollListener {
* We must force an update of the row height as this point as it
* might have been (incorrectly) calculated earlier
*/
- int bodyHeight = (tBody.getRowHeight(true) * pageLength);
- bodyContainer.setHeight(bodyHeight + "px");
+ if (pageLength == totalRows) {
+ /*
+ * We want to show all rows so the bodyHeight should be equal to
+ * the table height
+ */
+ int bodyHeight = tBody.getTableHeight();
+ bodyContainer.setHeight(bodyHeight + "px");
+ } else {
+ int bodyHeight = (tBody.getRowHeight(true) * pageLength);
+ bodyContainer.setHeight(bodyHeight + "px");
+ }
}
isNewBody = false;
@@ -1935,8 +1945,7 @@ public class IScrollTable extends FlowPanel implements Table, ScrollListener {
return rowHeight;
} else {
if (DOM.getChildCount(tBody) > 0) {
- rowHeight = tBody.getParentElement().getOffsetHeight()
- / DOM.getChildCount(tBody);
+ rowHeight = getTableHeight() / DOM.getChildCount(tBody);
} else {
return DEFAULT_ROW_HEIGHT;
}
@@ -1945,6 +1954,10 @@ public class IScrollTable extends FlowPanel implements Table, ScrollListener {
}
}
+ public int getTableHeight() {
+ return table.getOffsetHeight();
+ }
+
public int getColWidth(int i) {
if (initDone) {
final Element e = DOM.getChild(DOM.getChild(tBody, 0), i);