W3C home > Mailing lists > Public > public-xformsusers@w3.org > May 2017

Default for dispatch/@targetid

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Wed, 10 May 2017 12:33:43 +0200
To: " XForms" <public-xformsusers@w3.org>
Message-ID: <op.yz0qahlgsmjzpq@steven-xps>
Just a thought about reducing the need for explicit id attributes.

Is there an argument to be had for allowing the default target of dispatch
to be the parent?

The use-case I had in mind was this, current method:

<model id="model">
   ...
   <dispatch ev:event="xforms-ready" name="my-timer"
             delay="20000" targetid="model"/>

   <action ev:event="my-timer">
     <send/>
     <dispatch name="my-timer" delay="20000"
               targetid="model"/>
   </action>
</model>

which could then be expressed

<model>
   ...
   <dispatch ev:event="xforms-ready" name="my-timer" delay="20000"/>

   <action ev:event="my-timer">
     <send/>
     <dispatch name="my-timer" delay="20000"/>
   </action>
</model>

Since nearly all events bubble, this would have the same effect, and  
relieve the necessity of having to specify an id on the model. You still  
have the option of explicitly using an id.

Steven
Received on Wednesday, 10 May 2017 10:34:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:37:48 UTC