Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Icon in Spotfire fades but does not disappear

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
country selectedcountry output

then None is selected
none selectednone output

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:

enter image description here

How do I make the icon disappear if no country is selected?

like image 782
thatsawinner Avatar asked Oct 19 '22 02:10

thatsawinner


1 Answers

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.

like image 109
niko Avatar answered Oct 21 '22 00:10

niko