Re: FB booleanFields
| From: | Justin Patrin | Date: | Thu, 20 Jan 2005 16:22:41 +0000 |
| Subject: | Re: FB booleanFields | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17038@lists.php.net to get a copy of this message | ||
On Thu, 20 Jan 2005 11:08:15 +0100, Rodrigo Alvarez <papipo@gmail.com> wrote:
> Rodrigo Alvarez wrote:
> > Justin Patrin wrote:
> >
> >> On Tue, 18 Jan 2005 01:15:31 +0100, Rodrigo Alvarez <papipo@gmail.com>
> >> wrote:
> >>
> >>> Justin Patrin wrote:
> >>>
> >>>> On Mon, 17 Jan 2005 20:13:38 +0100, Rodrigo Alvarez
> >>>> <papipo@gmail.com> wrote:
> >>>>
> >>>>
> >>>>> Justin Patrin wrote:
> >>>>>
> >>>>>
> >>>>>> On Mon, 17 Jan 2005 18:32:54 +0100, Rodrigo Alvarez
> >>>>>> <papipo@gmail.com> wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>> Hi PEARs,
> >>>>>>>
> >>>>>>> var $fb_booleanFields = array('highlight');
> >>>>>>> highlight is a tinyint(1) null default 0 field.
> >>>>>>> It is shown as a textfield with zero inside, not a checkbox.
> >>>>>>> Why? :_
> >>>>>>>
> >>>>>>> Thanks.
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>> What version of FormBuilder do you have unstalled? This was added in
> >>>>>> 0.11.1. Actually, you shouldn't need to set booleanFields if the
> >>>>>> field
> >>>>>> is a tinyint(1), DataObject sets those as booleans automatically.
> >>>>>> (Note: that last bit is only in the CVS version of FormBuilder at the
> >>>>>> moment, You still need to set the field in booleanFields if
> >>>>>> you're
> >>>>>> using release 0.11.1).
> >>>>>>
> >>>>>
> >>>>> I'm using latest released version (downloaded today).
> >>>>> There should be somethign I'm missing :?
> >>>>>
> >>>>
> >>>>
> >>>> Where are you setting fb_booleanFields? Check the docs to make sure
> >>>> it's correct:
> >>>
> >>>
> >>> Inside the DO:
> >>> var $fb_booleanFields = array('highlight');
> >>>
> >>>> SÝ_×{âž¡8
> >>>> ¼óihttp://opensource.21st.de/tiki-index.php?page=Configuring+Formbuilder
> >>>>
> >>>
> >>
> >> PHP4 or 5? Do you have overloading turned off?
> >>
> > PHP4 and define('DB_DATAOBJECT_NO_OVERLOAD', 0);
> I had to put this inside DOs to make boolean fields work:
>
> if (is_array($this->fb_booleanFields)) {
> foreach ($this->fb_booleanFields as $field) {
> $temp = &HTML_QuickForm::createElement('checkbox', $field,
> $this->fb_fieldLabels[$field]);
> $temp->setChecked($this->$field);
> $this->fb_preDefElements[$field] = &$temp;
> }
> }
>
> But it's supposed that this is not needed in new FB version :S
>
That is approximately what FormBuilder does itself. No, you should not
need to do such a thing. Have you tried the CVS version of
FormBuilder?
--
Justin Patrin