API call back handler on UI side while saving the form

74 views
Skip to first unread message

Jay

unread,
Jun 22, 2018, 12:47:21 PM6/22/18
to orb...@googlegroups.com
Hi

We have angularjs application. we have used the iframe to display orbeon
form in our application.
Firstly integrated the orbeon form using java embedding api
https://doc.orbeon.com/form-runner/linking-and-embedding/java-embedding-api
able to access orbeon form from the jsp application, Jsp application
provides form url that url called by iframe from angularjs application,
Orbeon form is displayed in my angularjs application.

When click the send button send action will call the API to save orbeon form
data in DB,
This action we confirgured on property file like below

We want to get the response on our UI side without redirect on any page,
Like you mention navigate action, Can I get response on this action when

I write javascript method for example
<property as="xs:string"
name="oxf.fr.detail.process.send.Sapphire.Questionnaire-demo">
send( uri =
"http://localhost:8181/api/orbeon/data?patientid={xxf:get-request-parameter('patientid')}%26questionnaireid={xxf:get-request-parameter('questionnaireid')}%26action=save",
method = "POST",
content = "xml")
then navigate(uri = "javascript:myFunction()")
</property>


Thanks,
Jay

--
Sent from: http://discuss.orbeon.com/

Jay

unread,
Jun 25, 2018, 4:43:19 AM6/25/18
to orb...@googlegroups.com

Erik Bruchez

unread,
Jun 26, 2018, 1:51:15 AM6/26/18
to orb...@googlegroups.com
> We want to get the response on our UI side without redirect on any page,
Like you mention navigate action, Can I get response on this action when I
write javascript method

I am sorry but I don't understand your question. Can you please clarify? Are
you able to call your `javascript:myFunction()` function? What else is
missing?

-Erik

Jay Singh

unread,
Jun 26, 2018, 3:14:29 AM6/26/18
to Orbeon Forms
I am able to call the 'javascript:myFunction()', but I needs to get API response in my application, 
how can I get the API response in my application without redirecting to any url.  

Erik Bruchez

unread,
Jun 29, 2018, 8:55:39 PM6/29/18
to orb...@googlegroups.com
Where is your application? Client-side, in JavaScript, or server-side?

Is the response you mention from the call to `myFunction()`?

Jay Singh

unread,
Jul 2, 2018, 3:57:57 AM7/2/18
to Orbeon Forms

Hi Ebruchez, 

Angularjs App (client side, used iframe to display orbeon form) ==> Orbeon integration App (Java integration API)  ==> Orbeon form ==> Backend App(API which calling from orbeon properties file on send action)
This is the flow of my application,
When I click on send button the orbeon form calling the Backend API of my back-end api app, but unable to get response from this API, Actually this api returns the JSON object response. So I needs to get this response in orbeon form and sent to my Angularjs app from orbeon. so, how can I save send the response to my angular ui ?


Thanks 
Jay

darshan jain

unread,
Apr 15, 2020, 12:35:20 PM4/15/20
to orb...@googlegroups.com
Hi Erik, I am also having the same requirement. I am using send action on buttons.save and I would like to get a response from Send action into javascript function at the client-side. Please find below the send action code from the property file. send( uri = "http://localhost:8181/mydemoapi/", method = "POST", content = "xml" ) then navigate(uri = "javascript:myFunction()") I would like to get http://localhost:8181/mydemoapi/ response in myFunction().

Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

Erik Bruchez

unread,
Apr 16, 2020, 1:52:05 AM4/16/20
to orb...@googlegroups.com
For reference, this was handled via a private conversation.

-Erik

Nick Tates

unread,
Sep 28, 2021, 10:17:58 AM9/28/21
to Orbeon Forms
Hi:

Does then navigate(uri = "javascript:myFunction()") work or was the prior comments a question? I am not sure if the last comments were a question or a mention of the private conversation.

Thanks,

Alessandro Vernet

unread,
Sep 29, 2021, 1:04:13 AM9/29/21
to Orbeon Forms
Hi Nick,

The last comment was just to mean this topic was discussed and resolved elsewhere. But yes, in general you can use `then navigate(uri = "javascript:myFunction()")`. And let us know if you've encountered any issue with that technique to run custom JavaScript code from a process.

-Alex

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/634f4ec6-0508-4c73-a2b8-102655b0d93an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages