diff options
author | Guillermo Alvarez <guillermo@vaadin.com> | 2014-10-17 11:00:37 +0300 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2014-10-29 10:32:26 +0200 |
commit | 98e736488d404add97ef08a3d59fdf80eb11c504 (patch) | |
tree | 31624278619a953e04692172d111b486326e52ed /client | |
parent | 99e798504c4978c6f2506f9cdea0ba760a105c57 (diff) | |
download | vaadin-framework-98e736488d404add97ef08a3d59fdf80eb11c504.tar.gz vaadin-framework-98e736488d404add97ef08a3d59fdf80eb11c504.zip |
Fix TabSheet becomes unresponsive after setSelectedTab (#14710)
Fixed unresponsiveness issue without removing the waitingForResponse
flag from VTabsheet. The flag is now set in revertToSharedStateSelection
Change-Id: I62cabc44d4ac4c284b0b35921d8624483b0150be
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VTabsheet.java | 8 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ui/VTabsheet.java b/client/src/com/vaadin/client/ui/VTabsheet.java index 9c3af5c568..745f2bca61 100644 --- a/client/src/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/com/vaadin/client/ui/VTabsheet.java @@ -694,6 +694,9 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware private final Element deco; + /** For internal use only. May be removed or replaced in the future. */ + public boolean waitingForResponse; + private String currentStyle; /** @@ -701,7 +704,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware */ private boolean canSelectTab(final int tabIndex) { Tab tab = tb.getTab(tabIndex); - if (getApplicationConnection() == null || disabled) { + if (getApplicationConnection() == null || disabled + || waitingForResponse) { return false; } if (!tab.isEnabledOnServer() || tab.isHiddenOnServer()) { @@ -735,6 +739,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware getRpcProxy().setSelected(tabKeys.get(tabIndex).toString()); + waitingForResponse = true; + tb.getTab(tabIndex).focus(); // move keyboard focus to active tab return true; diff --git a/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java b/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java index 94961a6a50..d49581eaad 100644 --- a/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java +++ b/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java @@ -41,7 +41,7 @@ public class TabsheetConnector extends TabsheetBaseConnector implements final String key = getState().tabs.get(i).key; final boolean selected = key.equals(getState().selected); if (selected) { - getWidget().setActiveTabIndex(i); + getWidget().waitingForResponse = false; getWidget().selectTab(i); break; } |