<?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: Generate a Matrix of Selectable checkboxes in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51894#M29435</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1855"&gt;@Justin_Chilton&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 1 follow up question I have is - Is it possible to add text on top of each column and at the beginning of each row&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; If so, what would be an&amp;nbsp; efficient way to do it ? Should each of them be wrapped in a text box ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Feb 2018 20:06:42 GMT</pubDate>
    <dc:creator>uday_guntupalli</dc:creator>
    <dc:date>2018-02-22T20:06:42Z</dc:date>
    <item>
      <title>Generate a Matrix of Selectable checkboxes</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51833#M29402</link>
      <description>&lt;P&gt;All,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Wondering what is the easiest way to generate a matrix of selectable checkboxes . So what i would like to be able to do is - generate a non- square matrix and pop it up for the user to select any position in the matrix the user would like. As long as the user can select multiple rows within a column and vice versa - it would be good to meet the need. Any help is appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 13:54:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51833#M29402</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-02-22T13:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a Matrix of Selectable checkboxes</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51842#M29407</link>
      <description>&lt;P&gt;Not a very elegant solution, but something like this may work:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;lv={};
for(i=1,i&amp;lt;=4,i++, insert into(lv,""));
tCB="";
for(j=1,j&amp;lt;6,j++,tCB||="check box( (lv)),");	
tCB=substr(tcB,1,length(tCB)-1);
eval(parse(eval insert("wind=new window( \!"Check boxes\!",
	H List Box(
	^tCB^))")));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Feb 2018 14:37:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51842#M29407</guid>
      <dc:creator>thomasz</dc:creator>
      <dc:date>2018-02-22T14:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a Matrix of Selectable checkboxes</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51854#M29409</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3341"&gt;@thomasz&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I think for my needs - it looks good. However, if I may - I have a couple of follow up questions:&lt;/P&gt;&lt;P&gt;1. Are the selected positions retrievable ? - If yes- can you kindly provide an example of how to retrieve that data ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Is it possible to add a little more text around this window ? More like an X - axis label and a Y-Axis label&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 15:09:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51854#M29409</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-02-22T15:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a Matrix of Selectable checkboxes</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51865#M29413</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can use a CheckBox() within a Table Box to create a table of check boxes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nRow = 5;
nCol = 6;

// create a table box to contain everything
tbl = Table Box();

// add all columns with the given number of rows
For( i = 1, i &amp;lt;= nCol, i++,
	Insert Into( tbl, Check Box( Repeat( {" "}, nRow ) ) )
);

New Window( "Check Box Example",
	tbl,
	Button Box( "Show results",
		// initialize the result
		result = {}; 
		// loop through each row
		For( i = 1, i &amp;lt;= nRow, i++,
			// initialize the row list
			result[i] = {};
			// loop through each column getting values
			For( j = 1, j &amp;lt;= nCol, j++,
				result[i][j] = tbl[CheckBoxBox( j )] &amp;lt;&amp;lt; get( i )
			);
		);
		// convert the list to a 2-d matrix
		result = Matrix( result );
		Show( result );
	)
);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here's what the window looks like:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 192px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9470iA62F98E14C76DED5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And here's the result in the log with the above selected Check Boxes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;result = 
[	1 0 0 0 0 0, 
	0 1 0 0 0 0, 
	0 0 1 0 0 0, 
	0 0 0 1 0 0, 
	0 0 0 0 1 0];&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 15:59:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51865#M29413</guid>
      <dc:creator>Justin_Chilton</dc:creator>
      <dc:date>2018-02-22T15:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a Matrix of Selectable checkboxes</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51894#M29435</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1855"&gt;@Justin_Chilton&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 1 follow up question I have is - Is it possible to add text on top of each column and at the beginning of each row&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; If so, what would be an&amp;nbsp; efficient way to do it ? Should each of them be wrapped in a text box ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 20:06:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51894#M29435</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-02-22T20:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a Matrix of Selectable checkboxes</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51897#M29437</link>
      <description>&lt;P&gt;You can add a heading to a CheckBox within a TableBox using the &amp;lt;&amp;lt;Set Heading message. You can also add row labels by placing a StringColBox as the first column in the Table Box.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nRow = 5;
nCol = 6;

// string col box for row labels
scb = String Col Box( "", {} );

// add labels to rows
For( i = 1, i &amp;lt;= nRow, i++,
	scb &amp;lt;&amp;lt; Add Element( "row" || Char( i ) )
);

// create a table box to contain everything
tbl = Table Box( scb );

// add all columns with the given number of rows
For( i = 1, i &amp;lt;= nCol, i++,
	Insert Into(
		tbl,
		Check Box(
			Repeat( {" "}, nRow ),
			&amp;lt;&amp;lt;Set Heading( "col" || Char( i ) )
		)
	)
);

New Window( "Check Box Example",
	tbl,
	Button Box( "Show results", 
		// initialize the result
		result = {}; 
		// loop through each row
		For( i = 1, i &amp;lt;= nRow, i++, 
			// initialize the row list
			result[i] = {};
			// loop through each column getting values
			For( j = 1, j &amp;lt;= nCol, j++,
				result[i][j] = tbl[CheckBoxBox( j )] &amp;lt;&amp;lt; get( i )
			);
		);
		// convert the list to a 2-d matrix
		result = Matrix( result );
		Show( result );
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Window:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 356px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9474iDED5F1A5020B0CDA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 20:15:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/51897#M29437</guid>
      <dc:creator>Justin_Chilton</dc:creator>
      <dc:date>2018-02-22T20:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a Matrix of Selectable checkboxes</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/54203#M30626</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1855"&gt;@Justin_Chilton&lt;/a&gt;&amp;nbsp;/&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;/&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3341"&gt;@thomasz&lt;/a&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I have a follow up question, wondering if any of you could think of a way to do this. I am trying to generate the matrix of selectable boxes within a Panel Box. Here is the script, I have, wondering if you could guide as to why I am failing ?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;InputsLoadBasic =
Expr(
		LB1 = Lineup Box( N Col( 2 ) );
		LB1 &amp;lt;&amp;lt; Append(Panel Box( "Test",
									V List Box(
											V List Box(
														Text Box( "Arg1" ),
														NEB_arg1 = Number Edit Box( 2 ),
														Text Box( "Arg2" ),
														NEB_arg2 = Number Edit Box( 3 ),
													   )
											  )
							   )
					 );
												
		LB1 &amp;lt;&amp;lt; Append(Panel Box( "Selectable Matrix Test",
									V List Box(
												Button Box("Enter Target Matrix",
															nR = 12;
															nC = 24;
															SCB1 = String Col Box( "", {} ); 
																																																						
															For( i = 1, i &amp;lt;= nR, i++,
																SCB1 &amp;lt;&amp;lt; Add Element( Char( i ) )
															   );
															TB1 = Table Box( SCB1 ); 
																																																					
															For( i = 1, i &amp;lt;= nC, i++,
																Insert Into( TB1, Check Box( Repeat( {" "}, nR ), &amp;lt;&amp;lt;Set Heading( Char( i ) ) ) )
															   );
															   
															// initialize the result
															ResMat = {}; 
															// loop through each row
															For( i = 1, i &amp;lt;= nR, i++, 
																	ResMat[i] = {};
																	// loop through each column getting values
																	For( r = 1, r &amp;lt;= nC, r++,
																			ResMat[i][r] = TB1[CheckBoxBox( r )] &amp;lt;&amp;lt; get( i )
																	   );	
															   );
															// convert the list to a 2-d matrix
															ResMat = Matrix( ResMat );
													
														  )
										      )
							   )
					 );
	); 
InputsLoadBasic;

InputsUnloadBasic =
Expr(
		V List Box(
					Align( center ),
					LB1,
					H List Box(
								Button Box( "OK", 
																																															
											// Unload PV Prediction Details 
											arg1 = NEB_arg1 &amp;lt;&amp;lt; Get; 
											arg2 = NEB_arg2 &amp;lt;&amp;lt; Get; 
																	
											ResultMatrix = Matrix( ResMat );
																																			
										  )// end of button box 
							 )// end of H List Box 
				  )// end of V List Box
	); 
	
NW1 = New Window("TestUI",
					V List Box(
								InputsLoadBasic;
								InputsUnloadBasic;
							  )
				);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 267px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10168i95B7FDB5C888B57F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The resulting UI looks like what I want, however, when I click on the&amp;nbsp; "Enter Target Matrix" button shown above, it does not do what I want. Can you please help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 16:18:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/54203#M30626</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-30T16:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Generate a Matrix of Selectable checkboxes</title>
      <link>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/62845#M33811</link>
      <description>&lt;P&gt;I realize I'm late to the game, and hopefully you've already figured this out.&amp;nbsp; The main issue is you never displayed the Table Box in your code.&amp;nbsp; I believe the next issue is you analyze the table right after creating it.&amp;nbsp; I imagine you want to do this after the user has a chance to check the boxes.&amp;nbsp; Hopefully the below code is closer to what you are looking for.&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 );

InputsLoadBasic = Expr(
	LB1 = Lineup Box( N Col( 2 ) );
	LB1 &amp;lt;&amp;lt; Append(
		Panel Box( "Test",
			V List Box( V List Box( Text Box( "Arg1" ), NEB_arg1 = Number Edit Box( 2 ), Text Box( "Arg2" ), NEB_arg2 = Number Edit Box( 3 ), ) )
		)
	);
	
	LB1 &amp;lt;&amp;lt; Append(
		Panel Box( "Selectable Matrix Test",
			V List Box(
				Button Box( "Enter Target Matrix",
					nR = 12;
					nC = 24;
					SCB1 = String Col Box( "", {} ); 
					
					if(!isempty(TB1),
						TB1 &amp;lt;&amp;lt; Delete Box;
					);
					
					For( i = 1, i &amp;lt;= nR, i++,
						SCB1 &amp;lt;&amp;lt; Add Element( Char( i ) )
					);
					TB1 = Table Box( SCB1 ); 

					For( i = 1, i &amp;lt;= nC, i++,
						Insert Into( TB1, Check Box( Repeat( {" "}, nR ), &amp;lt;&amp;lt;Set Heading( Char( i ) ) ) )
					);
					
					LB1 &amp;lt;&amp;lt; Append(TB1);
				)
			)
		)
	);
);
InputsLoadBasic;

InputsUnloadBasic = Expr(
	V List Box(Align( center ),
		LB1,
		H List Box(
			Button Box( "OK", 
				// Unload PV Prediction Details 
				arg1 = NEB_arg1 &amp;lt;&amp;lt; Get;
				arg2 = NEB_arg2 &amp;lt;&amp;lt; Get;
				
				// initialize the result
				ResMat = {}; 
				// loop through each row
				For( i = 1, i &amp;lt;= nR, i++,
					ResMat[i] = {};
					// loop through each column getting values
					For( r = 1, r &amp;lt;= nC, r++,
						ResMat[i][r] = TB1[CheckBoxBox( r )] &amp;lt;&amp;lt; get( i )
					);
				);
				// convert the list to a 2-d matrix
				ResMat = Matrix( ResMat );
				 	
				ResultMatrix = Matrix( ResMat );
				
				print(ResultMatrix);
			)// end of button box 
		)// end of H List Box 
	)// end of V List Box
); 
	
NW1 = New Window( "TestUI",
	V List Box(
		InputsLoadBasic;
		InputsUnloadBasic;
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jul 2018 15:02:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Generate-a-Matrix-of-Selectable-checkboxes/m-p/62845#M33811</guid>
      <dc:creator>msharp</dc:creator>
      <dc:date>2018-07-13T15:02:16Z</dc:date>
    </item>
  </channel>
</rss>

