0

I would like to place the radio buttons from a radio button group in different cells within a table. Is this possible?

2 Answers2

2

You can set the groupName attribute of the radio button (not radio button group) control to group multiple radio buttons under the same name. Something like this:

<xp:radio text="Label" id="radio1" groupName="MyRadioGroup"></xp:radio>

You can then place these radio buttons at there respective cells in table. On the downside you wont be able to compute the list of items as you can in radio button group.

Another option is you could write your own custom renderer, like in this answer, that would generate the table with radio buttons for you.

Community
  • 1
  • 1
Naveen
  • 6,786
  • 10
  • 37
  • 85
  • Thanks, I have tried using the groupName but when I edit the document and save a different value, both values are saved. groupName stops me from selecting more than one choice client side but if I edit and select a different value, it does not clear my original choice. I'm using Dojo Radio Button controls. –  Jun 03 '13 at 16:30
  • @TonyGuiheen: Are you using Dojo Radio Button from Extension Library? If yes then please edit your question mentioning that you are using Dojo Radio Button otherwise you might get expected answers. – Naveen Jun 03 '13 at 16:40
  • I'm now trying Dojo Radio Buttons but ideally would like to use just a Radio Button group. –  Jun 04 '13 at 06:13
  • I've now solved the issue using Dojo Radio buttons and linking them using the groupName property. All radio buttons are bound to the same field. In read mode they all display the saved value but I work around this by hiding the radio buttons whose label != the saved value. Probably there is a better way of doing this but I haven't found it! –  Jun 04 '13 at 09:55
1

Yes, totally possible. As long as the HTML "name" attribute is the same then they will be treated as the same group. You can add this to your radio button in the All Properties under "attrs". Give it a name of "name" and a value of something common between radio buttons you want to group.

I am not even sure, that you need to use the Radio Button Group if you don't want.

Steve Zavocki
  • 1,840
  • 4
  • 21
  • 35
  • Thanks, I'm using the Dojo Radio button control and don't see any "attrs". Does this control have a corresponding property? –  Jun 03 '13 at 16:25
  • I'm sure you could add an HTML attribute as a dojo property. It's just basic HTML which is the lowest common denominator of all we do. Here is a link to dojo reference which I have found helpful in the past -->http://dojotoolkit.org/reference-guide/1.9/dijit/form/RadioButton.html?highlight=radio%20button – Steve Zavocki Jun 03 '13 at 16:32
  • Just thought of this, make sure you use the dojo reference that fits the version of dojo installed in your version of Domino Designer. 9.0 uses a newer version than 8.5.3. – Steve Zavocki Jun 03 '13 at 16:34
  • Using Firebug, I see that all radio buttons have the same name property. However, selecting a new value does not clear the old one which remains stored in the Notes Document. That's why I would prefer to use a Radio Button group. I just need to know how to add the radio buttons from a group in individual HTML table cells. –  Jun 04 '13 at 06:17