From 82cc52702065587c46a7a0b6b08a35b2abe9f51b Mon Sep 17 00:00:00 2001 From: Automerge Date: Mon, 26 Mar 2012 13:21:50 +0000 Subject: [merge from 6.7] #8328 Pass the new, not the old, value to FreeFormStatementDelegate on itemChangeNotification svn changeset:23322/svn branch:6.8 --- src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java b/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java index 9d88072c20..85ff60d5d9 100644 --- a/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java +++ b/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java @@ -135,8 +135,8 @@ final public class ColumnProperty implements Property { /* Set the new value and notify container of the change. */ changedValue = newValue; - owner.getContainer().itemChangeNotification(owner); modified = true; + owner.getContainer().itemChangeNotification(owner); } private boolean isValueAlreadySet(Object newValue) { -- cgit v1.2.3 From 381c3eb5d4ebce92bceddd06e2a9ed81b40789c4 Mon Sep 17 00:00:00 2001 From: Automerge Date: Mon, 26 Mar 2012 13:21:55 +0000 Subject: [merge from 6.7] #8526 Added comments svn changeset:23323/svn branch:6.8 --- .../terminal/gwt/client/ui/VScrollTable.java | 36 +++++++++++++--------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 9e3b39f6b5..43908d474a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -838,6 +838,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { rendering = true; + // On the first rendering, add a handler to clear saved context menu + // details when the menu closes. See #8526. if (this.client == null) { client.getContextMenu().addCloseHandler( new CloseHandler() { @@ -846,7 +848,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, } }); } - + // If a row has an open context menu, it will be closed as the row is + // detached. Retain a reference here so we can restore the menu if + // required. ContextMenuDetails savedContextMenu = contextMenu; if (uidl.hasAttribute(ATTRIBUTE_PAGEBUFFER_FIRST)) { @@ -985,6 +989,21 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, } } + // If a row had an open context menu before the update, and after the + // update there's a row with the same key as that row, restore the + // context menu. See #8526. + if (enabled && savedContextMenu != null) { + for (Widget w : scrollBody.renderedRows) { + VScrollTableRow row = (VScrollTableRow) w; + if (row.isVisible() + && row.getKey().equals(savedContextMenu.rowKey)) { + contextMenu = savedContextMenu; + client.getContextMenu().showAt(row, savedContextMenu.left, + savedContextMenu.top); + } + } + } + if (!isSelectable()) { scrollBody.addStyleName(CLASSNAME + "-body-noselection"); } else { @@ -1040,17 +1059,6 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, rendering = false; headerChangedDuringUpdate = false; - - if (savedContextMenu != null) { - for (Widget w : scrollBody.renderedRows) { - VScrollTableRow row = (VScrollTableRow) w; - if (row.getKey().equals(savedContextMenu.rowKey)) { - contextMenu = savedContextMenu; - client.getContextMenu().showAt(row, savedContextMenu.left, - savedContextMenu.top); - } - } - } } private void initializeRows(UIDL uidl, UIDL rowData) { @@ -5411,8 +5419,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, int top = Util.getTouchOrMouseClientY(event); top += Window.getScrollTop(); left += Window.getScrollLeft(); - contextMenu = new ContextMenuDetails(this.getKey(), - left, top); + contextMenu = new ContextMenuDetails(this.getKey(), left, + top); client.getContextMenu().showAt(this, left, top); } } -- cgit v1.2.3