API call back handler on UI side while saving the form

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

API call back handler on UI side while saving the form

Jay
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/

--
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 [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: API call back handler on UI side while saving the form

Erik Bruchez
Administrator
> 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


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

--
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 [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: API call back handler on UI side while saving the form

Jay Singh
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.  

On Tuesday, June 26, 2018 at 11:21:15 AM UTC+5:30, ebruchez wrote:
> 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


--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.com/

--
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 [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: API call back handler on UI side while saving the form

Erik Bruchez
Administrator
Where is your application? Client-side, in JavaScript, or server-side?

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


-Erik

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

--
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 [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: API call back handler on UI side while saving the form

Jay Singh

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

--
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 [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: API call back handler on UI side while saving the form

darshan jain
In reply to this post by Jay
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.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1586889589034-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: API call back handler on UI side while saving the form

Erik Bruchez
Administrator
For reference, this was handled via a private conversation.

-Erik

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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1587016322854-0.post%40n4.nabble.com.