helma.Html.prototype.radioButton

"Melanie Reichel" <[email protected]> Mon, 23 Jun 2008 16:48:21 +0200
Newsgroups gmane.comp.java.helma.general
Message-ID <[email protected]>
--===============1978336613==
Content-Type: multipart/alternative; 
	boundary="----=_Part_7653_3265711.1214232501526"

------=_Part_7653_3265711.1214232501526
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,
I had a problem with radio buttons. If there is a selectedValue given, the
corresponding radio button will not be checked.
The following code snippet in the helma.Html.prototype.radioButton function
seems to cause the problem (l. 367ff in Html.js from 2007-12-13):

    if (attr.selectedValue != null) {
        if (attr.value == attr.selectedValue)
            attr.checked = "checked";
        else
            delete attr.checked;
        delete attr.selectedValue;
     }

Because it works for checkboxes I think this lines of code should be used
instead of in the radioButton function to solve the problem:

    if (attr.selectedValue != null) {
        if (helma.Html.isSelected(param.value, param.selectedValue))
            attr.checked = "checked";
        else
            delete attr.checked;
        delete attr.selectedValue;
    }

Maybe it helps one of you, too.
Melanie

------=_Part_7653_3265711.1214232501526
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,<br>I had a problem with radio buttons. If there is a selectedValue given, the corresponding radio button will not be checked.<br>The following code snippet in the helma.Html.prototype.radioButton function seems to cause the problem (l. 367ff in Html.js from 2007-12-13):<br>



<br><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; if (attr.selectedValue != null) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (attr.value == attr.selectedValue)</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attr.checked = &quot;checked&quot;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete attr.checked;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete attr.selectedValue;</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp; }<br><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">Because it works for checkboxes I think this lines of code should be used instead of in the radioButton function </span></span>t<span style="font-family: courier new,monospace;"><span style="font-family: arial,sans-serif;">o solve the problem:<br>


<br><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; if (attr.selectedValue != null) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (helma.Html.isSelected(param.value, param.selectedValue))</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attr.checked = &quot;checked&quot;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete attr.checked;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete attr.selectedValue;</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; }</span><br style="font-family: arial,sans-serif;"></span></span><br>Maybe it helps one of you, too.<br>Melanie<br>

------=_Part_7653_3265711.1214232501526--

--===============1978336613==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Helma-user mailing list
[email protected]
http://helma.org/mailman/listinfo/helma-user

--===============1978336613==--