comment on description xf:dispatch in XForms 1.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

comment on description xf:dispatch in XForms 1.1

C. M. Sperberg-McQueen-2
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
****************************************************************





Reply | Threaded
Open this post in threaded view
|

RE: comment on description xf:dispatch in XForms 1.1

Nick Van den Bleeken-2
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 [[hidden email]]
Verzonden: dinsdag 31 juli 2012 4:56
Aan: [hidden email]
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

Reply | Threaded
Open this post in threaded view
|

Re: comment on description xf:dispatch in XForms 1.1

C. M. Sperberg-McQueen-2
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 [[hidden email]]
> Verzonden: dinsdag 31 juli 2012 4:56
> Aan: [hidden email]
> 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
****************************************************************





Reply | Threaded
Open this post in threaded view
|

Re: comment on description xf:dispatch in XForms 1.1

Nick Van den Bleeken-2
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" <[hidden email]> 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 [[hidden email]]
>> Verzonden: dinsdag 31 juli 2012 4:56
>> Aan: [hidden email]
>> 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

Reply | Threaded
Open this post in threaded view
|

Re: comment on description xf:dispatch in XForms 1.1

C. M. Sperberg-McQueen-2

On Jul 31, 2012, at 11:11 AM, Nick Van den Bleeken wrote:

> 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/

Examples are good.  So if Steven has the time and energy,
I can only wish him Godspeed, and I look forward to looking
at what he comes up with.

But I do think the spec can and should be made clearer and easier to
follow, so I don't think adding examples to Steven's tutorial is a
substitute for revising the spec.  

I recognize that opinions may vary as to when a change makes
something clearer and when not, so such revisions can be tricky.
I also recognize that the spec is not intended as a tutorial, and
I don't propose that it should be made into one.  And I also
recognize that it is widely believed in working groups that "nobody
actually reads the spec anyway, so it doesn't matter if it's hard to
read".  I think there are not many readers for spec prose, but
for what it's worth, I do read specs, and am thus a counterexample
to that belief -- to make the belief empirically tenable, you would
have to rephrase it as "nobody worth bothering about reads the
spec".

in sum, I will not be surprised if the WG feels a certain reluctance
to agree with my suggestion that the spec be revised here.  But
it says here that I nonetheless think the spec should be revised
on this point.

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