Jump to content
  • How to open a URL in Spotfire® Using IronPython Scripting


    This article explains how to create and open a URL specifically in the Spotfire Web Player using IronPython.

    Introduction

    When you execute an IronPython script on the Web Player, the script is executed on the Web Player server and not the client browser. You will need an HTML form based solution for your script to work on the Web Player. One possible solution is to use an HTML text area.  Here are the steps to implement:

    1. Add/Insert a new TextArea and name it "HTML" in your page.
    2. Update your IronPython script to add the following, to generate a link:
    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Application.Visuals import HtmlTextArea
    varurl="https://www.google.com/""
    dynamic.As[HtmlTextArea]().HtmlContent = "<a href="" + varurl + "">Click to open link" + "</a>"
     

    3. Then add the "HTML" text area visualization as a script parameter and name it 'dynamic'. This will create a hyperlink text that the user can click to launch a new window/tab and it will work properly in Web Player. Attached is a sample analysis file.

    References

    License:  TIBCO BSD-Style License

    Back to IronPyton Scripting in Spotfire Examples
     

    Attachments

    Download attachment from Resources.

    generateurl.dxp


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...