W3C home > Mailing lists > Public > www-forms@w3.org > April 2006

Re: Cancel a submission in progress

From: Steven Pemberton <steven.pemberton@cwi.nl>
Date: Tue, 04 Apr 2006 17:37:13 +0200
To: "David Landwehr" <david.landwehr@solidapp.com>, "Allan Beaufour" <beaufour@gmail.com>
Cc: www-forms@w3.org
Message-ID: <op.s7hpobj9smjzpq@acer3010.lan>

I think it's a great idea for stopping those long waits for slow servers  
when you realise you've sent the wrong data anyway...

Here's my pattern for this:

<submission id="go" action="..." method="get" ... >
     <toggle case="busy" ev:event="xforms-submit" />
     <toggle case="done" ev:event="xforms-submit-done" />
     <toggle case="whoops" ev:event="xforms-submit-error" />
</xforms:submission>
...
<input ...></input>
<switch>
    <case id="start">
        <submit submission="go">
            <label>Go</label>
        </submit>
    </case>
    <case id="busy">wait...
        <trigger>
             <label>Cancel</label>
             <cancel submission="go" ev:event="DOMActivate"/>
        </trigger>
    </case>
    <case id="whoops">Whoops!
        <submit submission="go">
            <label>Try again</label>
        </submit>
    </case>
    <case id="done">
         <submit submission="go"><label>Go</label></submit>
         <output ...
    </case>
</switch>

Still, my conclusion from this is that I would prefer a separate event  
 from xforms-submit-error to distinguish an error from a cancel.

Steven

On Tue, 04 Apr 2006 14:27:25 +0200, David Landwehr  
<david.landwehr@solidapp.com> wrote:

>
>
>> I'm not quite following the usefulness in your example though. You
>> start by "teasing" the submission action, before submitting to it? :)
>>
>>
>
> Just to making sure the server is awoke and alert before sending the  
> real stuff ;)
>
> No the idea is that if you use an input and a submission to populate  
> e.g. a select1 then you would have something like:
> <xforms:select1 ref="populated">
>   <xforms:itemset nodeset=""
>
> <xforms:input ref="prefix" incremental="true">
>   <xforms:action ev:event="xforms-value-changed">
>     <xforms:cancel submission="s1"/>
>     <xforms:send submission="s1"/>
>
> This wouldn't work probably without the cancel since there can only be  
> one submit pr. submission element on the way, which might make the  
> submission miss the changes to the input done between the last  
> xforms-submit, xforms-submit-done.
>
> Best regards,
> David
>
Received on Tuesday, 4 April 2006 15:37:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:03 GMT