Book a Demo

Author Topic: Using AddTab to add Web Browser control  (Read 5078 times)

Mhatch

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Using AddTab to add Web Browser control
« on: May 02, 2014, 07:08:28 am »
I would like to create a custom view using HTML5, CSS, and JavaScript by adding a new tab within Sparx by calling
Code: [Select]
Repository.AddTab() with parameters such as
Code: [Select]
AddTab("ViewName", "InternetExplorer.Application") and then injecting HTML and script, etc., but this doesn't work?

I know that it is possible to create a new custom control that rehosts a web browser control to do this, but then I have to deploy that, whereas everyone on my network should already have this component available.

Is it possible to enable this scenario?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Using AddTab to add Web Browser control
« Reply #1 on: May 02, 2014, 08:19:05 am »
Doesn't EA have a build-in browser?

q.

Mhatch

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Using AddTab to add Web Browser control
« Reply #2 on: May 02, 2014, 08:40:49 am »
Yes, but I do not see the documentation for how to access it and automate it from scripts?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Using AddTab to add Web Browser control
« Reply #3 on: May 02, 2014, 09:03:17 am »
I don't know what language you're using, but I expect the problem is that you're using the wrong activex control.

When using C/C++ there are two different class ids representing internet explorer. CLSID_InternetExplorer and CLSID_WebBrowser, the difference between them is that CLSID_InternetExplorer is created in its own process whereas CLSID_WebBrowser is the in-process version.

Based on that I imagine that you'll get your code working by changing InternetExplorer.Application to something with WebBrowser in the name.

Mhatch

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Using AddTab to add Web Browser control
« Reply #4 on: May 02, 2014, 10:25:26 am »
Yeah, now that you mention it, I remember chasing this some while back.  I was never able to figure out what the ProgID for the WebBrowser control was that would successfully instantiate inside of the AddTab method and gave up.

In this world of HTML5+CSS+JavaScript apps, it would be really useful to be able to create new visualizations on Sparx data within the UI using this approach (Scripts that launch a browser window and inject the visualization).

Any other ideas out there?  Thanks!