W3C home > Mailing lists > Public > public-forms@w3.org > July 2007

XML events: One event handler, multiple events

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Tue, 17 Jul 2007 12:52:48 +0200
Message-ID: <469C9F80.8080804@orbeon.com>
To: Mark Birbeck <mark.birbeck@x-port.net>, Shane McCarron <shane@aptest.com>
CC: "Forms WG (new)" <public-forms@w3.org>

Mark, Shane:

Following a discussion in this thread [1], I have an action item [2]
from the XForms Working Group to contact you to suggest an enhancement
to the ev:event attribute in order to allow registering an event
handler for multiple events without resorting to using an additional
<ev:listener> element.

As far as we could tell, the only way to do this purely with the XML
syntax today is to write (here in the context of XForms):

    <xf:action ev:event="some-event" id="handler">
    <ev:listener event="some-other-event" handler="#handler"/>

The suggestion is to enhance the ev:event attribute to support a list
of events rather than a single event. You would then write instead:

    <xf:action ev:event="some-event some-other-event">

This would be a much more concise syntax which would not require form
authors to learn ev:listener. The result is also quite easy to read.

There are obviously precedents for using lists of space-separated
names, in particular the following two come to mind immediately:

* List of CSS classes in HTML @class attributes
* List of XML schemas on xforms:model/@schema

Note that [1] discusses a slightly more complex case where the event
handler is attached to two different observers. The solution above
would probably not work in this case, although a similar suggestion
could be made for the ev:observer attribute:

    <xf:action ev:event="some-event" ev:observer="observer1 observer2">

What is the best way to have this suggestion duly taken into account
by the people in charge of XML Events? Is this email sufficient?



[1] http://lists.w3.org/Archives/Public/www-forms/2007Apr/0042.html

Orbeon Forms - Web Forms for the Enterprise Done the Right Way
Received on Tuesday, 17 July 2007 10:52:55 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:13:52 UTC