HTML_Quickform hierselect Rendering Questions

From: Date: Thu, 22 Sep 2005 00:34:00 +0000
Subject: HTML_Quickform hierselect Rendering Questions
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21072@lists.php.net to get a copy of this message
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!

« previous php.pear.general (#21072) next »