ZF-2937: Zend_Element_Radio have no id for javascript access

Issue Type: Improvement Created: 2008-03-21T07:35:50.000+0000 Last Updated: 2008-07-10T08:10:24.000+0000 Status: Resolved Fix version(s): Reporter: jaap vstr (jaapvstr) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form

Related issues: - ZF-3024



Zend_Element_Radio elements lack ids for javascript access

I tested this on today's trunk and 1.5 release

Create a subform:

<pre class="highlight">[subfrm] = "0";
elements.subfrm.type = "radio";
elements.subfrm.options.belongsTo = "subfrm";
elements.subfrm.options.disableLoadDefaultDecorators = "true";
elements.subfrm.options.decorators.ViewHelper.decorator = "ViewHelper";
elements.subfrm.options.value = "true";
elements.subfrm.options.multiOptions.true = "";
elements.subfrm.options.multiOptions.false = "";

After assigning it in the view, print it in the view

<pre class="highlight">

The result it:

<pre class="highlight">


Expected result

<pre class="highlight">


A quick and dirty fix would be: Editing a part of Zend_View_Helper_FormRadio to:

<pre class="highlight">
// Wrap the radios in labels
            $radio = '_htmlAttribs($label_attribs) . '>'
                    . (('prepend' == $labelPlacement) ? $opt_label : '')
                    . '_htmlAttribs($attribs) 
                    . $endTag
                    . (('append' == $labelPlacement) ? $opt_label : '')
                    . '';

I don't think its intended to be fixed there however. I haven't digged into the id attaching for textfields etc enough to provide a better fix, maybe i'll do that later.


Posted by Wil Sinclair (wil) on 2008-03-25T20:29:10.000+0000

Please categorize/fix as needed.

Posted by jaap vstr (jaapvstr) on 2008-03-26T15:23:25.000+0000

I did more search an learn work on the Zend Framework and actually it is an inconsistency in the Zend_View_Helpers. So i'll recreate the issue there, with a more to-the-point use case.

Posted by Matthew Weier O'Phinney (matthew) on 2008-04-22T11:52:31.000+0000

Reporter indicates the issue is with another component; closing.

Posted by Matthew Weier O'Phinney (matthew) on 2008-07-10T07:12:07.000+0000

Re-opening. This becomes an issue with Dojo's RadioButton dijit when using dojo programmatically; without an ID, we cannot identify the element to decorate it as a dijit.

Posted by Matthew Weier O'Phinney (matthew) on 2008-07-10T08:10:23.000+0000

Resolved in trunk as of r10025.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.