cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to display text <None> in an empty dropdown list

SOLVED
Amethyst

How to display text <None> in an empty dropdown list

Hi,

I have a dropdown list widget which is populated from a service which returns an infotable, it all works fine. However, there are times when it is perfectly valid for there to be no returned rows in the infotable. When this happens I would like to display the text "< none >" in the header row when the drop down is not activated. Ideally I'd like to use some form of state formatting so the text would be grey.

Does anyone know how I might achieve this? I have tried putting "< none >" in the TextNoSelection property for the widget, but this appeared to do nothing.

Thanks

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to display text <None> in an empty dropdown list

<none> gets sanitized but --none-- worked when I tried it in the TextIfNoSelection property.textIfNoSelection.png

6 REPLIES 6

Re: How to display text <None> in an empty dropdown list

I don't think there's an option to do it right on the widget properties. But you my try other approaches:

  1. When no rows, your service can return a fake row with (none) text, if you want to have a different formatting for this special row then you can use ListFormat for this special entry.
  2. You can play around with two widgets, (showing/hiding) them, I mean a Label widget and a DropDown, when your service doesn't returns any row you hide the dropdown and show the Label one and viceversa.

Best Regards,

Carles.

Re: How to display text <None> in an empty dropdown list

Hi Carles,

thanks for the quick reply. I Think I'll go with one of your options. I had thought of #2 but thought that maybe there was some built in list widget functionality I was missing. Do you know how the TextNoSelection ​widget property is supposed to work. Didn't seem to do anything for me, even when I didn't select any item in the list..

Thanks again.

Re: How to display text <None> in an empty dropdown list

Neither for me, never ever get it to work.

Highlighted

Re: How to display text <None> in an empty dropdown list

<none> gets sanitized but --none-- worked when I tried it in the TextIfNoSelection property.textIfNoSelection.png

Re: How to display text <None> in an empty dropdown list

Hi Mac,

apologies for the late reply. you're quite right, '-- none --' works fine.

Re: How to display text <None> in an empty dropdown list

Hi Carles,

hope you don't mind, I marked Mac's answer as correct instead as it seemed a better answer for people that might want to know.