I have a listbox in Spotfire with countries in it. The listbox includes (None) as a selection option. When a country is selected in the listbox the country's name and a star icon appears in another test panel. After that, if (None) is selected, the country' name disappears but the star only fades out. I need it to disappear just as the text does.
Here's an example:
USA is selected
then None is selected
Here is the javascript I have in the panel for the output. The intention is to not display the icon if None is selected.
$("#b67963fdb4724d11b744affb05048a23").on('change',function(){
$("#b67963fdb4724d11b744affb05048a23 option:selected").text()=="None"?
document.getElementById($("#9bf3680df22140b9955b39c8ba6cfff8")).style.display = "hidden" :
document.getElementById($("#9bf3680df22140b9955b39c8ba6cfff8")).style.display = "visible"
})
Here's the icon properties:
How do I make the icon disappear if no country is selected?
the faded out behavior happens when there is a null value, but some other rule was matched before the selection changed. this behavior is probably a bug.
you can see the behavior you want if you select a country that doesn't begin with R, A, U, or C; selecting KOREA
, for example, would make the icon disappear because there is no rule that covers Starts with K
, and the value is not null. selecting (None)
next would correctly display no icon.
you can change the null output using the SN()
function ("SubstituteNull"). by providing a value that is both NOT NULL and not matched by any rule, the icon won't show. your formula would be:
SN(UniqueConcatenate([Country]), '_')
choose any character you like; it doesn't have to be _
, but it should match the datatype of the column.
this behavior is the same for Icon columns in a Graphical Table. this workaround applies as of Spotfire 7.6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With