From 50abb4780d897a2ba30003238540797a38b4cae2 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 21 Jan 2009 15:06:59 +0000 Subject: [PATCH] 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 --- .../toolkit/terminal/gwt/client/ui/IOrderedLayout.java | 8 ++++++++ .../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); -- 2.39.5