Hi,

Has someone run into a troolean widget ?
I'm mean about a boolean field with an "undecided" additional choice  
(null in db).

I'm trying to use a sfWidgetFormSelect :

$this->setWidgets(array(
   'myTroolean' => new sfWidgetFormSelect(array('choices' => array(''  
=> '', 1 => 'Yes', 0 => 'No')));
));

And a sfValidatorBoolean

$this->setValidators(array(
   'myTroolean' => new sfValidatorBoolean(array('empty_value' => null));
));

The only matter is when I choose 'No' value. sfWidgetFormSelect checks  
the empty value due to use of strval() in getOptionsForSelect() method.

Before hacking Symfony widget, I would know if someone has a better  
way ?

Thanks!

--
Nicolas CHARLOT
http://www.isics.fr




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to