Jump to content

Open a webpage from IronPython


Brian Deadwyler

Recommended Posts

All,

I have a Graphical table which displays some cells which I would like to click and have them take me to a specific web page. I got his working two different ways in the Enterprise Client but can not get it to run in the Web Client. Here is the basical IronPython code I can run in the Fat Cleint but not in the web client:

 

from System import Diagnostics

from System.Diagnostics import Process

Process.Start("www.google.com")

 

I can also get this to work, but only in the fat client:

 

import clr

clr.AddReference("System.Windows.Forms")

from System.Windows.Forms import WebBrowser

wb = WebBrowser()

wb.Navigate("www.google.com", True)

 

It seems like it would it would be simple to just open a URL in the default browser. Any help on this is appreciated. Thanks,

Link to comment
Share on other sites

  • 2 years later...

This script was used to make a button to pop open a webpage. I spoke with support and it was in a tip of the week from Kevin Hanegan originally but the script did not work without the breaks in it. You might be able to hack out peices from it.

 

from Spotfire.Dxp.Application.Visuals import HtmlTextArea

from Spotfire.Dxp.Application.Visuals import VisualTypeIdentifiers

from System.Text import StringBuilder

 

from Spotfire.Dxp.Application.Visuals import HtmlTextArea

from Spotfire.Dxp.Application.Visuals import VisualTypeIdentifiers

from System.Text import StringBuilder

 

 

sb = StringBuilder()

 

sb.AppendLine("")

sb.AppendLine("")

sb.AppendLine("")

sb.AppendLine("")

 

 

textArea = Document.ActivePageReference.Visuals.AddNew[HtmlTextArea]()

textArea.AutoConfigure()

textArea.HtmlContent = sb.ToString()

Link to comment
Share on other sites

Just an update . . . I opened a support ticket with TIBCO on this. In their first reply they basically gave me what madelman had above. It makes me wonder if TIBCO support just starts browsing forumns for a solution.

 

I replied, as I did here, that that that solution is not a solution for my requirement. Well meaning, but not helpful. I will update here if I can get a solution from them.

Link to comment
Share on other sites

  • 11 months later...
  • 1 year later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...