Search code examples
client-sideorbeonxforms

How to access the orbeon form data id on client-side?


In my application, I render my own page and inject the content of Orbeon URL /orbeon/fr/appname/formname/new?orbeon-embeddable=true in a div.

On save, I need to create a relationship between the form_data_id and my entity id. I can capture the click event on the save button but I haven't found the form_data_id on the Form DOM or any Orbeon JavaScript object.

Where is the form_data_id, or how expose it? Do you have another approach to create a relationship with the form_data_id?


Solution

  • If you're referring to Orbeon's document id, and you can use JavaScript in your own page, then use the following function call.

    ORBEON.xforms.Document.getValue("fr-parameters-instance-document")
    

    This will return a string, e.g. "4a1ae3c34a8e14e70c8fc3a02234a847d13896a9".