Re: DB_DataObject_FromBuilder Checkboxes
| From: | Justin Patrin | Date: | Wed, 04 Aug 2004 18:18:14 +0000 |
| Subject: | Re: DB_DataObject_FromBuilder Checkboxes | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-32436@lists.php.net to get a copy of this message | ||
On Wed, 04 Aug 2004 09:19:54 +0200, Verona Busch <veronabusch@gmx.de> wrote:
> Justin Patrin wrote:
> > On Mon, 02 Aug 2004 19:48:21 +0200, Verona Busch <veronabusch@gmx.de> wrote:
> >
>
> Thank you very much, Justin.
>
> >
> > If you want checkboxes, you can't store that in one field unless you
> > do some special processing on it (preProcess()). You'd also have to
> > manually create the elements and such...
>
> I found some information about it at opensource.21st.de as well.
>
> >
> > If you want radio buttons for links, I just put addedn an option to
> > switch links to radio buttons.
> >
> >
> > http://opensource.21st.de/tiki-index.php?page=Formbuilder+configuration+options#id330542
>
> That's wonderfull. :-) Thanks
>
> >
> > If you need it for something else (enums), then you'll have to program
> > it yourself for now. Or add it to FormBuilder and we'll add it in.
>
> That is a problem, isn't is? OK, but I found something about enums at
> opensource as well, I think?! Anyway. I can't put it in FormBuilder. I'm
> not familiar with PEAR coding standards at all.
>
> >
> > If you just want to hard-code it, just add an array of elements to
> > preDefElements for the lement you want to replace. A side effect of my
> > new addition is that it will create a group for an array of elements
> > in preDefElements.
> >
> That is a very nice function. But to change anything at DB_DO_FB - it
> seems that that's what you ment with hard-code - I'm just not good
> enough. :-)
>
I also added ENUM support that night for mysql. For any other DB, it
will likely fail. I would suggest changing your gender field to an
ENUM and putting it in the fb_enumFields array in your data object.
If you want to keep it as a tinyint, then I would suggest doing this
in your preGenerateForm (make sure the column name and such are
correct before using ;-).
$this->preDefElements['Gender'] =
array(HTML_QuickForm::createElement('radio', 'gender', null, 'Male',
'male'),
HTML_QuickForm::createElement('radio', 'gender', null,
'Female', 'female'));
Because of the radio button changes I made, you can now give FB an
array of elements in preDefElements. Try this and see what you think.
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--