I want to create two RadioButtonBar objects that offer choices which are dynamically updated by a CheckboxBar. I also need to prevent them from having the same value. I got this far.

My Problem : When the currently selected button of a RadioButtonBar has its value updated through the CheckboxBar, it becomes de-selected. In other words, the value of the RadioButtonBar is updated, but not the value of the variable controlled by it.

I provide a toy example here, but in my real situation, I have many more dynamic lists and buttons. Hence, I'm looking for a solution that doesn't require each dList or dRadio to perform a long list of checks to determine what needs to be updated.

DynamicModule[{dList1 = {a}, dList2 = {d}, dList3 = {g}, dRadio1, dRadio2},

Grid[{

{"List 1:", CheckboxBar[Dynamic[dList1], {a, b, c}]},
{"List 2:", CheckboxBar[Dynamic[dList2], {d, e, f}]},
{"List 3:", CheckboxBar[Dynamic[dList3], {g, h, i}]},

{dList1, dList2, dList3}]]},
{dList1, dList2, dList3}]]},

• Could you provide an output you'd expect with some arbitrary input? – e.doroskevic Aug 8 '16 at 13:23
• Sure! if you use the code as provided, the first RadioButtonBar should have the first choice {a} selected. If you change dList1 to be {a,b} through the CheckboxBar, the value of the RadioButtonBar should update (as it does) and the first choice should still be selected. EDITED TO REFLECT CODE CHANGE. – Lokdal Aug 8 '16 at 14:00
• So, the problem is that it simply de-selects the value in your RadioButtonBars ? What about those dRadio1 and dRadio2 do they need to also update? What would they update to? – e.doroskevic Aug 8 '16 at 14:03
• They would need to update to the new value of the list they had previously selected. If dRadio1 = dList1 and dList1 changes, dRadio1 should update so that dRadio1 = dList1. – Lokdal Aug 8 '16 at 14:04

You can make your code work in the described way by simply changing the RadioButtonBar input to a {val1 -> labl1, ...} form.

DynamicModule[{dList1 = {a}, dList2 = {d}, dList3 = {g}, dRadio1, dRadio2},
Grid[{
{"List 1:", CheckboxBar[Dynamic[dList1], {a, b, c}]},
{"List 2:", CheckboxBar[Dynamic[dList2], {d, e, f}]},
{"List 3:", CheckboxBar[Dynamic[dList3], {g, h, i}]}, {"Radio 1:",

• @Lokdal For example, when dList1 is changed by the CheckboxBar, then dRadio1 stays the same. In my code the value of dRadio1 still matches its previous value and only the label is changed. In your code, as dList1 is changed, the value of dRadio1 no longer matches any of the {dList1, dList2, dList3}. In other word if dRadio1 matched dList1 (first radio button) before changing dList1, it doesn't match it after changing dList1. Its like having RadioButtonBar[0, {1, 2, 3}] now. Changing labels don't matter. – Karsten 7. Aug 9 '16 at 2:56