| 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!
|