Re: comment on description xf:dispatch in XForms 1.1

Maybe Steven's 'XForms for HTML authors' [1] is a better place to add some in depth examples of XML-events ? What do you think?

Nick

1: http://www.w3.org/MarkUp/Forms/2010/xforms11-for-html-authors/

On 31 jul. 2012, at 18:55, "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com> wrote:

> Thank you; this is very helpful (both your explanation and your
> pointer to the XML Events spec, which I have never looked at
> properly.
>
> I don't think it's a good idea to repeat in the XForms spec all
> the details given in the XML Events spec, but here is one reader
> who would benefit if the XForms spec gave a little more of
> an overview of the event-handling model -- perhaps a paragraph
> or two added to section 4.1 would do the trick.  (The idea would
> be to provide enough orientation to allow the reader to understand
> some important concepts -- such as the distinction relevant
> here between handler and observer -- and to know where to
> go for more details.)
>
> I realize that it's very hard for people steeped in a spec to write
> high-level overviews that work well for novices and for people
> who don't already know what the overview is saying.  So I apologize
> for not offering specific wording.  Perhaps after I spend some time
> with the XML Events spec I will be able to come back and propose
> wording.
>
> Michael
>
> On Jul 31, 2012, at 12:15 AM, Nick Van den Bleeken wrote:
>
>> 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
>
> --
> ****************************************************************
> * 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 17:12:15 UTC