ZF-9419: Zend_Form_Decorator_ViewHelper::getValue ignores values set via Zend_Form_Element_Button::setValue
Description
Setting a value on a Zend_Form_Element_Button object using setValue does not result in a "value" name/value pair being included as an attribute in the rendered button tag. The getValue method in Zend_Form_Decorator_ViewHelper returns null when a Zend_Form_Element_Button element is detected.
As documented at http://www.w3schools.com/tags/tag_button.asp the button tag can has a "value" attribute that can be used to assign a value to a button independent of the label used.
This issue also occurs when attempting to set a "value" attribute using the setAttrib method of Zend_Form_Element_Button.
Comments
Posted by Thomas Weidner (thomas) on 2010-03-15T11:11:13.000+0000
Assigned component
Posted by Christian Albrecht (alab) on 2010-03-15T14:04:45.000+0000
Thomas please could you reassign this to Zend_View as the button is rendered in Zend_View_Helper_FormButton::formButton(), i am not able to reassign Issues yet.
Posted by Christian Albrecht (alab) on 2010-03-15T14:08:06.000+0000
This is simply adding the attribute value to the rendered attributes. The Zend_Form_Element_Button has no method setValue() this method is inherited from Zend_Form_Element which means the Value is set, but gets not rendered.
Posted by Marc Bennewitz (GIATA mbH) (mben) on 2010-03-26T02:33:52.000+0000
The problem is on Zend_Form_Decorator_ViewHelper::getValue:
This means on button elements the label is the same as the value.
-> The ViewHelper decorator shouldn't handle differences of value/label. This should be done on view helper.
Posted by Christian Albrecht (alab) on 2010-04-05T03:01:53.000+0000
Closing as duplicate of ZF-5056, because that one contains a possible solution.