<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Enable Modal Radio Box Items based on predefined list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Enable-Modal-Radio-Box-Items-based-on-predefined-list/m-p/367653#M61755</link>
    <description>&lt;P&gt;Would example like this help?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

//radiobox variables
enableList = {2,5};
rbItems = {"one", "two", "three", "four", "five"};
rb = Radio Box(rbItems);

//start as all disabled
For(i = 1, i &amp;lt;= N Items(rb &amp;lt;&amp;lt; get items), i++,
	rb &amp;lt;&amp;lt; enable item(i,0);
);

//enable based on enableList
For(i = 1, i &amp;lt;= N Items(enableList), i++,
	rb &amp;lt;&amp;lt; enable item(enableList[i],1);
);
//change first selection to first in enableList (otherwise will be first in rbItems)
rb &amp;lt;&amp;lt; Set(enableList[1], 1);

//create modal
ok_pressed = 0;
ex = New Window("Dialog() example",
	&amp;lt;&amp;lt;Modal,
	V List Box(
		rb,
		H List Box(
			Button Box("OK", ok_pressed = 1; rbSelection = rb &amp;lt;&amp;lt; get),
			Button Box("Cancel", ok_pressed = 0)
		)
	)
);

If(ok_pressed == 1,
	show(rbSelection);
	show(rbItems[rbSelection]);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 13 Mar 2021 07:41:16 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-03-13T07:41:16Z</dc:date>
    <item>
      <title>Enable Modal Radio Box Items based on predefined list</title>
      <link>https://community.jmp.com/t5/Discussions/Enable-Modal-Radio-Box-Items-based-on-predefined-list/m-p/367608#M61751</link>
      <description>&lt;P&gt;I am trying to Enable/Disable certain radio box buttons in a single radio box based on a list I have entering the Modal dialog with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance, say my list is {2, 5} and my radio box has 5 buttons in it. When the Modal window opens, I only want buttons 2 and 5 (from the list, which is based on previous user input) to be enabled and buttons 1, 3, and 4 to be disabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to add a For loop and an If loop with a Contains formula into the setting up of the radio box, but they seems to only get called when a different button is clicked in the radio box, not when it is originally set up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:08:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Enable-Modal-Radio-Box-Items-based-on-predefined-list/m-p/367608#M61751</guid>
      <dc:creator>Martin</dc:creator>
      <dc:date>2023-06-09T22:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Enable Modal Radio Box Items based on predefined list</title>
      <link>https://community.jmp.com/t5/Discussions/Enable-Modal-Radio-Box-Items-based-on-predefined-list/m-p/367653#M61755</link>
      <description>&lt;P&gt;Would example like this help?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

//radiobox variables
enableList = {2,5};
rbItems = {"one", "two", "three", "four", "five"};
rb = Radio Box(rbItems);

//start as all disabled
For(i = 1, i &amp;lt;= N Items(rb &amp;lt;&amp;lt; get items), i++,
	rb &amp;lt;&amp;lt; enable item(i,0);
);

//enable based on enableList
For(i = 1, i &amp;lt;= N Items(enableList), i++,
	rb &amp;lt;&amp;lt; enable item(enableList[i],1);
);
//change first selection to first in enableList (otherwise will be first in rbItems)
rb &amp;lt;&amp;lt; Set(enableList[1], 1);

//create modal
ok_pressed = 0;
ex = New Window("Dialog() example",
	&amp;lt;&amp;lt;Modal,
	V List Box(
		rb,
		H List Box(
			Button Box("OK", ok_pressed = 1; rbSelection = rb &amp;lt;&amp;lt; get),
			Button Box("Cancel", ok_pressed = 0)
		)
	)
);

If(ok_pressed == 1,
	show(rbSelection);
	show(rbItems[rbSelection]);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Mar 2021 07:41:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Enable-Modal-Radio-Box-Items-based-on-predefined-list/m-p/367653#M61755</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-03-13T07:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Enable Modal Radio Box Items based on predefined list</title>
      <link>https://community.jmp.com/t5/Discussions/Enable-Modal-Radio-Box-Items-based-on-predefined-list/m-p/367667#M61757</link>
      <description>&lt;P&gt;Thanks Jarmo!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works exactly like I had hoped. I was not thinking of "pre setting up" the radio box, before showing it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 12:39:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Enable-Modal-Radio-Box-Items-based-on-predefined-list/m-p/367667#M61757</guid>
      <dc:creator>Martin</dc:creator>
      <dc:date>2021-03-13T12:39:31Z</dc:date>
    </item>
  </channel>
</rss>

