We recently made a number of improvements to focus handling in Orbeon Forms, on two fronts:
- The XForms engine is more aware of which control owns focus.
- Focus in/out events are now handling container controls.
This corresponds to the following simplified XForms:
<group id="name-and-email">Starting with initial focus on name, when you navigate from the name field to the email field to the save button, focus events used to be dispatched as follows:
<input id="name" ref="name"/>
<input id="email" ref="email"/>
</group>
<trigger id="save"/>
- DOMFocusOut on name
- DOMFocusIn on email
- DOMFocusOut on email
- DOMFocusIn on save
With the recent changes, you are also informed of the fact that focus has left the group:
- DOMFocusOut on name
- DOMFocusIn on email
- DOMFocusOut on email
- DOMFocusOut on name-and-email
- DOMFocusIn on save
This behavior also makes perfect sense for XBL controls which are composites of other XForms controls. Say you have a composite control for dates with multiple fields:
You use this control this way in Orben Forms:
<fr:fields-date ref="date"/>From the component user's perspective, fr:fields-date gets focus in/out events as if the composite control was a a single control. This satisfies the requirements for abstraction that come with XBL components, and in effect works like event retargeting specified by XBL 2 and the HTML Shadow DOM.
To learn all the little details, see the documentation.
No comments:
Post a Comment