# Bug in valuelist display in checkbox?

**URL:** <https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609>\
**Category:** Classic Servoy\
**Created:** [August 31, 2004, 2:12pm UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609 "2004-08-31T14:12:26Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmad](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ahmad](https://forum.servoy.com/u/ahmad)\
**Post date:** [August 31, 2004, 2:12pm UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609/1 "2004-08-31T14:12:26Z")

</div>

Hi,

I set a custom valuelist called “languges” using the SQL query in the startup

```auto
frmObj = globals.nav_commonScripts('getFrmObj');
globals.set_valueLists('setValueListsSql', 'language' ,'value1');

case "setValueListsSql": 
      valueListName = param1;
      actualFieldValue = param2;
        SQL = "SELECT " + actualFieldValue + " FROM valuelist WHERE valuelist_name = '" + valueListName + "'";
        var resultArr = databaseManager.getDataSetByQuery(frmObj.controller.getServerName(), SQL, null, 1000);
        var totalRows = resultArr.getMaxRowIndex();
        application.setValueListItems(valueListName, resultArr);
      }
break;

```

The value list is set and displays correctly if the display type = combobox

But when I change the display type to Checkbox one of the values is disappeared

(say if I have 4 subjects English, French, Arabic, Hebrew it does not display English)

But when I change the display type to combo then all the 4 values are displayed

Seems to be a bug..

Thanks

---

<div class="post-metadata">

**Author:** ![ahmad](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ahmad](https://forum.servoy.com/u/ahmad)\
**Post date:** [September 2, 2004, 2:56am UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609/2 "2004-09-02T02:56:01Z")

</div>

Dear Jan / Johan,

any investigation on this??

Thanks

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [September 2, 2004, 10:53am UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609/3 "2004-09-02T10:53:34Z")

</div>

What is the state of allow empty value of youre valuelist?

If you enabled this then the first value will be removed (this is how it works with normal valuelist. We add a empty value to the top and remove that one if we display them as a checkbox.  
So when you are setting values youreself in such a valuelist you have to add an empty value to the top yourself.

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [March 12, 2006, 6:13pm UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609/4 "2006-03-12T18:13:04Z")

</div>

I am just struggling with this. I try to create a value list by method. I see all values OK if the value list does not allow empty values. But then I cannot deselect the last value. So I checked “Allow empty values” and added an empty value in my method. But then I only see one unnamed entry in the checkbox area.

Am I missing the obvious?

Thanks  
Patrick

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [March 12, 2006, 7:24pm UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609/5 "2006-03-12T19:24:31Z")

</div>

Hi Patrick, I have seen this behaviour once too…  
However when I isolated the creation of the list in a sample solution I couldn’t replicate it. I therefore didn’t report it but now you mention it… There probably is a reason for it. I built the valuelist with display and real values. The list was attached to a global in a formindialog…

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [March 13, 2006, 7:36am UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609/6 "2006-03-13T07:36:23Z")

</div>

Hello Marcel,

I am doing exactly the same: custom value list attached to a global, form in dialog. I have now tried to also use return values - no success.

Have you got it to work then?

Thanks  
Patrick

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [March 13, 2006, 9:41am UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609/7 "2006-03-13T09:41:53Z")

</div>

I have taken out the empty value and allow empty value.

Not what I wanted but not an issue either. Because I couldn’t replicate it in a sample I placed it on my ‘todo list’ to debug it later and didn’t bother anymore.

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [March 13, 2006, 10:36am UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609/8 "2006-03-13T10:36:26Z")

</div>

Now wait:

- If I “allow empty values” in the value list definition, I get no value list whatever I do
- If I do not allow empty values, I get a value list but cannot deselect the last value

So I don’t see how I can manage to have a functional solution, expect maybe, add a ’ ’ value and check for that.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [March 14, 2006, 9:46am UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609/9 "2006-03-14T09:46:52Z")

</div>

this is fixed now so it is also sees a valuelist with allow empty is not seen as a default 1 size great valuelist

Because a 1 size valuelist is used as a checkbox and then the value of that one line is used as the value if the checkbox is selected or not

If you have a custom valuelist. And you want to use it always for more then one chekcbox then you have 2 options

make sure that before you even touch the form (doesn’t matter how) the valuelist is completely filled.  
Or  
set always some default values in the valuelist like “test1” “test2” “test3”

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://forum.servoy.com/u/david)\
**Post date:** [March 27, 2006, 4:37pm UTC](https://forum.servoy.com/t/bug-in-valuelist-display-in-checkbox/2609/10 "2006-03-27T16:37:36Z")

</div>

> jcompagner:  
> Or set always some default values in the valuelist like “test1” “test2” “test3”

You can set the value list to space-carriage return-space. This will show an empty value list until you fill it manually but Servoy “understands” the value list to have default values.
