summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTomi Virtanen <tltv@vaadin.com>2014-03-15 19:56:46 +0200
committerLeif Åstrand <leif@vaadin.com>2014-04-17 08:07:23 +0000
commit9fa230d416a74206a57b215ebf1e884e87d11f3e (patch)
tree2a12963087a481b8c9916f15928fe85b81784498 /client
parent9c29442be7fbb150288ba4451ed9167bec2436ad (diff)
downloadvaadin-framework-9fa230d416a74206a57b215ebf1e884e87d11f3e.tar.gz
vaadin-framework-9fa230d416a74206a57b215ebf1e884e87d11f3e.zip
Avoid eagerly layouting from VScrollTable.updateFromUIDL (#13188)
Closing a modal sub-window at the same time when TreeTable item is removed, caused the detached Window being re-opened by WindowConnector.postLayout() call. This change adds a check in postLayout: continue operation only if the window is attached to DOM. Or else, log a warning message about the invalid postLayout call. Another change is in TreeTableConnector and VScrollTable to disallow Util.notifyParentOfSizeChange(Widget, boolean) with a boolean 'false' argument, when rendering is in progress. 'false' causes an immediate LayoutManager.layoutNow() call, which is the main reason for this issue. Change-Id: I6f3e331b0feff9e7814ae1d749f6f7812dcd49ac
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VScrollTable.java3
-rw-r--r--client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/window/WindowConnector.java8
3 files changed, 16 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java
index 1870dbdf0e..6692a3b82b 100644
--- a/client/src/com/vaadin/client/ui/VScrollTable.java
+++ b/client/src/com/vaadin/client/ui/VScrollTable.java
@@ -6693,8 +6693,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
}
int heightBefore = getOffsetHeight();
scrollBodyPanel.setHeight(bodyHeight + "px");
+
if (heightBefore != getOffsetHeight()) {
- Util.notifyParentOfSizeChange(VScrollTable.this, false);
+ Util.notifyParentOfSizeChange(VScrollTable.this, rendering);
}
}
Scheduler.get().scheduleDeferred(new Command() {
diff --git a/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java b/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java
index 3a45539096..7ef29533e0 100644
--- a/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java
+++ b/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java
@@ -48,7 +48,12 @@ public class TreeTableConnector extends TableConnector {
.getIntAttribute(TreeTableConstants.ATTRIBUTE_HIERARCHY_COLUMN_INDEX)
: 0;
int oldTotalRows = getWidget().getTotalRows();
+
super.updateFromUIDL(uidl, client);
+ // super.updateFromUIDL set rendering to false, even though we continue
+ // rendering here. Set it back to true.
+ getWidget().rendering = true;
+
if (getWidget().collapseRequest) {
if (getWidget().collapsedRowKey != null
&& getWidget().scrollBody != null) {
@@ -105,6 +110,7 @@ public class TreeTableConnector extends TableConnector {
getWidget()
.handleNavigation(event.keycode, event.ctrl, event.shift);
}
+ getWidget().rendering = false;
}
@Override
diff --git a/client/src/com/vaadin/client/ui/window/WindowConnector.java b/client/src/com/vaadin/client/ui/window/WindowConnector.java
index 1f4c6767af..3273e9cb72 100644
--- a/client/src/com/vaadin/client/ui/window/WindowConnector.java
+++ b/client/src/com/vaadin/client/ui/window/WindowConnector.java
@@ -15,6 +15,8 @@
*/
package com.vaadin.client.ui.window;
+import java.util.logging.Logger;
+
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Style;
@@ -256,6 +258,12 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector
@Override
public void postLayout() {
VWindow window = getWidget();
+
+ if (!window.isAttached()) {
+ Logger.getLogger(WindowConnector.class.getName()).warning(
+ "Called postLayout to detached Window.");
+ return;
+ }
if (window.centered && getState().windowMode != WindowMode.MAXIMIZED) {
window.center();
}