Re: Using QuickForm_Controller
| From: | Justin Patrin | Date: | Thu, 09 Jun 2005 03:00:05 +0000 |
| Subject: | Re: Using QuickForm_Controller | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19562@lists.php.net to get a copy of this message | ||
On 6/8/05, Ken Restivo <ken@restivo.org> wrote:
> On Wed, Jun 08, 2005 at 01:59:20PM -0700, Justin Patrin wrote:
> > >
> > > 2) Make sure that all my hidden's are actual
> > > $page->addElement('hidden', blah blah) in the parent form, instead of hacking them in
> > > using ->toHTML() methods.
> >
> > Of course....if you're using raw HTML in your forms you're not using
> > QF as it's supposed to be used.
> >
> > >
> > > This has often involved slipping references to the QF into my custom elements, much
> > > as Justin has done in his SubForm::setParentForm() method.
> >
> > Hopefully this shouldn't be needed often.. Remember if you're doing
> > your own element you can always have a hidden element within it. You
>
> Really? How, exactly? I haven't seen any examples of this yet; didn't know it was
> possible.
>
> > can even extend the group element and do it that way. If you're using
> > a ref to the form you can most likely do it in a better way. THe only
> > reason SubForm has that ref is because it's a hack to make a form
> > within a form and I need to copy values from the main form.
> >
>
Well, you could store the element in a member variable within your
element and make sure to call onQuickFormEvent on it and include it in
toHtml. You could also have your element extend the group element and
simply add your elements to the group (there's an auto-create function
you can extend, see the date element). Then you don't have to worry
about onQuickFormEvent or toHtml (unless you need special output).
--
Justin Patrin