Re: [Chiba-users] submit through javascript
Creators discontinued Chiba & founded betterFORM http://betterform.de
Brought to you by:
chibaxforms,
windauer
From: bergamot <ar...@ma...> - 2010-01-13 12:07:54
|
Thanks! That's exactly what I was searching for. I tried the second method and it works perfectly. Kind regards Joern Turner wrote: > > On Tue, Jan 12, 2010 at 3:20 PM, bergamot <ar...@ma...> > wrote: >> >> Hi, >> >> I'm trying to trigger a submission to submit when an external event (XHR >> succeeds) occurs. Is there any way in Chiba 3.0.0b2 (or dojo) to get the >> xforms-submit event delivered to the submission element? > Hope i got it right - you try to trigger a submit from the client-side > right? > > Ok, there are 2 possible ways to do that: > 1. define a trigger in your form with a send action to trigger the > submit you want, give it an id and hide it from display with > style="display:hidden". To activate that trigger from the client > you'll then have you can call fluxProcessor.dispatchEvent(CONTROLID); > Be aware that you'll have to use your original id with '-value' > appended e.g. if your trigger has the id 'foo' you'll have to call > fluxProcessor.dispatchEvent("foo-value",sessionKey); This is because > the actual widget will always get the id of the XForms control with > '-value' appended. > > 2. you can try to directly dispatch the relevant event (xforms-submit > in this case) to the submission. To do that you have to know the id of > your submission and call fluxProcessor.dispatchEventType(SUBMISSIONID, > "xforms-submit",sessionKey); > > For both methods you need the sessionKey with is an attribute on > fluxProcessor. You can get the value by > dojo.attr(dojo.byId("fluxProcessor"),"sessionKey"); > > hth >> >> Thanks in advance! >> -- >> View this message in context: >> http://old.nabble.com/submit-through-javascript-tp27128236p27128236.html >> Sent from the chiba-users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and >> easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> Chiba-users mailing list >> Chi...@li... >> https://lists.sourceforge.net/lists/listinfo/chiba-users >> > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Chiba-users mailing list > Chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiba-users > > -- View this message in context: http://old.nabble.com/submit-through-javascript-tp27128236p27143856.html Sent from the chiba-users mailing list archive at Nabble.com. |