1

[Spotfire]How to use the same spotfire Document property control element across different tabs of Spotfire dashboard to trigger Ironpython script ? Currently I have a javascript that sets the documentproperty via a Documentproperty control which activates the Ironpython script. We use JQuery UI dialog for the javascript. I want to have this property available to all tabs within the Dashboard. How should I define the Documentproperty control so it can be used to activate the Ironpython script from any tab ?

I created a floating JS control, but this does not update the documentproperty if I switch tabs. The only solution that works currently is if I create a documentProperty control in a Text area for each tab.

    $("#testInput").dialog({

    autoOpen: false,

   }); 

$("#myAlertButton").click(openDialog);

function openDialog(){

      $("#testInput").dialog( "open" );

}

function refresh(){
    document.location.reload();
    }

I expect the floating control value to be reflected in the documentProperty, but it does not change.

2 Answers2

2

Is it necessary that it float? If it doesn't need to float, just reuse the property in a text area and then you don't need JavaScript for this.

BMAnalytics
  • 114
  • 7
  • this is the Y to the X, I think ;) hard to say what OP is truly trying to achieve, but this is the easiest solution based on my interpretation, too. – niko May 23 '19 at 04:25
1

I don't believe this is possible.

turn on Developer Tools under Tools>>Options>>Application: Show developer tools, then open it under Tools>>Development>>Developer tools.

now expand the DOM a bit and find some element in the current page of your analysis. change the page. you'll see that the previous page isn't hidden; it's completely removed from the DOM.

now, you may be able to hack around this by injecting your #testInput above the page with something like $("body").append("#testInput");. this would probably keep it in the DOM through page changes, but I haven't tested this and it certainly isn't supported behavior.

keep in mind that, especially in version 10 and above, the entire interface is the DOM, even in the Analyst client. messing with the outer DOM structure can break the whole interface if you're not careful. do a lot of testing :)

niko
  • 3,946
  • 12
  • 26
  • 2
    Thanks Niko. Let me try this and get back. This solution might not scale especially when we deploy as a general library. But thank you for your input. – Krishnaprabha Chari May 21 '19 at 17:26
  • 1
    would love to know how you wind up solving this. it seems like an interesting use case :) – niko May 21 '19 at 17:54