diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-04-02 08:22:54 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2009-04-02 08:22:54 +0000 |
commit | 8f78e7c8994a630ff7a09819074f3c11f1c1d976 (patch) | |
tree | b3bf7d297a698cf7129687e0d5ce5386bd44f70d /src/com/itmill/toolkit/terminal/gwt | |
parent | 4a765948a65dab18869ee6425dba3ba909fdf274 (diff) | |
download | vaadin-framework-8f78e7c8994a630ff7a09819074f3c11f1c1d976.tar.gz vaadin-framework-8f78e7c8994a630ff7a09819074f3c11f1c1d976.zip |
fixes #2518, window resize listener
svn changeset:7285/svn branch:6.0
Diffstat (limited to 'src/com/itmill/toolkit/terminal/gwt')
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java | 15 | ||||
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java | 6 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java index 5d4e8c86d9..1e4badc439 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java @@ -72,6 +72,8 @@ public class IView extends SimplePanel implements Container, private boolean scrollable; + private boolean immediate; + public IView(String elementId) { super(); setStyleName(CLASSNAME); @@ -138,6 +140,8 @@ public class IView extends SimplePanel implements Container, boolean firstPaint = connection == null; connection = client; + immediate = uidl.hasAttribute("immediate"); + String newTheme = uidl.getStringAttribute("theme"); if (theme != null && !newTheme.equals(theme)) { // Complete page refresh is needed due css can affect layout @@ -396,6 +400,8 @@ public class IView extends SimplePanel implements Container, .log( "Running layout functions due window resize"); connection.runDescendentsLayout(IView.this); + + sendClientResized(); } } }; @@ -419,10 +425,19 @@ public class IView extends SimplePanel implements Container, connection.runDescendentsLayout(this); Util.runWebkitOverflowAutoFix(getElement()); + sendClientResized(); } } + /** + * Send new dimensions to the server. + */ + private void sendClientResized() { + connection.updateVariable(id, "height", height, false); + connection.updateVariable(id, "width", width, immediate); + } + public native static void goTo(String url) /*-{ $wnd.location = url; diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java index 764e400df9..e329d410c0 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IWindow.java @@ -132,6 +132,8 @@ public class IWindow extends IToolkitOverlay implements Container, private String height; + private boolean immediate; + public IWindow() { super(false, false, true); // no autohide, not modal, shadow // Different style of shadow for windows @@ -249,6 +251,8 @@ public class IWindow extends IToolkitOverlay implements Container, return; } + immediate = uidl.hasAttribute("immediate"); + if (uidl.getBooleanAttribute("resizable") != resizable) { setResizable(!resizable); } @@ -756,7 +760,7 @@ public class IWindow extends IToolkitOverlay implements Container, if (updateVariables) { // sending width back always as pixels, no need for unit client.updateVariable(id, "width", w, false); - client.updateVariable(id, "height", h, false); + client.updateVariable(id, "height", h, immediate); } // Update child widget dimensions |