Hi Bob,
I just looked in a MX 7.18.1 project and there it is possible for me to enter a tab index number:
Tested this and looks like it's doing what you want.
Hope this helps.
Cheers,
Jeffrey
Edit: Looked under the hood (in the HTML) and see that Mendix is not using the normal tabindex html attribute but their own focusindex. This is not an official attribute. I filled a support ticket because I'm curious why.
Update from Mendix R&D:
"Indeed we are using the custom attribute called focusindex
on widgets together with some special logic that handles the focus. But it is used together with tabindex
, not instead of it.
As our pages and widgets are dynamic by their nature we need something more flexible then just a flat tab order defined bytabindex
. We use so-called "nested" tab order. Additional custom property focusindex
simply "marks" a DOM node as a container where tabindex
(or natural tab order) of underlying focus-able elements is "local".
We named it focusindex
to prevent the clash with tabindex
on naturally non focus-able elements. That makes them focus-able and we don't want that in this case.
Take a look at this simplified HTML structure:
<input id="textbox1" tabindex="1" /> <!-- tabindex: 1 set in the Modeler --> <div id="complexWidget1" focusindex="3"> <!-- tabindex: 3 set in the Modeler --> <input id="i1" tabindex="2"/> <!-- tabindices in this widget are rendered (hardcoded) by the widget developer --> <input id="i2" tabindex="1"/> <div id="d1" tabindex="3"/>OK</div> <!-- custom button implemented by the widget developer and marked as focus-able by using tabindex --> </div> <input id="textbox2" tabindex="2" /> <!-- tabindex: 2 set in the Modeler --> <input id="textbox3" tabindex="4" /> <!-- tabindex: 4 set in the Modeler -->
A Mendix developer placed 4 widgets on the page, three textboxes and one complex custom widget. And the desired tab order is following:
textbox1
-> textbox2
-> complexWidget1
-> textbox3
. Which is set by placing tab orders in the Modeler.
The developer of the complex widget wants to provide a custom tab order i2
-> i1
-> d1
inside of the widget by simply placing tabindex
properties. Also a custom button is implemented in the widget using focus-able div
element.
The focus order on pressing Tab
is following:
- textbox1
(tabindex=1)
- textbox2
(tabindex=2)
- i2
(focusindex=3, tabindex=1)
- i1
(focusindex=3, tabindex=2)
- d1
(focusindex=3, tabindex=3)
- textbox3
(tabindex=4)
- Back to textbox1
(tabindex=1)
- etc.
Hope it explains the necessity of having the custom focusindex property in our DOM structure."