diff options
author | Artur Signell <artur.signell@itmill.com> | 2009-01-21 15:06:59 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2009-01-21 15:06:59 +0000 |
commit | 50abb4780d897a2ba30003238540797a38b4cae2 (patch) | |
tree | 5536b2a45d423e3c4cbe04cc1217d6fd73e7f5a5 | |
parent | 7f480a89f0e3f370cda938b9182feca9dafe1ba3 (diff) | |
download | vaadin-framework-50abb4780d897a2ba30003238540797a38b4cae2.tar.gz vaadin-framework-50abb4780d897a2ba30003238540797a38b4cae2.zip |
Updated test case and fix for #2477 for IOrderedLayout - recalculate size of relative sized child if the expand ratio (or other parameters affecting child size) changes
svn changeset:6613/svn branch:trunk
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java | 8 | ||||
-rw-r--r-- | src/com/itmill/toolkit/tests/layouts/VerticalLayoutExpandRatioModification.java | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java index 2b0be73c58..f875fee465 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IOrderedLayout.java @@ -151,6 +151,14 @@ public class IOrderedLayout extends CellBasedLayout { if (isDynamicWidth()) {
childComponentContainer.renderChild(childUIDL, client, 0);
+ } else if (Util.isCached(childUIDL)) {
+ /*
+ * We must update the size of the relative sized component if
+ * the expand ratio or something else in the layout changes
+ * which affects the size of a relative sized component
+ */
+ client.handleComponentRelativeSize(childComponentContainer
+ .getWidget());
} else {
childComponentContainer.renderChild(childUIDL, client,
activeLayoutSize.getWidth());
diff --git a/src/com/itmill/toolkit/tests/layouts/VerticalLayoutExpandRatioModification.java b/src/com/itmill/toolkit/tests/layouts/VerticalLayoutExpandRatioModification.java index 5f14455ab6..3277466adb 100644 --- a/src/com/itmill/toolkit/tests/layouts/VerticalLayoutExpandRatioModification.java +++ b/src/com/itmill/toolkit/tests/layouts/VerticalLayoutExpandRatioModification.java @@ -3,6 +3,7 @@ package com.itmill.toolkit.tests.layouts; import com.itmill.toolkit.tests.components.TestBase;
import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.Label;
+import com.itmill.toolkit.ui.TextField;
import com.itmill.toolkit.ui.VerticalLayout;
import com.itmill.toolkit.ui.Window;
import com.itmill.toolkit.ui.Button.ClickEvent;
@@ -33,8 +34,9 @@ public class VerticalLayoutExpandRatioModification extends TestBase implements // The bottom layout
vl2 = new VerticalLayout();
- Label label2 = new Label("The bottom layout");
- vl2.addComponent(label2);
+ TextField tf = new TextField("The bottom field");
+ tf.setHeight("100%");
+ vl2.addComponent(tf);
// Add everything to the view
mainLayout.addComponent(vl1);
|