RE: comment on description xf:dispatch in XForms 1.1

When you ommit the ev:observer element you are listening to your parent element for events. See [1]

The following piece of markup attaches an event listener to xf:group with ID g for event my-event:
 <xf:group id="g">
    <xf:action id="a" ev:event="my-event">
      <xf:message level="modal">Hi, mom.</xf:message>
    </xf:action>
  </xf:group>

Is equivalent to:

<xf:group id="g">
    <xf:action id="a" ev:event="my-event" ev:observer="g">
      <xf:message level="modal">Hi, mom.</xf:message>
    </xf:action>
  </xf:group>


And can also be written as:

<xf:group id="g">
    ....
</xf:group>
....
<xf:action id="a" ev:event="my-event" ev:observer="g">
   <xf:message level="modal">Hi, mom.</xf:message>
</xf:action>

Regards,

Nick Van den Bleeken


1: http://www.w3.org/TR/2003/REC-xml-events-20031014/Overview.html#section-attributedefaulting
________________________________________
Van: C. M. Sperberg-McQueen [cmsmcq@blackmesatech.com]
Verzonden: dinsdag 31 juli 2012 4:56
Aan: www-forms-editor@w3.org
CC: C. M. Sperberg-McQueen
Onderwerp: comment on description xf:dispatch in XForms 1.1

The description of xf:dispatch in section 10.8
(http://www.w3.org/TR/xforms11/#action-dispatch) says

> This action dispatches an XML Event to a specific target element.

The description of targetid says

> Author-optional attribute for specifying the reference to the event target.

Nothing in section 10.8 seems to say what kinds of elements can
and what kinds of elements cannot usefully serve as the target
of an event.  (A search for 'event target' turns up no useful
discussion.)

Experimentation with XSLTForms showed (eventually) that if I
wrote

  <xf:group id="g">
    <xf:action id="a" ev:event="my-event">
      <xf:message level="modal">Hi, mom.</xf:message>
    </xf:action>
  </xf:group>

then

  <xf:dispatch name="my-event" targetid="g"/>

works as  one might expect.  That is, a message reading
"Hi, mom!" appears.  But in contrast

  <xf:dispatch name="my-event" targetid="a"/>

does not work as one might (and I did) expect.  That is,
no message appears.

If this is the expected behavior (I confess that I have not tried
the example with a different implementation), then perhaps it
would be helpful to some readers if section 10.8 said something
about whatever property it is of xf:group and xf:action which
make one but not the other a suitable target for event
dispatch.

If this topic is discussed in the spec, I would be grateful for a
pointer to the discussion. If it is a consequence of the rules
for event propagation in DOM2 Events or XML Events, I'd be
glad to know that, too.


--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************






--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


________________________________

Inventive Designers' Email Disclaimer:
http://www.inventivedesigners.com/email-disclaimer

Received on Tuesday, 31 July 2012 06:15:39 UTC