<?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: Loop through the check boxes to get the values in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/280644#M54370</link>
    <description>&lt;P&gt;Please paste a copy of the JSL into your response using the&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jsl.PNG" style="width: 55px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25583iB6CCE1FBB057C819/image-size/large?v=v2&amp;amp;px=999" role="button" title="jsl.PNG" alt="jsl.PNG" /&gt;&lt;/span&gt;so that the community can just copy and paste into JMP to work on your discussion item.&amp;nbsp; You can also attach the JSL as a separate file.&amp;nbsp; Otherwise, each Community member will have to manually retype in your JSL in order to work on it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may also want to rethink your approach.&amp;nbsp; I believe you can get what you want using a Local Data Filter, which would allow the user to Dynamically change the Overlay plot rather than just allowing one setting and then having to rerun the code to make a different selection of devices&lt;/P&gt;
&lt;P&gt;.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jsl2.PNG" style="width: 806px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25584i76B7963AF8F77886/image-size/large?v=v2&amp;amp;px=999" role="button" title="jsl2.PNG" alt="jsl2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jul 2020 09:48:58 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-07-21T09:48:58Z</dc:date>
    <item>
      <title>Loop through the check boxes to get the values</title>
      <link>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/280638#M54369</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I want to generate an overlay plot using my script. The plot is overlaid by the “Device_Type” column in my data table. However, I would like to let the user choose which device type they want to include in the overlay plot. Therefore, I want to create a list of checkboxes in the user interface. Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Close All( Data Tables, NoSave );//close all previous windows
dt1 =	Open("data_device.jmp");
		
		
//extract a list of unique device types
Summarize( dt1, byDevice = by( :Device_Type ) );

//user interface
stop_flag = 0;
win = New Window("user interface",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;ReturnResult,
	V List Box(
	Text Box ("Create an overlay plot"),
	p3_box = H List Box(),
		db = {},
		For (i=1, i&amp;lt;= N items(byDevice),i++,
		db[i] = checkbox((byDevice[i]));
		p3_box &amp;lt;&amp;lt; Append(db[i]);
		),
	H List Box(
		Button Box("OK",
			For (i=1, i&amp;lt;= N items(byDevice),i++,
			 db_gen [i] = db[i] &amp;lt;&amp;lt; Get(i);
			),
		),
		Button Box("Cancel",
			stop_flag = 1;
		),
	),
	),
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The checkboxes can be created successfully as below, but I was wondering how could I loop through the checkboxes to get the value for each checkbox?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="box.PNG" style="width: 219px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25582iC174E20D809C72B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="box.PNG" alt="box.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be really appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:32:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/280638#M54369</guid>
      <dc:creator>hahahaqing</dc:creator>
      <dc:date>2023-06-09T23:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through the check boxes to get the values</title>
      <link>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/280644#M54370</link>
      <description>&lt;P&gt;Please paste a copy of the JSL into your response using the&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jsl.PNG" style="width: 55px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25583iB6CCE1FBB057C819/image-size/large?v=v2&amp;amp;px=999" role="button" title="jsl.PNG" alt="jsl.PNG" /&gt;&lt;/span&gt;so that the community can just copy and paste into JMP to work on your discussion item.&amp;nbsp; You can also attach the JSL as a separate file.&amp;nbsp; Otherwise, each Community member will have to manually retype in your JSL in order to work on it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may also want to rethink your approach.&amp;nbsp; I believe you can get what you want using a Local Data Filter, which would allow the user to Dynamically change the Overlay plot rather than just allowing one setting and then having to rerun the code to make a different selection of devices&lt;/P&gt;
&lt;P&gt;.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jsl2.PNG" style="width: 806px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25584i76B7963AF8F77886/image-size/large?v=v2&amp;amp;px=999" role="button" title="jsl2.PNG" alt="jsl2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 09:48:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/280644#M54370</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-07-21T09:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through the check boxes to get the values</title>
      <link>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/280663#M54371</link>
      <description>&lt;P&gt;If, for whatever reason, you still want to use the check boxes in your window, you do not need to iterate over each box if you use the default vertical orientation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

items = { "One", "Two", "Three" };

New Window( "Check This", &amp;lt;&amp;lt; Modal,
	Panel Box( "Items",
		cb = Check Box( items )
	),
	H List Box(
		Button Box( "OK",
			which = cb &amp;lt;&amp;lt; Get Selected;
			where = cb &amp;lt;&amp;lt; Get Selected Indices;
		)
	)
);

Show( which, where );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jul 2020 11:19:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/280663#M54371</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-07-21T11:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through the check boxes to get the values</title>
      <link>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/281976#M54565</link>
      <description>&lt;P&gt;It helps a lot! Thank you so much!&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jul 2020 19:17:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/281976#M54565</guid>
      <dc:creator>hahahaqing</dc:creator>
      <dc:date>2020-07-25T19:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through the check boxes to get the values</title>
      <link>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/281977#M54566</link>
      <description>&lt;P&gt;I've fixed that! Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jul 2020 19:17:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Loop-through-the-check-boxes-to-get-the-values/m-p/281977#M54566</guid>
      <dc:creator>hahahaqing</dc:creator>
      <dc:date>2020-07-25T19:17:36Z</dc:date>
    </item>
  </channel>
</rss>

