Re: Change field type in DataObject_Form_Builder.

From: Date: Sat, 28 Jan 2006 22:07:07 +0000
Subject: Re: Change field type in DataObject_Form_Builder.
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-22715@lists.php.net to get a copy of this message
On 1/27/06, arnaud sellenet bodin <demental@free.fr> wrote: > Hi Hugo, > > You have several solutions for this. > > The prefered one, if possible, is to change the mysql type to boolean > in the database (Tinyint(1)) for your field. After regenerating the > database schema it should automatically show up as a textbox. > > If you don't want to change the type of the field, you can add it to > the $fb_booleanFields option. > > Otherwise if you need for some reason to have a special value in your > field ('Y' or 'N' instead of '0' or '1') you can use > the > fb_preDefElements property in your dataObject, using for example an > advCheckBox to handle both values. > A better solution for Y/N in a text field would be to tell FB it's an enum in fb_enumFields and specify the options in fb_enumOptions. > > The last solution which is IMHO not recommended is to change the value > in the database_name.ini that's generated Replace the line with : > > .... > your_field_name = 145 > ..... > > This will work but you'll have to do it again every time you regenerate > the database schema > > > > Well you have the choice now. > > Le 27 janv. 06, à 12:56, Hugo W. Alves a écrit : > > > I created a form by a table using DataObject_Form_Builder. I have a > > char(1) table field, but in the form this field appears as a text > > field. Well, I wanna change the field type to a checkbox field. How I > > do that? > > > > --------------------------------- > > Yahoo! doce lar. Faça do Yahoo! sua homepage. > \ | / > Arnaud Sellenet-Bodin > Dév et dés > http://demental.info > Tel : 05 63 55 24 46 > / | \ > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Justin Patrin

« previous php.pear.general (#22715) next »