Problem with the drop-down list and check boxes in the Dashboard

Node Red v1.1.2
node-red-dashboard : 2.23.0
npm: '6.14.4'
Node.js version: v10.21.0
RPI 3b : raspbian

dropdown_checkbox_list_
when I click on the boxes, the check marks do not appear in the right place

  1. i clic on the first "ptz" case
  2. it's the 3rd case checked


  1. in the debug node, it is the first box which is well checked
[{"id":"40a8fd04.fb4c54","type":"debug","z":"a8b1b208.7036f","name":"Dashboard Log","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":430,"y":2870,"wires":[]},{"id":"652cc5eb.2734fc","type":"ui_dropdown","z":"a8b1b208.7036f","name":"alertActivation","label":"","tooltip":"","place":"alert activation","group":"46182ac5.494ea4","order":2,"width":0,"height":0,"passthru":true,"multiple":true,"options":[{"label":"ptz","value":true,"type":"bool"},{"label":"misecu","value":true,"type":"bool"},{"label":"ptz20","value":true,"type":"bool"}],"payload":"","topic":"alertActivation","x":190,"y":2870,"wires":[["40a8fd04.fb4c54"]]},{"id":"46182ac5.494ea4","type":"ui_group","z":"","name":"camAlerte","tab":"250de740.57ee78","order":10,"disp":true,"width":6,"collapse":true},{"id":"250de740.57ee78","type":"ui_tab","z":"","name":"Dashboard","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Did I do something wrong or is it a Bug?

Chris

Hi Chris, same happening in my environment when using your flow.

28 Jul 14:16:23 - [info] Node-RED version: v1.1.1
28 Jul 14:16:23 - [info] Node.js version: v12.16.3
28 Jul 14:16:23 - [info] Windows_NT 10.0.19041 x64 LE
28 Jul 14:17:39 - [info] Dashboard version 2.23.0 started at /ui

Hi Andrei ,
haha! I raised an issue ! :crazy_face:

1 Like

Interesting, it only happens when you are using more than one boolean

Did you ? I can't see it on github. Thanks

i will ! Let me found free times

Ah right - yes - the values in the left column must all be different - so indeed when boolean you can only have one true and one false... setting more than that will cause this as that is the value of the variable - the display name is just what is shown so when it comes to re-interpret the value it doesn't know which name to pick... so yes - it is actually "working"... but needs better checking/docs.

1 Like

Options seems can be validated against "if boolean type then those must be unique"
May be something like this

options: {value:[{value: '', label : ''}],
                validate:function(v){
                    var booleans = v.filter(opt => opt.type && opt.type === 'bool')
                    var unique = [...new Set(booleans.map(opt => opt.value))]
                    return booleans.length == unique.length
                }
            }

But then that invalid state must be communicated to user somehow cos this situation is far from self-explaining ...

1 Like

Indeed, we could have the same operation as the form-node ...


... which allows more than one boolean.

well we also need to check numbers vs numbers, strings etc and boolean false vs false etc.... as setting the values to a a a is just as bad :slight_smile:

I think a Note: next to the option button to say "each Value must be unique" will help.

Seems to me that "true" and true treated as different things in widget logic thus
for all values to be unique it just takes one line less of validation code :smiley:

I have same sort of validation created for state-trail and artless gauge so if anybody interested to contribute, can look at them as (not best in the world but something) example.
I am currently a bit too busy :hammer_and_pick: to take it as near next thing into my todo list...

I'm thinking something like this
image
and yes validation slightly simpler :slight_smile:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.