RE: [PEAR] Question: QuickForm IT_Static & hierselect

From: Date: Wed, 29 Oct 2008 21:27:10 +0000
Subject: RE: [PEAR] Question: QuickForm IT_Static & hierselect
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-29377@lists.php.net to get a copy of this message
Hi Alexey, I am sorry, but I don't understand what u mean by hacking hierselect + accept() - do you have an example by any chance? I don't think playing with the separators will accomplish my needs which are something like: <tr><td>{label1}</td><td><select 1></td></tr> <tr><td>{label2}</td><td><select 2></td></tr> Thanks, Michael. -----Original Message----- From: Alexey Borzov [mailto:borz_off@cs.msu.su] Sent: Wednesday, October 29, 2008 11:22 PM To: Michael Mussulis Cc: 'pear-general@lists.php.net' Subject: Re: [PEAR] Question: QuickForm IT_Static & hierselect Hi Michael, Please reply to the list, other people may also be interested in your problem. Michael Mussulis wrote: > That' fine, it works but it's not what I am looking for. > I want to render each of the selects separately, and that's what I don't > know how to achieve (if possible in the first place). You can either hack hierselect to use the same accept() method as group or play with separators (that, of course, will work if you aren't trying to put selects too far away from each other). > -----Original Message----- > From: Alexey Borzov [mailto:borz_off@cs.msu.su] > Sent: Wednesday, October 29, 2008 3:08 PM > To: Michael Mussulis > Cc: pear-general@lists.php.net > Subject: Re: [PEAR] Question: QuickForm IT_Static & hierselect > > 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'), '&nbsp;'); >> >> $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 (#29377) next »