<?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 UI to select data table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/UI-to-select-data-table/m-p/516844#M74335</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a jsl code which creates a new window , displays all the data table and saves the column names containing particular string in the list . It doesn't work when the current data table tab has different file (see screen shot below).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jacksmith12_0-1656695027395.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43735i9DDDBF02566A9FAF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jacksmith12_0-1656695027395.png" alt="Jacksmith12_0-1656695027395.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The script works well when the data table file is selected in the current data table tab but doesn't work when I select the file from the list box and hit ok. Looking for some suggestion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// sample data file on Big class
dtNames = {};
For( t = 1, t &amp;lt;= N Table(), t++,
	Insert Into( dtNames, Data Table( t ) &amp;lt;&amp;lt; getName )
);
nw2 = New Window( "Data table selector",
			&amp;lt;&amp;lt;modal(),
			Spacer Box( Size( 20, 20 ) ),
			
				
					H List Box(
						Panel Box( "Pick a data table",
							dlg_dtlb_test = List Box( dtNames, width( 280 ), nlines( 10 ), MaxItems( 1 ) ),
							Spacer Box( Size( 10, 10 ) ),
							button = Button Box( "Click here to select the table",
								dt_test_select = dlg_dtlb_test &amp;lt;&amp;lt; getSelected;
								
								dt2 = Data Table( dt_test_select[1] );
								colist = {};
								Col_List = dt2 &amp;lt;&amp;lt; Get Column Names( "String" );
								
								For( q = 1, q &amp;lt;= N Items( Col_List ), q++, 
				
									If(
										Contains( Col_List[q], "height" ) | Contains( Col_List[q], "weight" ),
										Column( Col_List[q] ) &amp;lt;&amp;lt; Set Selected( 1 );
										Insert Into( colist, Col_List[q] );
									)
								);
								sel = button &amp;lt;&amp;lt; set button name( "File selected" );
								Caption( "File selected", spoken( 0 ) );
								Wait( 0.2 );
								Caption( remove );
								Wait( 0 );
								Wait( 1 );
								button &amp;lt;&amp;lt; set button name( "Click here to select the table" );,
								&amp;lt;&amp;lt;setIcon( "StructuralEquationModelsGoStatus" )
							))));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 17:03:15 GMT</pubDate>
    <dc:creator>Jackie_</dc:creator>
    <dc:date>2023-06-09T17:03:15Z</dc:date>
    <item>
      <title>UI to select data table</title>
      <link>https://community.jmp.com/t5/Discussions/UI-to-select-data-table/m-p/516844#M74335</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a jsl code which creates a new window , displays all the data table and saves the column names containing particular string in the list . It doesn't work when the current data table tab has different file (see screen shot below).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jacksmith12_0-1656695027395.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43735i9DDDBF02566A9FAF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jacksmith12_0-1656695027395.png" alt="Jacksmith12_0-1656695027395.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The script works well when the data table file is selected in the current data table tab but doesn't work when I select the file from the list box and hit ok. Looking for some suggestion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// sample data file on Big class
dtNames = {};
For( t = 1, t &amp;lt;= N Table(), t++,
	Insert Into( dtNames, Data Table( t ) &amp;lt;&amp;lt; getName )
);
nw2 = New Window( "Data table selector",
			&amp;lt;&amp;lt;modal(),
			Spacer Box( Size( 20, 20 ) ),
			
				
					H List Box(
						Panel Box( "Pick a data table",
							dlg_dtlb_test = List Box( dtNames, width( 280 ), nlines( 10 ), MaxItems( 1 ) ),
							Spacer Box( Size( 10, 10 ) ),
							button = Button Box( "Click here to select the table",
								dt_test_select = dlg_dtlb_test &amp;lt;&amp;lt; getSelected;
								
								dt2 = Data Table( dt_test_select[1] );
								colist = {};
								Col_List = dt2 &amp;lt;&amp;lt; Get Column Names( "String" );
								
								For( q = 1, q &amp;lt;= N Items( Col_List ), q++, 
				
									If(
										Contains( Col_List[q], "height" ) | Contains( Col_List[q], "weight" ),
										Column( Col_List[q] ) &amp;lt;&amp;lt; Set Selected( 1 );
										Insert Into( colist, Col_List[q] );
									)
								);
								sel = button &amp;lt;&amp;lt; set button name( "File selected" );
								Caption( "File selected", spoken( 0 ) );
								Wait( 0.2 );
								Caption( remove );
								Wait( 0 );
								Wait( 1 );
								button &amp;lt;&amp;lt; set button name( "Click here to select the table" );,
								&amp;lt;&amp;lt;setIcon( "StructuralEquationModelsGoStatus" )
							))));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:03:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/UI-to-select-data-table/m-p/516844#M74335</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2023-06-09T17:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: UI to select data table</title>
      <link>https://community.jmp.com/t5/Discussions/UI-to-select-data-table/m-p/516918#M74346</link>
      <description>&lt;P&gt;You need to change the active data table to the table the user selects.&amp;nbsp; The easiest way to do this is to add a Current Daa Table() function after the table is selected, and before an action is taken on the data table.&amp;nbsp; See below for the position I suggest&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// sample data file on Big class
dtNames = {};
For( t = 1, t &amp;lt;= N Table(), t++,
	Insert Into( dtNames, Data Table( t ) &amp;lt;&amp;lt; getName )
);
nw2 = New Window( "Data table selector",
	&amp;lt;&amp;lt;modal(),
	Spacer Box( Size( 20, 20 ) ), 
			
				
	H List Box(
		Panel Box( "Pick a data table",
			dlg_dtlb_test = List Box( dtNames, width( 280 ), nlines( 10 ), MaxItems( 1 ) ),
			Spacer Box( Size( 10, 10 ) ),
			button = Button Box( "Click here to select the table",
				dt_test_select = dlg_dtlb_test &amp;lt;&amp;lt; getSelected;
								
				dt2 = Data Table( dt_test_select[1] );
				current data table(dt2);
				colist = {};
				Col_List = dt2 &amp;lt;&amp;lt; Get Column Names( "String" );
								
				For( q = 1, q &amp;lt;= N Items( Col_List ), q++, 
				
					If( Contains( Col_List[q], "height" ) | Contains( Col_List[q], "weight" ),
						Column( Col_List[q] ) &amp;lt;&amp;lt; Set Selected( 1 );
						Insert Into( colist, Col_List[q] );
					)
				);
				sel = button &amp;lt;&amp;lt; set button name( "File selected" );
				Caption( "File selected", spoken( 0 ) );
				Wait( 0.2 );
				Caption( remove );
				Wait( 0 );
				Wait( 1 );
				button &amp;lt;&amp;lt; set button name( "Click here to select the table" );,
				&amp;lt;&amp;lt;setIcon( "StructuralEquationModelsGoStatus" )
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jul 2022 20:23:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/UI-to-select-data-table/m-p/516918#M74346</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-01T20:23:14Z</dc:date>
    </item>
  </channel>
</rss>

