summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorDmitrij Abolichin <dirolwhite@gmail.com>2015-10-09 01:21:44 +0300
committerVaadin Code Review <review@vaadin.com>2015-10-20 04:34:53 +0000
commitdc196546c6e7de96b6d3027bd3a0509e71090ed9 (patch)
tree3e8242aad6a15db12edfe4024520b8beff9f28d9 /server/src
parent6539cb439f36c77aaa9cb80e6e0fc683f145a060 (diff)
downloadvaadin-framework-dc196546c6e7de96b6d3027bd3a0509e71090ed9.tar.gz
vaadin-framework-dc196546c6e7de96b6d3027bd3a0509e71090ed9.zip
Fix replacing of currently selected Tab (#14252)
Change-Id: I49a86d2fceac233fdfd9e31d8ade519b9f8460b6
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/ui/TabSheet.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/TabSheet.java b/server/src/com/vaadin/ui/TabSheet.java
index 592515c560..66784aaa02 100644
--- a/server/src/com/vaadin/ui/TabSheet.java
+++ b/server/src/com/vaadin/ui/TabSheet.java
@@ -736,6 +736,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
if (oldLocation == -1) {
addComponent(newComponent);
} else if (newLocation == -1) {
+ if (selected == oldComponent) {
+ setSelected(null);
+ }
removeComponent(oldComponent);
newTab = addTab(newComponent, oldLocation);
@@ -752,6 +755,9 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
if (selectAfterInserting) {
setSelected(newComponent);
+ //SelectedTabChangeEvent should be fired here as selected Tab is changed.
+ //Other cases are handled implicitly by removeComponent() and addComponent()addTab()
+ fireSelectedTabChange();
}
// Tab associations are not changed, but metadata is swapped between