DOMActivate on xf:group, or equivalent?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DOMActivate on xf:group, or equivalent?

Adrian Baker-3
I've been building a table control, which has onclick behavior on the column headers (th) and on the rows (tr).

The only way I've been able to do this is to attach regular Javascript onclick handlers, then using YUI, locating a hidden xf:trigger, sending it a DOMActivate event using Orbeon's Javascript api.

It's all very cumbersome. Is there any way to directly connect xforms events with click events to anything other than a trigger? If not this seems a bit of a gap in the spec - it means you can't easily add click handling to anything other than anchors or buttons.

I wouldn't mind having to wrap the header/row contents in an xf:group, but these don't seem to fire DOMActivate.
Reply | Threaded
Open this post in threaded view
|

Re: DOMActivate on xf:group, or equivalent?

Alessandro Vernet
Administrator
Adrian,

Adrian Baker wrote
The only way I've been able to do this is to attach regular Javascript onclick handlers, then using YUI, locating a hidden xf:trigger, sending it a DOMActivate event using Orbeon's Javascript api.
If your th/tr are generated with an <xforms:repeat>, you will get an xforms-focus event when you click on the th/tr. Would this work in your case?

Adrian Baker wrote
I wouldn't mind having to wrap the header/row contents in an xf:group, but these don't seem to fire DOMActivate.
The spec leaves some freedom as to how we implement DOMActivate saying that it is "dispatched in response to: the "default action request" for a core  form control, for instance pressing a button or hitting enter". But I don't think that just clicking on the content of am <xforms:group> should dispatch a DOMActivate to that <xforms:group>.

This also ties into a discussion about usability: it is often better to have more usual controls (links and buttons) on the page to denote that action is possible there.

Alex