Saving form outside iframe

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Saving form outside iframe

stf85
I'm loading Orbeon Runner inside an iFrame, but i need to have a save button outside, in my application.

I can save the form using javascript but i don't know the result, i.e. if the form was successfully saved or there were validation errors.

Is possible to know the result of the save operation from the outside of the iFrame?

Ty  
Reply | Threaded
Open this post in threaded view
|

Re: Saving form outside iframe

Alessandro  Vernet
Administrator
Hi Ty,

Is the iframe content coming from the same host as the containing page? I imagine it is, and you are triggering the save operation by "simulating" a click on the save button inside the iframe from outside with JavaScript. Is that correct? If it is, in the same way, you should be able to see if the message that then gets displayed in the iframe is a success or a failure.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Saving form outside iframe

stf85
Hi Alex,

My goal is click on button outside the iFrame, that "click" the hidden button inside, and if the save is successful redirect to other page.

For that i need to know the result of the save action outside the iFrame, i.e, in js code on my button, instead of waiting for the result page to render and search for the success message.

Ty
Reply | Threaded
Open this post in threaded view
|

Re: Saving form outside iframe

Alessandro  Vernet
Administrator
Hi Ty,

When users save, if the operation is successful, the page updates with the following message:



What I was trying to say is that if you already have JavaScript running outside of the iframe that looks at the content of the iframe, say to simulate a click on the save button, you could as well detect that this message was shown. And you would know that "instantly", as soon as the message shows (I am not suggesting you setup Orbeon Forms to redirect users to another page on successful save). Does this make sense?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet