diff options
author | Guillermo Alvarez <guillermo@vaadin.com> | 2014-10-17 11:00:37 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-10-21 10:19:25 +0000 |
commit | 6ddca165279e7f7404b794d5032e9d64cbb5a996 (patch) | |
tree | 330b8a4353dcf85ff4f04489df7d13211abcb416 /client | |
parent | 6b64bd23760f63cf8c3e3c6f49facd64f376a27f (diff) | |
download | vaadin-framework-6ddca165279e7f7404b794d5032e9d64cbb5a996.tar.gz vaadin-framework-6ddca165279e7f7404b794d5032e9d64cbb5a996.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; } |