diff options
author | Artur Signell <artur@vaadin.com> | 2012-11-21 20:33:05 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-22 09:50:18 +0000 |
commit | de1450300bcc83eb3f6eddcd39bd77e02b24dfeb (patch) | |
tree | 6e0da07dbb25d902c1744517e4afa6b761b11f4a /client | |
parent | 1810b99839cb5616e84722c1f767953b7093a08b (diff) | |
download | vaadin-framework-de1450300bcc83eb3f6eddcd39bd77e02b24dfeb.tar.gz vaadin-framework-de1450300bcc83eb3f6eddcd39bd77e02b24dfeb.zip |
Fixed tab index handling in broken components (#10315)
Change-Id: I27a1a3541886b126f0798f4d25ae6d22df81aa79
Diffstat (limited to 'client')
7 files changed, 29 insertions, 13 deletions
diff --git a/client/src/com/vaadin/client/ui/VDateFieldCalendar.java b/client/src/com/vaadin/client/ui/VDateFieldCalendar.java index b7621f00f8..2bcff7f501 100644 --- a/client/src/com/vaadin/client/ui/VDateFieldCalendar.java +++ b/client/src/com/vaadin/client/ui/VDateFieldCalendar.java @@ -118,4 +118,12 @@ public class VDateFieldCalendar extends VDateField { } } } + + public void setTabIndex(int tabIndex) { + calendarPanel.getElement().setTabIndex(tabIndex); + } + + public int getTabIndex() { + return calendarPanel.getElement().getTabIndex(); + } } diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java index 5f9a3ded58..8f3f758458 100644 --- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -66,9 +66,7 @@ public class ComboBoxConnector extends AbstractFieldConnector implements getWidget().setTextInputEnabled(!noTextInput); // not a FocusWidget -> needs own tabindex handling - if (uidl.hasAttribute("tabindex")) { - getWidget().tb.setTabIndex(uidl.getIntAttribute("tabindex")); - } + getWidget().tb.setTabIndex(getState().tabIndex); if (uidl.hasAttribute("filteringmode")) { getWidget().filteringmode = FilteringMode.valueOf(uidl diff --git a/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java b/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java index ca3488af87..93e720e0ca 100644 --- a/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java +++ b/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java @@ -20,6 +20,7 @@ import java.util.Date; import com.vaadin.client.ApplicationConnection; import com.vaadin.client.DateTimeService; import com.vaadin.client.UIDL; +import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.VCalendarPanel.FocusChangeListener; import com.vaadin.client.ui.VCalendarPanel.TimeChangeListener; import com.vaadin.client.ui.VDateFieldCalendar; @@ -110,6 +111,12 @@ public class InlineDateFieldConnector extends AbstractDateFieldConnector { } @Override + public void onStateChanged(StateChangeEvent stateChangeEvent) { + super.onStateChanged(stateChangeEvent); + getWidget().setTabIndex(getState().tabIndex); + } + + @Override public VDateFieldCalendar getWidget() { return (VDateFieldCalendar) super.getWidget(); } diff --git a/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java b/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java index b5297f535a..a592098180 100644 --- a/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java +++ b/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java @@ -45,9 +45,7 @@ public class TextualDateConnector extends AbstractDateFieldConnector { getWidget().buildDate(); // not a FocusWidget -> needs own tabindex handling - if (uidl.hasAttribute("tabindex")) { - getWidget().text.setTabIndex(uidl.getIntAttribute("tabindex")); - } + getWidget().text.setTabIndex(getState().tabIndex); if (getWidget().isReadonly()) { getWidget().text.addStyleDependentName("readonly"); diff --git a/client/src/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java b/client/src/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java index 5d50b84833..36b69922fc 100644 --- a/client/src/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java +++ b/client/src/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java @@ -94,9 +94,7 @@ public abstract class OptionGroupBaseConnector extends AbstractFieldConnector getWidget().container.remove(getWidget().newItemButton); } - getWidget().setTabIndex( - uidl.hasAttribute("tabindex") ? uidl - .getIntAttribute("tabindex") : 0); + getWidget().setTabIndex(getState().tabIndex); } diff --git a/client/src/com/vaadin/client/ui/table/TableConnector.java b/client/src/com/vaadin/client/ui/table/TableConnector.java index ef1b117bcb..aa505a91e9 100644 --- a/client/src/com/vaadin/client/ui/table/TableConnector.java +++ b/client/src/com/vaadin/client/ui/table/TableConnector.java @@ -43,8 +43,8 @@ import com.vaadin.shared.ui.table.TableConstants; import com.vaadin.shared.ui.table.TableState; @Connect(com.vaadin.ui.Table.class) -public class TableConnector extends AbstractHasComponentsConnector - implements Paintable, DirectionalManagedLayout, PostLayoutListener { +public class TableConnector extends AbstractHasComponentsConnector implements + Paintable, DirectionalManagedLayout, PostLayoutListener { @Override protected void init() { @@ -276,8 +276,7 @@ public class TableConnector extends AbstractHasComponentsConnector getWidget().selectionRangeStart = getWidget().focusedRow; } - getWidget().tabIndex = uidl.hasAttribute("tabindex") ? uidl - .getIntAttribute("tabindex") : 0; + getWidget().tabIndex = getState().tabIndex; getWidget().setProperTabIndex(); getWidget().resizeSortedColumnForSortIndicator(); diff --git a/client/src/com/vaadin/client/ui/tree/TreeConnector.java b/client/src/com/vaadin/client/ui/tree/TreeConnector.java index 0ddbc7e96c..5a64d7c077 100644 --- a/client/src/com/vaadin/client/ui/tree/TreeConnector.java +++ b/client/src/com/vaadin/client/ui/tree/TreeConnector.java @@ -26,6 +26,7 @@ import com.vaadin.client.Paintable; import com.vaadin.client.TooltipInfo; import com.vaadin.client.UIDL; import com.vaadin.client.Util; +import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractComponentConnector; import com.vaadin.client.ui.VTree; import com.vaadin.client.ui.VTree.TreeNode; @@ -146,6 +147,13 @@ public class TreeConnector extends AbstractComponentConnector implements } @Override + public void onStateChanged(StateChangeEvent stateChangeEvent) { + super.onStateChanged(stateChangeEvent); + // VTree does not implement Focusable + getWidget().setTabIndex(getState().tabIndex); + } + + @Override public VTree getWidget() { return (VTree) super.getWidget(); } |