checkbox little question...

A place for users and developers of the Xataface to discuss and receive support.

checkbox little question...

Postby xyloweb » Thu Oct 13, 2011 1:55 am

Hi,

Why my list is displaying '0' instead of the associated value : 'disable' ?
'enable' works fine.

My 'fields.in'
Code: Select all
[vtu_enable]
   vocabulary = vtu_enable
   widget:label = "VerbaTool autorisé"
   widget:description = "Autoriser ou interdire l'utilisation de VerbaTool"
   widget:type = checkbox


And my valuelists.ini
Code: Select all
;; Encodage UTF-8

[vtu_enable]
0=disalbe
1=enable
xyloweb
 
Posts: 11
Joined: Tue Oct 11, 2011 5:27 am

Re: checkbox little question...

Postby manifold » Thu Oct 13, 2011 6:13 am

You have 'disable' misspelled in your valuelist... don't know if that is how you have it spelled in your actual list, or just mis-typed it here...
"Heisenberg may have slept here."

"I'm positive I've lost an electron...."
manifold
 
Posts: 31
Joined: Wed Jun 29, 2011 8:49 am

Re: checkbox little question...

Postby ADobkin » Thu Oct 13, 2011 7:00 am

How is the vtu_enable field defined in your database? Normally checkbox widgets are used with boolean (tinyint) fields where 1 indicates checked and 0 not checked, but your valuelist should display the associated value in your list view.
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA

Re: checkbox little question...

Postby xyloweb » Fri Oct 14, 2011 12:52 am

My 'vtu_enable' field is tinyint 1 unsigned zerofill.

valueslists doesn't work so I wrote a customized display delegate
Code: Select all
   function vtu_enable__display($record) {
      return $record->val('vtu_enable') ? "autorisé" : "interdit";
   }

and it works fine.
xyloweb
 
Posts: 11
Joined: Tue Oct 11, 2011 5:27 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 10 guests

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