Re: HTML_QuickForm_Controller -> is there an easy way to kind of freeze() the forms
| From: | Bertrand Mansion | Date: | Wed, 28 Jul 2004 09:34:14 +0000 |
| Subject: | Re: HTML_QuickForm_Controller -> is there an easy way to kind of freeze() the forms | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13881@lists.php.net to get a copy of this message | ||
robert wrote:
>Hi there!
>
>The problem:
>I have to create many complex, wizard-like forms spread on multiple
>pages, so HTML_QuickForm and HTML_QuickForm_Controller seemed to be the
>right solution for me.
>The last step of some forms should be a kind of confirm page, where all
>the data the user entered is displayed. In HTML_QuickForm I would do
>this with $myForm->freeze(), but with HTML_QuickForm_Controller this
>does not seem to work.
>
>My approach was based on the regWizard example in the documentation:
>build the first two pages and copy the buildForm code in the buildForm
>of the confirmation Page and then set the defaults for the confirmation
>page from the $_SESSION array.
>The first time the confirmation page is displayed this will work, but if
>I go back and change some data it ill not update the defaults.
>Any hints appreciated.
I wouldn't use freeze() here.
I didn't read your code but this is how I would do it:
The last form would be made of static elements with a prefix in their names.
For example: 'stat_name' would show the value of the element 'name' filled in a
previous step.
In order to fill the static elements with values, I'd create Next/Back actions and check which
is the page that was requested, and fill the static default values accordingly using
controller->applyDefaults(). There might be an example of this process in the 'upload'
example.
Bertrand Mansion
Mamasam