<?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: Possible to update an object in a non-modal window in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Possible-to-update-an-object-in-a-non-modal-window/m-p/482436#M72683</link>
    <description>&lt;P&gt;That works great!&amp;nbsp; Looks like I need to understand&amp;nbsp; "append" better.&amp;nbsp; Also, you are correct, I need to add in a check for duplicate items and remove them.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Apr 2022 15:14:04 GMT</pubDate>
    <dc:creator>shampton82</dc:creator>
    <dc:date>2022-04-27T15:14:04Z</dc:date>
    <item>
      <title>Possible to update an object in a non-modal window</title>
      <link>https://community.jmp.com/t5/Discussions/Possible-to-update-an-object-in-a-non-modal-window/m-p/482412#M72681</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;I have a script that will bring up a column dialog and the manage spec limit platform.&amp;nbsp; I'd like to be able to click the update button and have the manage spec limit table reflect the selected columns.&amp;nbsp; I have not be able to figure this out so the work around is to have the window close and then reopen calling some global variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone propose a less cumbersome way of accomplishing this?&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="shampton82_0-1651068867161.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/42058iBA2641200F0C8740/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shampton82_0-1651068867161.png" alt="shampton82_0-1651068867161.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any ideas!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
dt=current data table();

nc = N Col( dt );
lbWidth = 250;
cw=0;



if(::trigger==1,,::dtcol=dt&amp;lt;&amp;lt;get selected columns);



nw=new window("Manage specs",
				v list box(
							h list box(
								panel box("columns",
									colListData = Filter Col Selector( All, width( lbWidth ), nLines( Min( nc, 20 ) ) )
									
									
								),
								panel box("spec table",obj = dt &amp;lt;&amp;lt; Manage Spec Limits( Y(eval(::dtcol)));)
								
							),
							H list box(H List Box( button box("update col selection",::trigger=1; ::dtcol =colListData &amp;lt;&amp;lt; GetSelected; nw&amp;lt;&amp;lt;close window(); include("C:\Users\steve.hampton\OneDrive - Precision Castparts Corp\Desktop\JMP\Scripts\spec limits with cols.jsl"); )
													, 
													button box("append col selection",test={};newitems=colListData &amp;lt;&amp;lt; GetSelected; insert into(test,::dtcol); insert into(test,newitems); ::dtcol=eval(test); ::trigger=1;nw&amp;lt;&amp;lt;close window(); include("C:\Users\steve.hampton\OneDrive - Precision Castparts Corp\Desktop\JMP\Scripts\spec limits with cols.jsl"); )
													,
													Button Box( "Close window", nw&amp;lt;&amp;lt;close window();::dtcol={}; ::trigger=0; test={}; ) 
														
													)
										)
						)
	
);

nw&amp;lt;&amp;lt;on close(::dtcol={}; ::trigger=0; test={};);

colListData &amp;lt;&amp;lt; Clear selection;

colListData &amp;lt;&amp;lt; character( 0 );
colListData &amp;lt;&amp;lt; nominal( 0 );
colListData &amp;lt;&amp;lt; ordinal( 0 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:57:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Possible-to-update-an-object-in-a-non-modal-window/m-p/482412#M72681</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2023-06-09T16:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update an object in a non-modal window</title>
      <link>https://community.jmp.com/t5/Discussions/Possible-to-update-an-object-in-a-non-modal-window/m-p/482431#M72682</link>
      <description>&lt;P&gt;I would do this by removing display box and then appending it again with new column list. The most difficult part is most likely getting the old list of columns in Manage Spec limits (and removing duplicated column names), below is one option what you could do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

// init one column for a bit easier management
col_list = {"NPN1"};

nw = New Window("",
	H List Box(
		fcl = Filter Col Selector(),
		pb = Panel Box("spec table", 
			obj = dt &amp;lt;&amp;lt; Manage Spec Limits(Y(Eval(col_list)))
		),
		Button Box("Update",
			col_list = fcl &amp;lt;&amp;lt; get selected;
			obj &amp;lt;&amp;lt; Delete Box;
			pb &amp;lt;&amp;lt; Append(obj = dt &amp;lt;&amp;lt; Manage Spec Limits(Y(Eval(col_list)));)
		),
		Button Box("Append",
			old_cols = (Report(obj) &amp;lt;&amp;lt; Find(Table Box(1)))[1] &amp;lt;&amp;lt; Get;
			col_list = fcl &amp;lt;&amp;lt; get selected;
			Insert Into(col_list, old_cols); 
			// you should most likely remove dublicates from list
			obj &amp;lt;&amp;lt; Delete Box;
			pb &amp;lt;&amp;lt; Append(obj = dt &amp;lt;&amp;lt; Manage Spec Limits(Y(Eval(col_list)));)
		)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Apr 2022 14:49:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Possible-to-update-an-object-in-a-non-modal-window/m-p/482431#M72682</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-04-27T14:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Possible to update an object in a non-modal window</title>
      <link>https://community.jmp.com/t5/Discussions/Possible-to-update-an-object-in-a-non-modal-window/m-p/482436#M72683</link>
      <description>&lt;P&gt;That works great!&amp;nbsp; Looks like I need to understand&amp;nbsp; "append" better.&amp;nbsp; Also, you are correct, I need to add in a check for duplicate items and remove them.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 15:14:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Possible-to-update-an-object-in-a-non-modal-window/m-p/482436#M72683</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2022-04-27T15:14:04Z</dc:date>
    </item>
  </channel>
</rss>

