Re: DB_DataObject_FormBuilder questions

From: Date: Fri, 31 Dec 2004 13:29:56 +0000
Subject: Re: DB_DataObject_FormBuilder questions
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16538@lists.php.net to get a copy of this message
Hi Markus, At 11:35 30/12/2004, Markus Wolff wrote:
you can define a postGenerateForm() method and freeze individual fields there: function postGenerateForm(&$form) {
    $form->freeze(array('field1','field2','field3'));
}
The problem with this (and correct me if I'm wrong) is that this has to go into the DB_DO class (unless I play with global variables) so requires me to have a subclass for 'edit' actions (as opposed to 'add' actions). I'm sure adding this hidden action field to the form is possible, and indeed I have it showing up after modifying preGenerateForm() to add the extra field, but I cannot populate it with a value? Tracking state is needed so I can initialise the correct class on the next page, and show the right fields for the action (otherwise editing goes back to the adding form, with extra fields.
For FormBuilder itself, I think this is a bit out of scope.
That depends on the uses you see FormBuilder being put to. I'm trying to make it so any database table can have records added/edited online, with the fields shown customised so 'normal' users can't mess things up. Kind of like a PHPLens or phpdb idea. Regards, Peter -- Maple Design - quality web design and programming http://www.mapledesign.co.uk

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