It is supposed to be the case that you can setfocus to a control that is
within a repeat, like this:
<trigger>
<label>Send me to I2</label>
<setfocus ev:event="DOMActivate" control="I2"/>
</trigger>
<repeat id="R" nodeset="a/b/c">
<input id="I1" ...> ...</input>
<input id="I2" ...> ...</input>
</repeat>
But the specification does not say what happens when the focus is sent to
I2 on a newly created repeat item:
<trigger>
<label>Send me to I2</label>
<action ev:event="DOMActivate" >
<insert nodeset="a/b/c" ... />
<setfocus control="I2"/>
</action>
</trigger>
I believe that the focus should still arrive on I2 in the newly created
set of UI controls, but this is because I believe that setfocus has a
deferred behavior that is imposed at the end of xforms-refresh.
This deferred behavior is not specified, so I wonder what other
implementations are doing. Either way, clearly the above markup (the
second trigger) should not fail to set the focus, but a literal reading of
the current spec would seem to imply that it does because the repeat index
of R is increased as soon as the insert occurs, yet the corresponding
controls do not exist until the next xforms-refresh.
John M. Boyer, Ph.D.
STSM: Lotus Forms Architect and Researcher
Chair, W3C Forms Working Group
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boyerj@ca.ibm.com
Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer