Get Response from Orbeon Persistence during Save

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

Get Response from Orbeon Persistence during Save

kiskandar
We're trying to extend the functionality of the save button in Orbeon 4.10 to call a JavaScript function to refresh a list, however the JavaScript function requires some values that are available in the response of the PUT request of our implementation of the Orbeon Persistence API.

Is it possible to do this at all?

Kind regards
Kris
Reply | Threaded
Open this post in threaded view
|

Re: Get Response from Orbeon Persistence during Save

Alessandro  Vernet
Administrator
Hi Kris,

Right now, save() ends up running the fr-create-update-attachment-submission submission in universal-submission.xml, which does a replace="none", so whatever is returned by your persistence API during a save() gets discarded.

Instead, would your JavaScript be able to make an Ajax query to a service you provide after the save(), and depending on the result take the appropriate action? I think this would reduce the coupling between the Orbeon persistence API and what you're trying to do (i.e. not trying to add this information "on top" of the persistence API, which is a way is a chance of that API).

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

Re: Get Response from Orbeon Persistence during Save

kiskandar
Thanks for the suggestion Alex. This works well for our issue.