Re: complex QFC question
| From: | Alexey Borzov | Date: | Mon, 10 Nov 2003 15:18:02 +0000 |
| Subject: | Re: complex QFC question | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8850@lists.php.net to get a copy of this message | ||
Hi!
Greg Beaver wrote:
I'm designing an addressbook form to make adding/updating the quartet mailing list MUCH easier. I've got a working QFC page for basic stuff, but I am having a bit of difficulty figuring out the best way to design the thing to perform this logic chain: initial form:->> submit name/address -> is person a duplicate name? yes->> verification form: replace existing mailing address? yes->> save and go to initial form no->> go to duplicate form duplicate form: save as new contact? (same name, different person) yes->> save and go to initial form no->> go to initial form no->> display initial form with save confirmation What I'd like to do is in the verification and duplicate form, I would like to display the data as entered by the user from the initial form. Should I be doing this in the buildForm() method, or should I be displaying the page in the process action handler, or some other solution? I feel doing either the buildForm() or process handler would be a bit of a hack. What I'd really like to do is have a form rule (easy to do) that causes a shunt to the verification or duplicate form (not sure how easy that is to do) if the data comes up as a dupe.Well, you absolutely shouldn't define this duplicate check as validation rule, as both unique and duplicate name are technically valid. Thus you need a custom Action handler for submit button of the base form. This should check whether the name is duplicate and either redirect to the duplicate form ('jump' action) or display the confirmation (I'd use freeze() here and add a different set of buttons to the form, or you can define a separate confirmation page with 'static' elements). The other stuff is simple.