IBM DNG 6.0.5 Custom Widget post values via Rest
Hello,
I use to work with HttpConnectorParameters in rtc ccm jazz java script, but here when a invoke the library as a feature doesn't exist, so I wonder if there another way to post rest via url in a widget?
Thank you.
|
Accepted answer
You really should use an asynchronous approach for this but the async/await approach is still not supported by all browsers - or did you mean with the async parameter set to false/true?
I would try with the following and see what you get:
Rafael Rodriguez Montes selected this answer as the correct answer
Comments
Rafael Rodriguez Montes
commented Jul 11 '19, 8:21 p.m.
Thank you Davyd, this is what I got after adding your code. blank result, not sure where is failing.
Davyd Norris
commented Jul 11 '19, 8:37 p.m.
Couple of things:
- check my code, don't use true at the end of the open function
- can you show the console after the code runs? Do you get anything?
- can you add console.log(this); to the reqListener function? Let's have a look at the entire response object
Rafael Rodriguez Montes
commented Jul 11 '19, 9:12 p.m.
Davyd, thanks for your response, seems like is getting blocked because is not https? is just a request. do you know if can disable this check? or I will have to use https.
1
Davyd Norris
commented Jul 11 '19, 9:36 p.m.
Ah yes OK - you didn't post your actual URL before. You're going to have to switch to a secure call instead.
This is a general issue and has nothing to do with DNG - basically browsers don't like you when you use insecure HTTP calls from inside a secure HTTPS page. This article explains it well:
Rafael Rodriguez Montes
commented Jul 12 '19, 4:57 a.m.
Davyds, thanks!
it is working know I can see the response in the console, but in the listener can't recognize the req object, how do I pass the req to the listener ? 1
I had a small typo in my previous example code because I copied and pasted yours. Use
Rafael Rodriguez Montes
commented Jul 12 '19, 6:54 p.m.
thanks, it didn't throw any error, but now, still giving me null, as you can see in the console on the right side I receive the response, but still didn't refresh the widget.
thank you
a
Davyd Norris
commented Jul 14 '19, 2:56 a.m.
I can't really see that image, but try console.log(this) instead and see what the whole object is returning.
Rafael Rodriguez Montes
commented Jul 15 '19, 3:22 p.m.
it is printing in the widget with null if I use this.responseXML and is responding blank if I use just this.
I printed the response after send in the console and it is responding with the object response, so it is working, but now we need to refresh the widget once the response comes back.
Rafael Rodriguez Montes
commented Jul 15 '19, 3:43 p.m.
it works now, I just needed to print as text instead of xml Thank you.
showing 5 of 10
show 5 more comments
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
I'm trying to integrate with another tool, I'm using