Re: Pear HTML_QuickForm_Controller

From: Date: Mon, 06 Oct 2003 13:26:24 +0000
Subject: Re: Pear HTML_QuickForm_Controller
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8292@lists.php.net to get a copy of this message
Hi! Daniel Kopp wrote:
$this->addElement('submit', 'add','Add User'); $this->addElement('submit', $this->getButtonName('submit'),
                  'Send'); $this->addRule($this->getButtonName('submit'),                'Bitte Send eingeben', 'required', null 'client');
(to be honest - I don't really know what 'add' or $this->getButtonName('submit') means or how it has to be but I tried a lot so I just post it as I think this is not the problem even it might be wrong here)
If you like to perform rituals meaning of which you do not understand I suggest dumping programming and starting religious career.
Unfortunately this does not work. It does not go back to the Form. It goes to the handle of "Add User" which was never intended to exist. The second solution would be to put it in the Form changing code in the handle of "Add User" but then I don't know how to declare the form as invalid and go back to it once more as the controller has finished validation already ...
Yes, what you need to do is to define an Action class to handle adding an element to the form. Its perform() method will need to invoke a 'display' event for the current page after doing its work. Look at existing Action subclasses in the package to understand this chain better.

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