Re: Question: QuickForm IT_Static & hierselect

From: Date: Wed, 29 Oct 2008 13:07:33 +0000
Subject: Re: Question: QuickForm IT_Static & hierselect
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-29375@lists.php.net to get a copy of this message
Hi, Michael Mussulis wrote:
I was just wondering if you could possibly help me figure out how I can render the selects from a 'hierselect' element using IT_Static template? Everything I tried just does not work. My element is: $hs =& $form->addElement('hierselect', 'makemodel', 'Make/Model:', array('class' => 'element'), ' '); $hs->setOptions($opts); I output the form as follows:
    $tpl =& new HTML_Template_ITX();
    $tpl->loadTemplateFile('adauga.html');
    $renderer =& new HTML_QuickForm_Renderer_ITStatic($tpl);
    $form->accept($renderer);
    $tpl->show();
In my html template, I tried: <tr><td class="label">{frmad_makemodel_0_label}</td><td class="element">{frmad_makemodel_0_html}</td></tr> But it doesn't work. Although the documentation says the element is considered a group, IT_Static treats it as an element.
Yes, exactly, 'date' and 'hierselect' elements are treated like "scalar" elements for the purposes of rendering. You probably should put <tr><td class="label">{frmad_makemodel_label}</td><td class="element">{frmad_makemodel_html}</td></tr> into your template.

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