I found a confusing (at first) statement in the documentation about
jmolRadioGroup
(perhaps others too)
http://jmol.sourceforge.net/jslibrary/#jmolRadioGroup
It reads:
*"* jmolRadioGroup(arrayOfRadioButtons, separatorHtml, groupName, id, title)
*Advanced:*
1) The whole group of radio buttons will be included in a <span> element
that will have as its HTML id the value of id or, if this is not given, the
value of groupName (optional).
2) In turn, each radio button + label will have as its HTML id "span_" plus
the group's id plus an underscore plus a sequential number (starting at
zero), and as its HTML title, the common title (optional). "

In my js script I have:

jmolRadioGroup([["color structure;","2nd","isChecked"],["color
chain;","Chain"]],"&nbsp;","radio_color","radio_color","pick color");

So this ("blindly") generates:

<span  id="radio_color">     <span  id="span_radio_color_0">
       <input  id="radio_color_0" type="radio"  checked="" onmouseout ="
_jmolMouseOut()" onmouseover="_jmolMouseOver(1);return true; "
onclick="_jmolClick(1);return
true;"  name="radio_color"/>
       2nd
   </span>
   <span id="span_radio_color_1" >
        < input id="radio_color_1"  type="radio" onmouseout="
_jmolMouseOut() " onmouseover="_jmolMouseOver(2);return true;"
onclick="_jmolClick(2);return
true;" name=" radio_color"/>
        Chain
   </span>
</span>

The confusion was whenever I tried to access/change the radiobutton checked
state and used the id "span_radio_color_0" and
it didn't work. It was until I checked the generated html code and read the
documentation a 2nd time that I noticed point 2) says
"each radio button + label". May I suggest to add a third point in the
documentation showing the way to access the state of the
radiobutton (<input ...> html tag) generated by jmolRadioGroup, which in
this case would be id "radio_color_0" in the DOM.

BTW, for those web devs that don't know a way to easily debug their
pages/scripts, I recommend FireBug. Of course this means
you need to use FireFox, but I'd expect this is something you're already
using if you're smart, right? ;)


--
        0     |  Mauricio Carrillo Tripp, PhD
     /         |     Department of Molecular Biology
 0            |     The Scripps Research Institute
     \         |     10550 North Torrey Pines Road
        0     |     La Jolla, California 92037
     /         |     [EMAIL PROTECTED]
 0            |   http://www.scripps.edu <http://www.scripps.edu/%7Etrippm>

** Aut tace aut loquere meliora silentio **
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to