boolean enabled = !uidl.getBooleanAttribute("disabled");
if (component instanceof FocusWidget) {
- ((FocusWidget) component).setEnabled(enabled);
+ FocusWidget fw = (FocusWidget) component;
+ fw.setEnabled(enabled);
+ if (uidl.hasAttribute("tabindex")) {
+ fw.setTabIndex(uidl.getIntAttribute("tabindex"));
+ }
}
StringBuffer styleBuf = new StringBuffer();
return;
}
+ // not a FocusWidget -> needs own tabindex handling
+ if (uidl.hasAttribute("tabindex")) {
+ tb.setTabIndex(uidl.getIntAttribute("tabindex"));
+ }
+
immediate = uidl.hasAttribute("immediate");
nullSelectionAllowed = uidl.hasAttribute("nullselect");
package com.itmill.toolkit.tests.tickets;\r
\r
import com.itmill.toolkit.Application;\r
+import com.itmill.toolkit.ui.ComboBox;\r
+import com.itmill.toolkit.ui.DateField;\r
import com.itmill.toolkit.ui.GridLayout;\r
import com.itmill.toolkit.ui.TextField;\r
import com.itmill.toolkit.ui.Window;\r
\r
GridLayout layout = new GridLayout(2, 2);\r
TextField f1 = new TextField("1");\r
- int index = 0;\r
+ int index = 1;\r
f1.setTabIndex(index++);\r
TextField f2 = new TextField("2");\r
f2.setTabIndex(index++);\r
- TextField f3 = new TextField("3");\r
+\r
+ DateField f3 = new DateField("3");\r
f3.setTabIndex(index++);\r
- TextField f4 = new TextField("4");\r
- f4.setTabIndex(index++);\r
+ ComboBox cb = new ComboBox("4");\r
+ cb.setTabIndex(index++);\r
\r
- layout.addComponent(f4);\r
+ layout.addComponent(cb);\r
layout.addComponent(f3);\r
layout.addComponent(f2);\r
layout.addComponent(f1);\r