Hello All, How to change a record based on time in Xforms . I have to
show each record for every 5 seconds .is there any event in xforms that will
trigger based on time Thanks, Srikanth -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Hi Srikanth,
> How to change a record based on time in Xforms . I have to show each > record for every 5 seconds .is there any event in xforms that will > trigger based on time AFAIK there's no "pure xforms" solution for this, but you could use javascript to generate an event every some seconds. I use a PeriodicalExecuter [1] provided by the Prototype JavaScript library to backup the instances in the background every 40 seconds during editing sessions. On xforms-ready, the following javascript is called: function initAutoSave() { var perEx = new PeriodicalExecuter(function(pe) { ORBEON.xforms.Document.dispatchEvent("main-model", "autosave"); }, 40); if (!perEx){ window.alert("Backup im Hintergrund konnte nicht instantiiert werden!"); return; } else { window.status = "Backup im Hintergrund instantiiert!"; } }; This dispatches a custom event to the xforms model every 40 seconds, and it's easy to adapt it for other needs. You will have to modify the epilogue so that the prototype library js file is loaded. hth florian [1] http://www.prototypejs.org/api/periodicalExecuter -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Florian, Srikanth:
Good advice, but in fact there is an XForms solution, with the XForms 1.1 @delay attribute on xforms:dispatch. Check the dispatch- delay.xhtml sample in the sandbox. E.g.: <xforms:dispatch name="my-event" target="my-model" delay="1000"/> For convenience I pasted the example here: http://www.pastie.org/400721 -Erik On Feb 25, 2009, at 11:10 PM, Florian Schmitt wrote: > Hi Srikanth, > >> How to change a record based on time in Xforms . I have to show each >> record for every 5 seconds .is there any event in xforms that will >> trigger based on time > > AFAIK there's no "pure xforms" solution for this, but you could use > javascript to generate an event every some seconds. I use a > PeriodicalExecuter [1] provided by the Prototype JavaScript library to > backup the instances in the background every 40 seconds during editing > sessions. On xforms-ready, the following javascript is called: > > function initAutoSave() { > var perEx = new PeriodicalExecuter(function(pe) { > ORBEON.xforms.Document.dispatchEvent("main-model", > "autosave"); > }, 40); > if (!perEx){ > window.alert("Backup im Hintergrund konnte nicht > instantiiert werden!"); > return; > } else { > window.status = "Backup im Hintergrund instantiiert!"; > } > }; > > This dispatches a custom event to the xforms model every 40 seconds, > and > it's easy to adapt it for other needs. You will have to modify the > epilogue so that the prototype library js file is loaded. > > hth > florian > > [1] http://www.prototypejs.org/api/periodicalExecuter > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Hello Erik,
Dispatch event is triggered on DOMActivate method. Is there any way to trigger the dispatch event on page load? I have tried it for xforms ready and model construct done event it did not help. Thanks, Srikanth -----Original Message----- From: Erik Bruchez [mailto:[hidden email]] Sent: Thursday, February 26, 2009 12:57 PM To: [hidden email] Subject: [ops-users] Re: Re: Randomly change a record based on time Florian, Srikanth: Good advice, but in fact there is an XForms solution, with the XForms 1.1 @delay attribute on xforms:dispatch. Check the dispatch- delay.xhtml sample in the sandbox. E.g.: <xforms:dispatch name="my-event" target="my-model" delay="1000"/> For convenience I pasted the example here: http://www.pastie.org/400721 -Erik On Feb 25, 2009, at 11:10 PM, Florian Schmitt wrote: > Hi Srikanth, > >> How to change a record based on time in Xforms . I have to show each >> record for every 5 seconds .is there any event in xforms that will >> trigger based on time > > AFAIK there's no "pure xforms" solution for this, but you could use > javascript to generate an event every some seconds. I use a > PeriodicalExecuter [1] provided by the Prototype JavaScript library to > backup the instances in the background every 40 seconds during editing > sessions. On xforms-ready, the following javascript is called: > > function initAutoSave() { > var perEx = new PeriodicalExecuter(function(pe) { > ORBEON.xforms.Document.dispatchEvent("main-model", > "autosave"); > }, 40); > if (!perEx){ > window.alert("Backup im Hintergrund konnte nicht > instantiiert werden!"); > return; > } else { > window.status = "Backup im Hintergrund instantiiert!"; > } > }; > > This dispatches a custom event to the xforms model every 40 seconds, > and > it's easy to adapt it for other needs. You will have to modify the > epilogue so that the prototype library js file is loaded. > > hth > florian > > [1] http://www.prototypejs.org/api/periodicalExecuter > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
On Feb 26, 2009, at 2:47 AM, Srikanth A wrote:
> Dispatch event is triggered on DOMActivate method. Is there any way to > trigger the dispatch event on page load? I have tried it for xforms > ready > and model construct done event it did not help. Good catch. Added a bug for this: http://forge.objectweb.org/tracker/index.php?func=detail&aid=313061&group_id=168&atid=350207 A workaround is to use a <xxforms:script> in your xforms-model- construct-done which uses a ORBEON.xforms.Document.dispatchEvent() which in turns run the <xforms:dispatch delay="1000"/>. Yes, this is not ideal; I agree. For more on ORBEON.xforms.Document.dispatchEvent(), see: http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-javascript-events Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |