Re: Subclassing a QuickForm element
| From: | Justin Patrin | Date: | Fri, 18 Feb 2005 17:10:16 +0000 |
| Subject: | Re: Subclassing a QuickForm element | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17571@lists.php.net to get a copy of this message | ||
On Thu, 17 Feb 2005 21:37:43 -0800, Ken Restivo <ken@restivo.org> wrote:
> I need to create a subclass of a standard QF text input element that includes a link wiht an
> onClick which calls some JS to populate the associated element's value with some custom stuff.
>
> The best way I can imagine do this is by subclassing the text element, and then overloading the
> toHTML() method to include my link and overloading the _getJS() method to include my JS. I got this
> idea from looking at Jamie Alessio's advmultiselect... it seems that's how he does it
> there.
>
> But I can't for the life of me find the original toHTML() method that the text element
> uses! I've searched through its inheritance, and the only toHTML() method I can find is in
> HTML_Common, and it's essentially blank (virtual method?). So I guess that's not it.
>
> Where would be the toHTML() method of a text element that I should use as a template for my
> custom text element?
>
Ummm....the direct parent of HTML_QuickForm_text is
HTML_QuickForm_input which has a toHtml method.
--
Justin Patrin