Re: New package: DB_DataObject_FormBuilder
| From: | Markus Wolff | Date: | Tue, 26 Aug 2003 21:45:47 +0000 |
| Subject: | Re: New package: DB_DataObject_FormBuilder | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20583@lists.php.net to get a copy of this message | ||
Ron McClain wrote:
That's the quickform validation. Before actually inserting of updating, it would be helpful if data_object validation were run. There's an actual DB_DataObject->validate() call that has nothing to do with QuickForm->validate(). See the DataObjects documentation. Let me know if this still doesn't make sense ;)Ah, now I get it... and now it makes sense, of course ;-) The question remains, how to properly integrate it. I think it would make sense to somehow return the validation errors (if any) to the user. If we integrate validate() into processForm(), however, you can´t return any data from that method directly, or you won´t be able to use it with HTML_QuickForm::process(), which doesn´t return the results of the callback method to the user. It seems our best bet would be to make a) a public validate() method in FormBuilder that can be called seperately if needed and will return the results directly, b) an additional property that determines wheter DataObject::validate() is to be called automatically by processForm() and c) make yet another property that will store the last validation results - in case you were using QuickForm´s process() and have no other means to get to that data. Does that sound alright? Regards, Markus