Login  Register

two way js communications between parent and iframe content

Posted by DL on Jan 07, 2011; 7:57pm
URL: https://discuss.orbeon.com/two-way-js-communications-between-parent-and-iframe-content-tp3192702.html

This 3 year old thread covers my interest .. to use javascript in a parent wrapper page to invoke controls in an embedded xform

"How can I active the button on xforms page from javacript in parent IFrame?"

The answer was ..
Your code won't work because the element returned by
getElementById('buttonid') is a  element. Clicking the span won't cause the button to be activated.

Maybe try dispatching a DOMActivate to the button control instead. See the doc here:

http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-javascript-events

-Erik
Are there any wiki examples / tutorials I can refer to .. button in parent window js invokes js in iframe content to submit content of an xform to a database?

I am using a php CMS (Wordpress or Drupal interpreted by Quercus) as the container for iframe embedded xforms and I want the xform controls / submit buttons to be in the parent window and not in the embedded xform.

Conversely how can the embedded xform invoke javascript functions in the parent (CMS) window?  

i.e. parent-child js connection .. both ways?

...

Adding a further note of explanation ...

To give a specific example ...

If I place http://localhost:8080/orbeon/xforms-sandbox/sample/custom-events   

as one simple app in a wordpress iframe

how do I then call the <xforms:script> in this app from the parent window in which the "custom-events" xform is embedded?