开发者

Is tabindex feature there in xforms?

开发者 https://www.devze.com 2023-02-17 16:26 出处:网络
I was doing my unit testing for the form, and found out that there is some serious problem with the automatic tab index that Orbeon gives.

I was doing my unit testing for the form, and found out that there is some serious problem with the automatic tab index that Orbeon gives.

In my case I have the need for following tab indexes 1-7 as shown by number in the figure.

Model:

<xforms:model>
    <xforms:instance id="dropdown-values">
        <form>
           <yes-no>
             <options>Yes</options>
             <options>No</opt开发者_JS百科ions>
          </yes-no>
       </form>
    </xforms:instance>
</xforms:model>

Logic to create the radio in form:

<xforms:itemset nodeset="instance('dropdown-values')/yes-no/options">
    <xforms:label ref="." />
    <xforms:value ref="." />
</xforms:itemset>

Is tabindex feature there in xforms?

The example above has a functionality like when "No" is selected in the "Enable text" option, the following text-boxes are disabled. Currently Orbeon is providing a default tabindex and switching from selected radio button to the next field. I.e.:

  • if radio is selected as "no", the navigation using tab will be 2->6 and repeat
  • if radio is selected as "Yes", the navigation using tab will be 1->3->4->5->7 and repeat

But the functionality intended is:

  • if radio is selected as "no", the navigation using tab will be 1->2->5->6 then repeat.
  • if radio is selected as "Yes", the navigation using tab will be 1->2->3->4->5->6->7


If I understand this well, you want tabbing to be done in the order in which the controls are in the page. The issue is that when you tab through radio buttons:

  • You observe that the "cursor" goes subsequently to each radio button.
  • You would like it to go to the next field.

I am not sure what browser you are using, as when I try this, if a radio button is selected at all time, the cursor doesn't go through all the radio buttons, but just to the one you selected. That is, I am getting the "what you would like", not the "what you observe" behavior. I tested this with Firefox 4 and IE 7.

BTW, this behavior has nothing to do with XForms; this is just how tabbing works through HTML controls.

Is tabindex feature there in xforms?


XForms provides the navindex attribute for this purpose, defined in section 8.1, The XForms Core Form Controls Module:

...a non-negative integer in the range of 0-32767 used to define the navigation sequence. This gives the author control over the sequence in which form controls are traversed.

There is also further discussion of some of the finer points related to navindex navigation in section 4.3.6, The xforms-next and xforms-previous Events.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号