Jul 25, 2016

Spotfire Property control validation using python script



Fund=Document.Properties["Fund"]
Document.Properties["FundError"]="";

if Fund<>"Select":
Document.ActivePageReference = Document.Pages[3]
else:
Document.Properties["FundError"]="Please select a fund."

Show/Hide Input Text Box based on Dropdown Selection using Jquery

using Jquery


//Triggering the script if Drop Down selection is varied
$("#163473c4bab648778b3e64c40463e3fc").change(function()

{
    var value = $("#163473c4bab648778b3e64c40463e3fc").val();  //To capture the index
    var vt = $("#163473c4bab648778b3e64c40463e3fc option:selected").text(); //To Capture the  selected text
    if(vt== "Enable")   //If the Drop Down selected value is Enable
    {
        $("#c8b6b12144864ec5889005c6260a4b08").show(); //Making the Input Box visible
    }
    else
    {
        $("#c8b6b12144864ec5889005c6260a4b08").hide(); //Making the Input box element hidden
    }
}
);

Limit multi selectlist values in spotfire using Java script

$("#1f26c088453c4877a82e02b276e6fdf1").change(function()
{
var options = $('#1f26c088453c4877a82e02b276e6fdf1 > option:selected');
         if(options.length > 3){
             alert('You have selected more than three; ');
             return false;
         }
    });

Find test in Spotfire list box property control using python script

a = ['BVI Ltd','sdfdsf','df'];
index = dict((y,x) for x,y in enumerate(a))

try:
a_index = index["BVI Ltd"]
print a_index
except KeyError:
   print "Not found"
else:
   print "found"