ZF-4435: Sliders do not work/render properly when included within a Zend_Dojo_Form_SubForm()
Description
Getting the following incorrect rendering when I attach a Horizontal or Vertical Slider to a SubForm:
!http://img72.imageshack.us/img72/8651/…!
Here is my Form code:
class App_Form_SliderSubFormTest extends Zend_Dojo_Form
{
public function init()
{
$this->setMethod('post');
$this->setAttribs(array(
'name' => 'masterForm',
));
$this->setDecorators(array(
'FormElements',
array('TabContainer', array(
'id' => 'tabContainer',
'style' => 'width: 600px; height: 300px;',
'dijitParams' => array(
'tabPosition' => 'top'
),
)),
'DijitForm',
));
$sliderForm = new Zend_Dojo_Form_SubForm();
$sliderForm->setAttribs(array(
'name' => 'slidertab',
'legend' => 'Slider Elements',
));
$sliderForm->addElement(
'HorizontalSlider',
'slide1',
array(
'label' => 'Slide me:',
'minimum' => 0,
'maximum' => 25,
'discreteValues' => 10,
'style' => 'width: 450px;',
'topDecorationDijit' => 'HorizontalRuleLabels',
'topDecorationLabels' => array('0%', '50%', '100%'),
'topDecorationParams' => array('style' => 'padding-bottom: 20px;')
)
);
$this->addSubForm($sliderForm, 'slidertab');
}
}
The sliders work and render correctly when attached directly to a Zend_Dojo_Form and when used via the $view->horizontalSlider() view helpers.
Comments
Posted by Chris Martin (cgmartin) on 2008-09-30T22:47:16.000+0000
I should mention that this was found in trunk rev 11557.
Posted by Matthew Weier O'Phinney (matthew) on 2008-10-01T05:56:19.000+0000
Verified... when using the helpers programmatically. When you switch to declarative syntax, they do work, and this is a viable workaround until I can determine why the programmatic use case is failing.
To enable declarative syntax, call this in your view script prior to rendering the form:
Posted by Matthew Weier O'Phinney (matthew) on 2008-11-07T13:04:06.000+0000
fixed in r12387
Posted by Wil Sinclair (wil) on 2008-12-01T13:50:44.000+0000
Updating these issues to mark them resolved for 1.7.1.