Re: QuickForm Controller, Defaults, and Dynamic Form Elements

From: Date: Tue, 12 Sep 2006 19:50:28 +0000
Subject: Re: QuickForm Controller, Defaults, and Dynamic Form Elements
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-25117@lists.php.net to get a copy of this message
Hi, Michael C wrote:
My hope here is when I call $this->controller->exportValues() I'll get a result set inclusive of the default data, and then I can go on my merry way and build out the dynamic form. So much for that theory.... Any ideas on how I can accomplish this?
I fail to see where exactly is the problem. You can iterate over raw POST data in your buildForm() method? Why can't you iterate over some data fetched from a database as well?
True, i could run over the data I used to set the defaults to then build out the form when a user goes back to edit their data. I was just hoping that I can limit my check to POST data and exportValues(). This simplies things considerably. Otherwise, I need to check three++ sets of data in order to figure out what elements to add to the form.
Well, you'll need to write your own element type to be able to use exportValues(). This element should somehow be aware of the fact that is can be "multiplied". Please note that this task isn't necessarily easier than checking three sets of data in buildForm(). :]

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