<?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 Column Selection issue in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Column-Selection-issue/m-p/874582#M103835</link>
    <description>&lt;P&gt;I am creating a visualization, storing all open file names in a listbox. I then want to select a specific file and display all numeric columns from that file into a colListBox. Oddly, this seems to work only for a file I created myself and not for two additional files from the sample directory. I tried setting the table of choice to the 'current datatable' but I am unable to figure out how to switch columns when I switch table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently it loads the columns for my defects.jmp table and not the others.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ns = newNameSpace();

// Get some Data
dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );		// JMP Library.
dt1 = Open( "$SAMPLE_DATA/Football.jmp" );		// JMP Library.
dt1 = Open( "defects.jmp" );					// Troy Local File.

// Get a list of open files
openDTs = {};
for(i=1, i&amp;lt;= nTable(), i++, 
	insertInto(openDTs, dataTable(i))
);
	
// Create File and Column Selector
selectionWindow = newWindow("Col Selection Test",	
	ns:tableBox = listBox("", &amp;lt;&amp;lt; setwidth(200), &amp;lt;&amp;lt; setNLines(5), maxSelected(1), 
		selectedTable = (ns:tableBox &amp;lt;&amp;lt; getSelected)[1];
		currentDatatable(dataTable(selectedTable));
		colList = dataTable(selectedTable) &amp;lt;&amp;lt; getColumnNames("Numeric");
		show(colList);
		ns:columnBox &amp;lt;&amp;lt; setItems(colList);
	);
	ns:tableBox &amp;lt;&amp;lt; setItems(openDTs);
	ns:columnBox = colListBox({}, width(177), &amp;lt;&amp;lt; setNLines(5), maxSelected(1));
	hListBox(ns:tableBox, ns:columnBox);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I select 'defects' I get the following which is the desired result&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarginalLlama65_0-1747699180058.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75975iCB44E6A7D89D1CF7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarginalLlama65_0-1747699180058.png" alt="MarginalLlama65_0-1747699180058.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, subsequent selections of the other tables do not populate the columns&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarginalLlama65_1-1747699226428.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75976i9320FC9CAF9E1B1A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarginalLlama65_1-1747699226428.png" alt="MarginalLlama65_1-1747699226428.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;defects.jmp table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarginalLlama65_2-1747699332661.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75977i8FE58CC9D832E482/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarginalLlama65_2-1747699332661.png" alt="MarginalLlama65_2-1747699332661.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried various options but nothing seems to work??? Weird.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
    <pubDate>Tue, 20 May 2025 00:02:50 GMT</pubDate>
    <dc:creator>MarginalLlama65</dc:creator>
    <dc:date>2025-05-20T00:02:50Z</dc:date>
    <item>
      <title>Column Selection issue</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Selection-issue/m-p/874582#M103835</link>
      <description>&lt;P&gt;I am creating a visualization, storing all open file names in a listbox. I then want to select a specific file and display all numeric columns from that file into a colListBox. Oddly, this seems to work only for a file I created myself and not for two additional files from the sample directory. I tried setting the table of choice to the 'current datatable' but I am unable to figure out how to switch columns when I switch table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently it loads the columns for my defects.jmp table and not the others.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ns = newNameSpace();

// Get some Data
dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );		// JMP Library.
dt1 = Open( "$SAMPLE_DATA/Football.jmp" );		// JMP Library.
dt1 = Open( "defects.jmp" );					// Troy Local File.

// Get a list of open files
openDTs = {};
for(i=1, i&amp;lt;= nTable(), i++, 
	insertInto(openDTs, dataTable(i))
);
	
