<?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: Script to enter new row data in popup window. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/720298#M90251</link>
    <description>&lt;P&gt;Hey Jarmo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just building off of this request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to have the Combo Box options automatically update based on List Check values in that column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jan 2024 19:28:59 GMT</pubDate>
    <dc:creator>CTrahon0526</dc:creator>
    <dc:date>2024-01-30T19:28:59Z</dc:date>
    <item>
      <title>Script to enter new row data in popup window.</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/709734#M89366</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to have a script produce a popup window for a user to enter data that will be added to a new row. The user only needs to add data in certain columns. I am close with the script but can't figure out how to get it to work. Added the data table with my script attempt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be appreciated, thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 19:47:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/709734#M89366</guid>
      <dc:creator>CTrahon0526</dc:creator>
      <dc:date>2023-12-15T19:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script to enter new row data in popup window.</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/709752#M89367</link>
      <description>&lt;P&gt;I would use &lt;LI-MESSAGE title="Data table subscripting" uid="21013" url="https://community.jmp.com/t5/Uncharted/Data-table-subscripting/m-p/21013#U21013" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; in case like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Current Data Table();

// present choices to user
nw = New Window("Add New Row Data",
	&amp;lt;&amp;lt;Modal,
	Panel Box("Row Data",
		Lineup Box(N Col(2),
			Text Box("Chamber ID"),
			v1 = Number Edit Box(401.1),
			Text Box("Pct WW Down (put 0 if CHx 100% up)"),
			v2 = Number Edit Box(0),
			Text Box("Reason"),
			v3 = Text Edit Box("Enter Text Here"),
			Text Box("Year"),
			v4 = Number Edit Box(2023),
			Text Box("Work Week"),
			v5 = Number Edit Box(1),
			Text Box("Scheduled or Unscheduled"),
			v6 = Text Edit Box("Unscheduled")
		)
	), 
	V List Box(
		Lineup Box(N Col(2),
			Button Box("Click to Add Row", // this script runs when the button is pressed...
				vals = {};
				Insert Into(vals, v1 &amp;lt;&amp;lt; Get);
				Insert Into(vals, v2 &amp;lt;&amp;lt; Get);
				Insert Into(vals, v3 &amp;lt;&amp;lt; Get Text);
				Insert Into(vals, v4 &amp;lt;&amp;lt; Get);
				Insert Into(vals, v5 &amp;lt;&amp;lt; Get);
				Insert Into(vals, v6 &amp;lt;&amp;lt; Get Text);
				dt &amp;lt;&amp;lt; Add Rows(1);
				dt[N Rows(dt), {"CH ID", "Pct WW DWN", "Reason", "Year", "WW", "Sched/Unsch"}] = vals;
               //{:CH ID = v1, Pct WW DWN = v2, Reason = v3, Year = v4, WW = v5, Sched/Unsch = "Scheduled"});
			),
			Button Box("Cancel")
		);
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also hints might be useful with Text Edit Boxes for you (and if you want to force users to add something there, you have to handle that also)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
win = New Window("Example", text = Text Edit Box(""));
text &amp;lt;&amp;lt; Set Hint("Enter your name");
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Dec 2023 20:00:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/709752#M89367</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-12-15T20:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script to enter new row data in popup window.</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/709780#M89369</link>
      <description>&lt;P&gt;Here is one way to handle this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// present choices to user
dlg = New Window( "Add New Row Data",
	&amp;lt;&amp;lt;Modal,
	Panel Box( "Row Data",
		Lineup Box( N Col( 2 ),
			Text Box( "Chamber ID" ),
			v1 = Number Edit Box( 401.1 ),
			Text Box( "Pct WW Down (put 0 if CHx 100% up)" ),
			v2 = Number Edit Box( 0 ),
			Text Box( "Reason" ),
			v3 = Text Edit Box( "Enter Text Here" ),
			Text Box( "Year" ),
			v4 = Number Edit Box( 2023 ),
			Text Box( "Work Week" ),
			v5 = Number Edit Box( 1 ),
			Text Box( "Scheduled or Unscheduled" ),
			v6 = Text Edit Box( "Unscheduled" )
		)
	), 
	
	Lineup Box( N Col( 2 ),
		Button Box( "Click to Add Row", // this script runs when the button is pressed...
                  
			dt = Current Data Table();
              
                    
			dt &amp;lt;&amp;lt; Add Rows( 1 );
			dt:chid[N Rows( dt )] = v1 &amp;lt;&amp;lt; Get;
			dt:pct ww dwn[N Rows( dt )] = v2 &amp;lt;&amp;lt; Get;
			dt:reason[N Rows( dt )] = v3 &amp;lt;&amp;lt; Get text;
			dt:year[N Rows( dt )] = v4 &amp;lt;&amp;lt; Get;
			dt:ww[N Rows( dt )] = v5 &amp;lt;&amp;lt; Get;
			dt:"sched/unsch"n[N Rows( dt )] = v6 &amp;lt;&amp;lt; Get text;
               //{:CH ID = v1, Pct WW DWN = v2, Reason = v3, Year = v4, WW = v5, Sched/Unsch = "Scheduled"});
			//dlg &amp;lt;&amp;lt; closeWindow; // just the dialog, not the report
			Window( "Add New Row Data" ) &amp;lt;&amp;lt; closeWindow;
	
		),
		Button Box( "Cancel", Window( "Add New Row Data" ) &amp;lt;&amp;lt; closeWindow );
			
				
	)
			
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please take the time to read through the Scripting Guide.&amp;nbsp; It will give you a big leg up on being able to solve such questions.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 20:43:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/709780#M89369</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-12-15T20:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script to enter new row data in popup window.</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/720298#M90251</link>
      <description>&lt;P&gt;Hey Jarmo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just building off of this request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to have the Combo Box options automatically update based on List Check values in that column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 19:28:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/720298#M90251</guid>
      <dc:creator>CTrahon0526</dc:creator>
      <dc:date>2024-01-30T19:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script to enter new row data in popup window.</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/720313#M90254</link>
      <description>&lt;P&gt;It is possible, but how to implement depends on your script. You can use &amp;lt;&amp;lt; Get Property("List Check") to get the property from column and then get first argument of that and you should have the list of values. You can then use &amp;lt;&amp;lt; Set Items to the combo box to update values.&lt;/P&gt;
&lt;P&gt;Below is example using your original data table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$DOWNLOADS/AddRowWindowScript.jmp");

nw = New WIndow("",
	cb = Combo Box({"a", "b", "c"});
);

wait(1); // for demo purposes

lc_vals = Column(dt, "Sched/Unsch") &amp;lt;&amp;lt; Get Property("List Check");
list_to_cb = Arg(lc_vals, 1);
cb &amp;lt;&amp;lt; Set Items(list_to_cb);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jan 2024 19:51:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/720313#M90254</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-01-30T19:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script to enter new row data in popup window.</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/721301#M90334</link>
      <description>&lt;P&gt;Works great, thanks!!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 15:38:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-enter-new-row-data-in-popup-window/m-p/721301#M90334</guid>
      <dc:creator>CTrahon0526</dc:creator>
      <dc:date>2024-02-01T15:38:17Z</dc:date>
    </item>
  </channel>
</rss>

