Checkbox vocabulary problem

Archived from the Xataface Developers forum.

jerryevo — Mon Jan 28, 2013 2:24 pm

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


shannah — Mon Jan 28, 2013 3:17 pm

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


jerryevo — Mon Jan 28, 2013 5:15 pm

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”