Checkbox vocabulary problem

A place to discuss development of the Xataface core.

Checkbox vocabulary problem

Postby 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
jerryevo
 
Posts: 16
Joined: Sun Jan 06, 2013 1:30 pm

Re: Checkbox vocabulary problem

Postby 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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Checkbox vocabulary problem

Postby 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"
jerryevo
 
Posts: 16
Joined: Sun Jan 06, 2013 1:30 pm


Return to Xataface Developers

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved