Jump to content

Recommended Posts

Posted

Hi all,

I'm trying to replicate a textarea (including SpotfireControls) to other textarea's. I have setup the following script to set a Visual object, however the object is never "initialized". Can't find any examples of this being done. Hope you can help!

Regards Arthur

import Spotfire.Dxp.Application

for vis in Document.ActivePageReference.Visuals:

if vis.Title == 'Source':

html = sourceTA

Posted

Hello Arthur,

It is possible to copy the HTML content of the text area but you can not add the spotfire controls to the new text area using script. The SpotfireControl Id's must be unique within each text area.

The easiest way to replicate a Text Area is to RightClick on Text Area and Select Duplicate Visualization. This creates a new Text Area along with SpotfireControls which have new GUID's

Below is a sample code to add the HTML content from one text area to another

=======

from Spotfire.Dxp.Application.Visuals import *

activePage=Document.ActivePageReference

for vis in activePage.Visuals:

if vis.Title == 'Text Area':

srchtml=vis.As[HtmlTextArea]().HtmlContent

deshtml=activePage.Visuals.AddNew[HtmlTextArea]()

deshtml.Title="New Text Area"

deshtml.HtmlContent=srchtml

===============

  • 1 year later...
Posted
The easiest way is to right click on the text box > duplicate visualization and drag&drop it into another tab. Don't worry if the new text box don't look the same when in the same page, after you drop it into another page it should work fine. It took me hours to find this solution but I finally did it.

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...