Re: can't get [PEAR] DB_DataObject_FormBuilder to build a form
| From: | l Burnerheimerton | Date: | Thu, 23 Dec 2004 22:54:18 +0000 |
| Subject: | Re: can't get [PEAR] DB_DataObject_FormBuilder to build a form | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16442@lists.php.net to get a copy of this message | ||
Thanks. Yeah, I should have caught that variable problem.
What I will be searching for first include:
1 - how to make certain fields hidden
2 - how to make other fields display as textarea instead of text type
3 - how to delete a record
It's cool how it knows whether to add or edit. This will work great especially for the forms
that do not require custom validation rules/functions in QuickForms - I have several already - like
one that checks for unique values as a custom validation rule. I saw that it is possible to do this
in fb but, quite frankly, I need to get this out the door.
Your help has been most appreciated!
Best regards
Justin Patrin <papercrane@gmail.com> wrote:
On Thu, 23 Dec 2004 12:54:03 -0800 (PST), l Burnerheimerton
wrote:
> The code below is what he suggested and worked. Actually before changing
> much of it, I just changed:
>
> $review = DB_DataObject::factory('building');
> $builder =& DB_DataObject_FormBuilder::create($building);
>
> to
>
> $building = DB_DataObject::factory('building');
> $builder =& DB_DataObject_FormBuilder::create($building);
Hehe...just a variable name. Sorry about that, I missed it too. I
usually assume that people catch that stuff on their own. ;-) Glad you
got it working.
>
> and it worked. But I went further on his suggestion and chnaged it to
> include the error checking as below.
>
> Now I have to delve into how to write QuickForm code through Form_Builder -
> I was just getting confortable with QuickForm ;-)
Well, it does most of it for you. You can pre-create elements if you
*must* with the preGenerateForm callback and you can customize the
auto-created ones in postGenerateForm. These are on the wiki you
mention below in the callbacks section.
>
> Seriously, I REALLY like what you guys have built.
Glad you like it. Suggestions are welcome. Tutorials are even more
welcome. :-) Many people have proposed them, but no one has submitted
one yet...
>
> I am to the following sites for more learning. If you have more where I can
> get up to speed on how to format the output of fields, I'd appreciate you
> posting those. Thanks again.
The rest of the pages on that wiki are also important. If you haven't
been there yet, start from this page:
http://opensource.21st.de/tiki-index.php?page=DB_DataObject_FormBuilder
>
> http://opensource.21st.de/tiki-index.php?page=Beyond+Advanced
I'm proud of this one (as I am in general of FB). It's mostly my own
ideas when playing wround with DO and FB in my own apps. I use
"virtual fields" quite often to make something look like one record
when it's in fact more like 3 or 4. :-)
--
Justin Patrin
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---------------------------------
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.