Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

List Box with Traffic Lights

Hi

I have a field called "Sig" - there are 3 values :

-1

1

I want to create a list box with 3 traffic  lights instead of values that I can filter on.

Green traffic light (Value=1)Yellow Traffic light (Value=0)Red Traffic light Yellow Traffic light (Value=-1)

Seem to be having trouble achieving this.

Thanks

T

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Use an expression for the listbox:

=if(Sig=-1,'qmem://<bundled>/BuiltIn/led_r.png',if(Sig=0,'qmem://<bundled>/BuiltIn/led_y.png','qmem://<bundled>/BuiltIn/led_g.png'))

Then on the Presentation tab change the Representation from Text to Image.You may also want to change the Image Formatting setting and the Multiline settings.

See attached qvw


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

Use an expression for the listbox:

=if(Sig=-1,'qmem://<bundled>/BuiltIn/led_r.png',if(Sig=0,'qmem://<bundled>/BuiltIn/led_y.png','qmem://<bundled>/BuiltIn/led_g.png'))

Then on the Presentation tab change the Representation from Text to Image.You may also want to change the Image Formatting setting and the Multiline settings.

See attached qvw


talk is cheap, supply exceeds demand
MayilVahanan

Hi

Try like this also

list box expression

Pick(Match(Sig,-1,0,1),'qmem://<bundled>/BuiltIn/led_r.png','qmem://<bundled>/BuiltIn/led_y.png','qmem://<bundled>/BuiltIn/led_g.png')

Then on the Presentation tab change the Representation from Text to Image

Image formatting - Keep aspect

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Silly question …..but your links… 'qmem:///BuiltIn/led_r.png'

Do I need to save an image of each traffic light on my computer and then link to the expression?

fkeuroglian
Partner - Master
Partner - Master

Yes Roderick, you have to have the correct root for all the pictures you will use in the local pc or the server

Not applicable
Author

Excellent- thanks guys.  Two last questions : 1.) Can I centre the images? (I have hidden the test and they show up on the right of the list box)  2.)Can I hide the null selection so that it just shows my three traffic lights?  Thanks!