<?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: Appending to a Col List Box is not working in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Appending-to-a-Col-List-Box-is-not-working/m-p/760614#M93893</link>
    <description>&lt;P&gt;The Active data table is not being set when a table is selected that is not the most recent table loaded.&amp;nbsp; Add the following line after the line&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;colNames = dt &amp;lt;&amp;lt; get column names;
Current Data Table( dt );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That will set the active data table to the table selected from the combo box&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 13:17:01 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2024-05-23T13:17:01Z</dc:date>
    <item>
      <title>Appending to a Col List Box is not working</title>
      <link>https://community.jmp.com/t5/Discussions/Appending-to-a-Col-List-Box-is-not-working/m-p/760590#M93892</link>
      <description>&lt;P&gt;I have tried the script below on both JMP 17.1 and JMP 18.0.&amp;nbsp; (I'm fairly sure it's me and not a bug).&amp;nbsp; I am having the user select their table from any of their open tables and then choose a Y column, X column and a Grouping column in the form of Col List Boxes.&amp;nbsp; The issue is that the script only works for the last table in the Combo Box.&amp;nbsp; It won't work for any of the first 2 tables shown in my example below.&amp;nbsp; When you press any of the buttons ("Y col", "X col" or "Group col") it doesn't fill in the selected columns you've chosen.&amp;nbsp; BUT, it does work if you select the last table in the drop-down list.&amp;nbsp; Any ideas would be appreciated.&amp;nbsp; BTW, I am trying the loosely follow the scripting in the Example 3 of the Scripting Index for Col List Boxes.&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);

dt.crops	= open("$sample_data\crops.jmp");
dt.bigclass	= open("$sample_data\big class.jmp");
dt.cars 	= open("$sample_data\cars.jmp");

windowList = get window list(type("data tables")) &amp;lt;&amp;lt; get window title();
insert into(windowList, "Choose", 1);	//make the user change the combo box to one of the tables

nwSelect = new window("Choose table and columns", &amp;lt;&amp;lt;modal,
	v list box(
		vlb = v list box(
			panel box("Select table",
				cb_openwin = combo box(
					windowList, 
					dt = data table(cb_openwin &amp;lt;&amp;lt; get selected);
					colNames = dt &amp;lt;&amp;lt; get column names; 
					try(remove from(vlb,2));  		//remove a previous choice if the combo box changes
					vlb &amp;lt;&amp;lt; append(
						pb = panel box("Select Y and X",
							h list box(
								clbCols = Col List Box(data table(dt), all),
								v list box(
									button box("Y col",
										clbYcol &amp;lt;&amp;lt; append( clbCols &amp;lt;&amp;lt; get selected);
									),
									button box("X col",
										clbXcol &amp;lt;&amp;lt; append( clbCols &amp;lt;&amp;lt; get selected);
									),
									button box("Group col",
										clbGcol &amp;lt;&amp;lt; append( clbCols &amp;lt;&amp;lt; get selected);
									),
								),
								v list box(
									clbYcol = Col List Box( maxitems(1), n lines(1) ),
									clbXcol = Col List Box( maxitems(1), n lines(1) ),
									clbGcol = Col List Box( maxitems(1), n lines(1) ),
								),
							),
						),	
					);
				),
			),			
		),
		h list box(
			button box("OK",
				YcolList = clbYcol &amp;lt;&amp;lt; get items;
				XcolList = clbXcol &amp;lt;&amp;lt; get items;
				GcolList = clbGcol &amp;lt;&amp;lt; get items;
			),
			bbc = button box("Cancel"),
		),
	),
);

//close window if Cancel is pressed
if( nwSelect == {Button(-1)}, stop() );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 May 2024 12:42:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Appending-to-a-Col-List-Box-is-not-working/m-p/760590#M93892</guid>
      <dc:creator>tbidwell</dc:creator>
      <dc:date>2024-05-23T12:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Appending to a Col List Box is not working</title>
      <link>https://community.jmp.com/t5/Discussions/Appending-to-a-Col-List-Box-is-not-working/m-p/760614#M93893</link>
      <description>&lt;P&gt;The Active data table is not being set when a table is selected that is not the most recent table loaded.&amp;nbsp; Add the following line after the line&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;colNames = dt &amp;lt;&amp;lt; get column names;
Current Data Table( dt );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That will set the active data table to the table selected from the combo box&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 13:17:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Appending-to-a-Col-List-Box-is-not-working/m-p/760614#M93893</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-05-23T13:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Appending to a Col List Box is not working</title>
      <link>https://community.jmp.com/t5/Discussions/Appending-to-a-Col-List-Box-is-not-working/m-p/760616#M93894</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;, Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 13:33:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Appending-to-a-Col-List-Box-is-not-working/m-p/760616#M93894</guid>
      <dc:creator>tbidwell</dc:creator>
      <dc:date>2024-05-23T13:33:39Z</dc:date>
    </item>
  </channel>
</rss>

