Re: DataObject_FormBuilder conditions
| From: | James Stewart | Date: | Mon, 07 Feb 2005 19:21:43 +0000 |
| Subject: | Re: DataObject_FormBuilder conditions | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17433@lists.php.net to get a copy of this message | ||
On Feb 4, 2005, at 1:20 PM, Justin Patrin wrote:
FormBuilder doesn't use joins for any of this (that just wouldn't work) and a whereAdd like that is never going to work for this. Good try, though. :-) The way to limit values in a select box is to use the prepareLinkedDataObject callback in your DataObject. See the docs: http://opensource.21st.de/tiki-index.php?page=Callback+methods#id427020Aha. Thanks once again. One more question about FormBuilder, if I may. I've seen some references to handling of unique keys when googling and looking through the archives, but can't see if there's a standard solution. In particular, I have a table with a username which must be unique. I've defined it as a unique key, but when I use processForm to handle a form with a duplicate username $form->process(array(&$fg,'processForm'),false); returns 1 despite failing to do the update. Do I need to write my own handler in preProcessForm() or is there some standardised way of handling this? James.