From: <gem...@li...> - 2011-12-16 10:11:45
|
Revision: 363 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=363&view=rev Author: mennodekker Date: 2011-12-16 10:11:39 +0000 (Fri, 16 Dec 2011) Log Message: ----------- Fix to tabforms: hidden values now go to the subform again as validators (like dbunique) need to have all the needed values in their own subform ( $context ) Make sure that needed hiddens are in the right tab! Modified Paths: -------------- trunk/library/classes/Gems/Form/TableForm.php trunk/library/classes/Gems/TabForm.php Modified: trunk/library/classes/Gems/Form/TableForm.php =================================================================== --- trunk/library/classes/Gems/Form/TableForm.php 2011-12-15 17:21:17 UTC (rev 362) +++ trunk/library/classes/Gems/Form/TableForm.php 2011-12-16 10:11:39 UTC (rev 363) @@ -218,9 +218,9 @@ $element->setDecorators($decorators); if ($element instanceof Zend_Form_Element_Hidden) { - //Add 1000 to the order to place them last and fix some layout problems - $order = $element->getOrder(); - $element->setOrder($order+1000); + //Make row hidden so it takes no height + $decorator = $element->getDecorator('row'); + $decorator->setOption('style', 'display:none;'); } else { $decorator = $element->getDecorator('row'); Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2011-12-15 17:21:17 UTC (rev 362) +++ trunk/library/classes/Gems/TabForm.php 2011-12-16 10:11:39 UTC (rev 363) @@ -57,7 +57,7 @@ */ public function addElement($element, $name = null, $options = null) { - if ($this->currentTab && !($element instanceof Zend_Form_Element_Hidden)) { + if ($this->currentTab) { return $this->currentTab->addElement($element, $name, $options); } else { parent::addElement($element, $name, $options); @@ -166,6 +166,19 @@ } /** + * Retrieve a named tab (subform) and set the active tab to this one + * + * @param type $name + * @return Gems_Form_TabSubForm + */ + public function getTab($name) + { + $tab = $this->getSubForm($name); + $this->currentTab = $tab; + return $tab; + } + + /** * Create tabs from MUtil_Form_Element_Tab elements * * All elements following an element of type MUtil_Form_Element_Tab will be in tabs @@ -374,7 +387,6 @@ $values = parent::getValues($suppressArrayNotation); foreach ($this->getSubForms() as $key => $subForm) { - $values[$key]; $values = $this->_array_replace_recursive($values, $values[$key]); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |