- From: Scott Shattuck <idearat@mindspring.com>
- Date: Thu, 27 Apr 2006 12:22:08 -0600
- To: "'Xforms W3C WG'" <www-forms@w3.org>
Why not simply extend dispatch as in: <xforms:dispatch name="event-of-choice" repeat="1000" limit="5000" /> or, to allow dynamic computation and adjustment, the values could be XPaths which allow both the repeat and limit values to adjust based on current application state. Scott Shattuck Architect, Team TIBET ss@technicalpursuit.com 720.220.0159 -----Original Message----- From: www-forms-request@w3.org [mailto:www-forms-request@w3.org] On Behalf Of Erik Bruchez Sent: Thursday, April 27, 2006 11:58 AM To: Xforms W3C WG Subject: Re: XForms timer What about: <xforms:timer id="my-timer" timeout="1000" repeat="true"/> The timer will just fire an event, for example "xforms-timer", when necessary. <xforms:timer id="my-timer" timeout="1000" repeat="true"> <xforms:send ev:event="xforms-timer" submission="background-save"/> </xforms:timer> You probably need actions and/or events to start and stop a timer as well. But it looks easier than the Javascript below, no? ;-) -Erik Allan Beaufour wrote: > On 4/26/06, Erik Bruchez <ebruchez@orbeon.com> wrote: >> If you can't do it directly with XForms, how do you do it, with Javascript? > > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:xforms="http://www.w3.org/2002/xforms"> > <head> > <title>Timer</title> > <script type="text/javascript"> > function timer() { > var ev = document.createEvent("Events"); > ev.initEvent("increment", true, true); > document.getElementById("setv").dispatchEvent(ev); > window.setTimeout(timer, 1000); > } > > window.setTimeout(timer, 1000); > </script> > <xforms:model> > <xforms:instance xmlns=""> > <data xmlns=""> > <counter>1</counter> > </data> > </xforms:instance> > <xforms:setvalue id="setv" ref="counter" value=". + 1" > ev:event="increment"/> > </xforms:model> > </head> > <body> > <xforms:output ref="counter"> > <xforms:label>Counter: </xforms:label> > </xforms:output> > </body> > </html> > > -- > ... Allan > -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/
Received on Thursday, 27 April 2006 20:23:33 UTC