W3C home > Mailing lists > Public > public-xformsusers@w3.org > February 2019

dispatch default

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Thu, 07 Feb 2019 22:26:52 +0100
To: " XForms" <public-xformsusers@w3.org>
Message-ID: <op.zwu1u2hlsmjzpq@steven-xps>
Writing an XForm today, I once again hit upon a case where I had to add an  
id for a dispatch, when a simply chosen default would have sufficed.

I would again like to agitate for a default target for <dispatch/> of  
either the dispatch itself, or its parent (I don't mind which; since the  
default for an action with ev:event on it is the parent, parent seems  
consistent).

Since most events bubble this would have the exact same effect for almost  
all my examples without having to add an id specifically to direct the  
event to.

(My example was a polling tick event:

    <model id="model">
       ...
       <action ev:event="xforms-ready">
	 <dispatch name="tick" targetid="model"/>
       </action>
       <action ev:event="tick">
          ... Some periodic actions ...
	 <dispatch name="tick" targetid="model" delay="1000"/>
       </action>
    </model>

Which would have worked just as well like this:

    <model>
       ...
       <action ev:event="xforms-ready">
	 <dispatch name="tick"/>
       </action>
       <action ev:event="tick">
          ... Some periodic actions ...
	 <dispatch name="tick" delay="1000"/>
       </action>
    </model>
)

Steven
Received on Thursday, 7 February 2019 21:27:22 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 7 February 2019 21:27:22 UTC