Bug in valuelist display in checkbox?

Hi,

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

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

Dear Jan / Johan,

any investigation on this??

Thanks

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.

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

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…

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

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.

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.

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”

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.