For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > September 2005 > HTML_Quickform hierselect Rendering Questions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HTML_Quickform hierselect Rendering Questions
Adam Maccabee Trachtenberg

2005-09-21, 9:56 pm

I have a HTML_Quickform question involving displaying the hierselect
element/group.

Essentially, I want each element of the heirselect to be treated
template-wise just like the other elements of a group.

If I do an addElement(), then all the heirselects are treated as one
element, so they don't pick up my element template.

A workaround is to do nasty things such as embedding HTML as part of
the element separator values, but that's not a clean design because I
want to decouple display from the logic.

Then I noticed hierselect subclasses group, so I tried doing:

$hier = $element->getElements();
$form->addGroup($hier, 'hier');

But I cannot seem to modify the element template, as the renderer and
element template seem baked into the code (see hierselect.php):

404 $renderer =& new HTML_QuickForm_Renderer_Default();
405 $renderer->setElementTemplate('{element}');
406 parent::accept($renderer);

Can I override this somehow?

I have tried directly setting the element template,

$renderer->setGroupElementTemplate('{element}', 'hier');

but I am stuck with the default -- " " -- no matter what.

-adam

--
adam@trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com