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

Dispatch with delay="0"

From: Erik Bruchez <erik@bruchez.org>
Date: Tue, 23 May 2017 15:21:54 -0700
Message-ID: <CAAc0PEWKtte_sAzbcD3EJOaOG_EnvLYvG_wu380td6m7tneGLA@mail.gmail.com>
To: "public-xformsusers@w3.org" <public-xformsusers@w3.org>

The spec says:

"If the delay is zero, or does not conform to xs:nonNegativeInteger, then
the event is dispatched immediately"

I assume that it means dispatched synchronously. This means that there is a
difference of synchronicity between:

    <xf:dispatch name="foo" targetid="my-model" delay="0"/>


    <xf:dispatch name="foo" targetid="my-model" delay="1"/>

It would be nice to be able to add an event to the event queue immediately.
Using `delay="1"` is close but not ideal.

The obvious way of doing that would be to change the spec and say that if
`delay` is present and contains a number, the event is always added to the
queue. So you always get asynchronous dispatch with a numeric `delay`.

Now, this causes a problem if you want to have a single action which, via
an AVT, allows for both asynchronous dispatch and asynchronous dispatch. A
special value, such as `delay="none"` could possibly be used.

    <xf:dispatch name="foo" targetid="my-model" delay="none"/>

Or an empty value:

    <xf:dispatch name="foo" targetid="my-model" delay=""/>

Also, a case could be made that if `delay` evaluates to something which is
not a number and not a value indicating synchronous dispatch, then the
event dispatch shouldn't take place (or an error could be raised):

    <xf:dispatch name="foo" targetid="my-model" delay="bar"/>


Received on Tuesday, 23 May 2017 22:22:48 UTC

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