Browse Source

Fix for #5068

svn changeset:13776/svn branch:6.4
tags/6.7.0.beta1
John Alhroos 14 years ago
parent
commit
77a5b6f83a

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

@@ -4813,6 +4813,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,

if (row != null) {

// Apply focus style to new selection
row.addStyleName(CLASSNAME_SELECTION_FOCUS);

// Trying to set focus on already focused row
if (row == focusedRow) {
return false;
@@ -4821,9 +4824,6 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
// Set new focused row
focusedRow = row;

// Apply focus style to new selection
focusedRow.addStyleName(CLASSNAME_SELECTION_FOCUS);

// Scroll up or down if needed
int rowTop = focusedRow.getElement().getAbsoluteTop();
int scrollTop = scrollBodyPanel.getElement().getAbsoluteTop();
@@ -4840,8 +4840,6 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
}

return true;
} else {
focusedRow = null;
}

return false;
@@ -5080,6 +5078,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
// Focus a row if no row is in focus
if (focusedRow == null) {
setRowFocus((VScrollTableRow) scrollBody.iterator().next());
} else {
setRowFocus(focusedRow);
}
}
}

+ 3
- 1
src/com/vaadin/terminal/gwt/client/ui/VTree.java View File

@@ -1429,6 +1429,8 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
// If no node has focus, focus the first item in the tree
if (focusedNode == null && selectable) {
setFocusedNode((TreeNode) body.getWidget(0));
} else if (selectable) {
setFocusedNode(focusedNode);
}
}

@@ -1440,7 +1442,7 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
* .dom.client.BlurEvent)
*/
public void onBlur(BlurEvent event) {
setFocusedNode(null);
focusedNode.setFocused(false);
}

/*

Loading…
Cancel
Save