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

**URL:** https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835
**Category:** Dashboard
**Created:** [28 July 2020 17:07 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835 "2020-07-28T17:07:21Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)
#### Post date: [28 July 2020 17:07 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/1 "2020-07-28T17:07:21Z")

</div>

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_](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/98abb78117558e205168851c84d2369cb793fce3.gif)  
**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

 ![dropdown](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/a/da472ee0864b0fc6c7c432f7f70a15ce07b3ac54.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/a/ba02e523a015bcad10686cd9121049af5becbca0.png)

1. in the debug node, it is the first box which is well checked

```auto
[{"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

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [28 July 2020 17:30 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/2 "2020-07-28T17:30:15Z")

</div>

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

---

<div class="post-metadata">

### Author: ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)
#### Post date: [28 July 2020 17:58 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/3 "2020-07-28T17:58:51Z")

</div>

Hi Andrei ,  
haha! I raised an issue ! 🤪

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [28 July 2020 18:44 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/4 "2020-07-28T18:44:13Z")

</div>

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

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [28 July 2020 22:27 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/5 "2020-07-28T22:27:39Z")

</div>

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

---

<div class="post-metadata">

### Author: ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)
#### Post date: [29 July 2020 05:21 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/6 "2020-07-29T05:21:46Z")

</div>

i will ! Let me found free times

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [29 July 2020 12:13 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/7 "2020-07-29T12:13:48Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [29 July 2020 13:16 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/8 "2020-07-29T13:16:33Z")

</div>

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

```auto
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 ...

---

<div class="post-metadata">

### Author: ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)
#### Post date: [29 July 2020 14:47 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/9 "2020-07-29T14:47:17Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/9941ea564217ec71480eb190c0e63fef5b63fa7f.png)  
... which allows more than one boolean.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [29 July 2020 15:17 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/10 "2020-07-29T15:17:54Z")

</div>

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 🙂

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0dd64a4453bcef97589fb4929e9d4235026a7f83.png)

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [29 July 2020 16:45 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/11 "2020-07-29T16:45:51Z")

</div>

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 😃

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 ⚒ to take it as near next thing into my todo list...

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [29 July 2020 22:48 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/12 "2020-07-29T22:48:23Z")

</div>

I'm thinking something like this  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/6/a66a4c5e7301bb3077496d0fd0920dc8f7c78b6b.png)  
and yes validation slightly simpler 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [28 August 2020 22:48 UTC](https://discourse.nodered.org/t/problem-with-the-drop-down-list-and-check-boxes-in-the-dashboard/30835/13 "2020-08-28T22:48:25Z")

</div>

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