// Create File and Column Selector
selectionWindow = newWindow("Col Selection Test",	
	ns:tableBox = listBox("", &amp;lt;&amp;lt; setwidth(200), &amp;lt;&amp;lt; setNLines(5), maxSelected(1), 
		selectedTable = (ns:tableBox &amp;lt;&amp;lt; getSelected)[1];
		currentDatatable(dataTable(selectedTable));
		colList = dataTable(selectedTable) &amp;lt;&amp;lt; getColumnNames("Numeric");
		show(colList);
		ns:columnBox &amp;lt;&amp;lt; setItems(colList);
	);
	ns:tableBox &amp;lt;&amp;lt; setItems(openDTs);
	ns:columnBox = colListBox({}, width(177), &amp;lt;&amp;lt; setNLines(5), maxSelected(1));
	hListBox(ns:tableBox, ns:columnBox);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I select 'defects' I get the following which is the desired result&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarginalLlama65_0-1747699180058.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75975iCB44E6A7D89D1CF7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarginalLlama65_0-1747699180058.png" alt="MarginalLlama65_0-1747699180058.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, subsequent selections of the other tables do not populate the columns&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarginalLlama65_1-1747699226428.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75976i9320FC9CAF9E1B1A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarginalLlama65_1-1747699226428.png" alt="MarginalLlama65_1-1747699226428.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;defects.jmp table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarginalLlama65_2-1747699332661.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75977i8FE58CC9D832E482/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarginalLlama65_2-1747699332661.png" alt="MarginalLlama65_2-1747699332661.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried various options but nothing seems to work??? Weird.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 00:02:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Selection-issue/m-p/874582#M103835</guid>
      <dc:creator>MarginalLlama65</dc:creator>
      <dc:date>2025-05-20T00:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Column Selection issue</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Selection-issue/m-p/874602#M103836</link>
      <description>&lt;P&gt;You will have to replace Col List Box as it will refer to specific data table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

ns = New Namespace();

Open("$SAMPLE_DATA/Big Class.jmp");
Open("$SAMPLE_DATA/Football.jmp");
Open("$SAMPLE_DATA/Cars.jmp");

dts = Get Data Table List() &amp;lt;&amp;lt; get name;
	
selectionWindow = New Window("Col Selection Test",
	H List Box(
		lb = List Box(
			dts,
			&amp;lt;&amp;lt; Set Width(200),
			&amp;lt;&amp;lt; Set NLines(5),
			maxSelected(1),
			sel_vals = lb &amp;lt;&amp;lt; Get Selected;
			If(N Items(sel_vals) &amp;gt; 0,
				(clb_collector &amp;lt;&amp;lt; Child) &amp;lt;&amp;lt; Delete Box();
				clb_collector &amp;lt;&amp;lt; Append(
					clb = Col List Box(Datatable(sel_vals[1]),
						&amp;lt;&amp;lt; Set Items(Data Table(sel_vals[1]) &amp;lt;&amp;lt; Get Column Names("Numeric", "String")),
						&amp;lt;&amp;lt; Set Data Type("Numeric"),
						width(177), 
						&amp;lt;&amp;lt;setNLines(5),
						maxSelected(1)
					)
				);
			);
		),
		clb_collector = V List Box(
			clb = Col List Box(Current Data Table(),
				&amp;lt;&amp;lt; Set Data Type("Numeric"),
				&amp;lt;&amp;lt; Set Items(Current Data Table() &amp;lt;&amp;lt; Get Column Names("Numeric", "String")),
				width(177), 
				&amp;lt;&amp;lt;setNLines(5),
				maxSelected(1)
			)
		)
	);
);
lb &amp;lt;&amp;lt; Set Selected(Contains(dts, Current Data Table() &amp;lt;&amp;lt; get name));
Write();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 May 2025 04:23:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Selection-issue/m-p/874602#M103836</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-05-20T04:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Column Selection issue</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Selection-issue/m-p/874644#M103843</link>
      <description>&lt;P&gt;Awesome, thanks Jarmo.&lt;/P&gt;
&lt;P&gt;Delete and re-append. Why didn't I think of that.&lt;/P&gt;
&lt;P&gt;Also, I wasn't aware of function 'Get Data Table List()' which is very handy :)&lt;/img&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 09:04:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Selection-issue/m-p/874644#M103843</guid>
      <dc:creator>MarginalLlama65</dc:creator>
      <dc:date>2025-05-20T09:04:44Z</dc:date>
    </item>
  </channel>
</rss>

