Third Party Widget Integration

0
1

Is it possible to add a third-party widget to my WiseJ.net webpage? Specifically, I’m using Visual Studio VB.Net to integrate a “TradingView” widget into my WiseJ.Net webpage. The integration works in a WinForms app using WebView21, but the widget does not return any data when used on a WiseJ webpage. I’ve tried various approaches without success. Any advice would be greatly appreciated.

  • You must to post comments
0
0

Yes, you can integrate any JavaScript widget with Wisej.NET. You will need to use the Widget class in order to do the integration: https://docs.wisej.com/docs/controls/content/widget

I looked up TradingView, and they are JavaScript widgets, so they can certainly be integrated: https://www.tradingview.com/widget-docs/widgets/

When you say “does not return any data”, do you mean that the widget does not show the chart? Or is it showing the chart, but you’re trying to return additional information which is not being returned?
If the widget does not show the chart at all, make sure that you are setting the packages and options of the widget. You can set these in the designer.

For example, for this widget: https://www.tradingview.com/widget-docs/widgets/tickers/ticker-tape/ Based on the code example, you can see that the package source is https://s3.tradingview.com/external-embedding/embed-widget-ticker-tape.js

You will also need to set the options of the widget, which you can do in the designer. The options are a JSON object. You can read the Wisej documentation on widget options here: https://docs.wisej.com/api/wisej.web/content/widget#options

 

Additional Resources

There is a blog post that walks you through a widget integration with code examples: https://docs.wisej.com/docs/controls/content/widget

Other useful Wisej documentation:
https://docs.wisej.com/docs/concepts/javascript

 

You may also find it helpful to check the browser console for errors by pressing F12.

Hope this helps!
-Julie

  • Darrell Livingston
    Thank you for your prompt and thorough suggestions. Unfortunately, despite reviewing all the links you provided, I still can’t get any of the chart widgets to display. I’m not sure if I’m setting up the packages and options in the widget designer, or the widget initialization correctly. I managed to get the sample “add numbers” script to work, but not the TradingView widgets.
  • Darrell Livingston
    Could this error in Browser console be what’s causing the widget not to display the chart, “A preload for ” is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute”? If so, is it possible to fix? Thank you in advance.
  • Julie (ITG)
    Could be that it’s not a widget after all. If it was working in winforms in a webview2 (which is an embedded web browser), then it’s most likely an html page. It has to be used an an html page in a WebBrowser or IFramePanel control which is subject to the browser’s security. This would explain the error message you are getting that asks you to look at the crossorigin attribute (CORS). https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS Try the IFramePanel component instead of the widget component: https://docs.wisej.com/docs/controls/content/iframepanel
  • Darrell Livingston
    Finally got it to work! The key to fixing the issue was that in the Widget object’s initialization code you have to create container elements for the TradingView widget, and then append the container to the widget’s main element. Unlike in WinForms, you can’t simply embed the code into the widget. Thanks for your help… and great product!
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.