Browse Source

Cleaner fix for #7535

svn changeset:20899/svn branch:6.7
tags/6.7.0.rc1
Jonatan Kronqvist 12 years ago
parent
commit
da3275a2f2

+ 13
- 2
src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java View File

@@ -157,7 +157,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
protected ApplicationConnection client;
protected String paintableId;

protected boolean immediate;
private boolean immediate;
private boolean nullSelectionAllowed = true;

private int selectMode = Table.SELECT_MODE_NONE;
@@ -629,6 +629,17 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
* Sends the selection to the server if changed since the last update/visit.
*/
protected void sendSelectedRows() {
sendSelectedRows(immediate);
}

/**
* Sends the selection to the server if it has been changed since the last
* update/visit.
*
* @param immediately
* set to true to immediately send the rows
*/
protected void sendSelectedRows(boolean immediately) {
// Don't send anything if selection has not changed
if (!selectionChanged) {
return;
@@ -672,7 +683,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
// Send the selected rows
client.updateVariable(paintableId, "selected",
selectedRowKeys.toArray(new String[selectedRowKeys.size()]),
immediate);
immediately);

}


+ 3
- 10
src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java View File

@@ -745,7 +745,7 @@ public class VTreeTable extends VScrollTable {
client.updateVariable(paintableId, "selectCollapsed", true,
false);
}
sendSelectedRowsNonImmediate();
sendSelectedRows(false);
sendToggleCollapsedUpdate(focusedRow.getKey());
return true;
} else if (keycode == KeyCodes.KEY_RIGHT && focusedRow.open) {
@@ -804,16 +804,9 @@ public class VTreeTable extends VScrollTable {
}
}

private void sendSelectedRowsNonImmediate() {
boolean oldImmediate = immediate;
immediate = false;
sendSelectedRows();
immediate = oldImmediate;
}

@Override
protected void sendSelectedRows() {
super.sendSelectedRows();
protected void sendSelectedRows(boolean immediately) {
super.sendSelectedRows(immediately);
selectionPending = false;
}


Loading…
Cancel
Save