Page 1 of 1

Checkbox vocabulary problem

PostPosted: Mon Jan 28, 2013 2:24 pm
by jerryevo
I have field with:

Code: Select all
widget:type=checkbox
vocabulary=boolTakNie


valuelist.ini has:
Code: Select all
[boolTakNie]
1 = ✓
0 = ' '


In list view values for "1" are properly shown as "✓" but for "0" is shown instead of space.
I'm using Xataface 2.0alpha1

Re: Checkbox vocabulary problem

PostPosted: Mon Jan 28, 2013 3:17 pm
by shannah
0 is a reserved value in ini files unfortunately. You'll need to define this vocabulary in a delegate class or via the __sql__ directive (i.e. store values in a table).

-Steve

Re: Checkbox vocabulary problem

PostPosted: Mon Jan 28, 2013 5:15 pm
by jerryevo
I have found solution in one of posts. Here is for memory:

There is need to add the following function in delegate class:

Code: Select all
   function valuelist__checkbox(){
       return array(0=>'', 1=>'✓');
   }


And then add vocabulary=checkbox for checkbox fields.

BTW: Xataface should automatically render checkbox fields properly not to "1" and "0"