<?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: Help with Modal Windows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/873798#M103774</link>
    <description>&lt;P&gt;From JMP Online Help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Note"&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Modal windows require at least one button for dismissing the window. You can use&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="command"&gt;OK&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="command"&gt;Yes&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="command"&gt;No&lt;/SPAN&gt;&lt;SPAN&gt;, or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="command"&gt;Cancel&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;to label modal window buttons. If you do not include at least one of these buttons in a modal window, JMP adds an&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="command"&gt;OK&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;button.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The built-in functionality of a Modal display window returns a +1 for "OK" or "Yes" and a -1 for "Cancel" and "No"&lt;/P&gt;</description>
    <pubDate>Thu, 15 May 2025 14:34:05 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2025-05-15T14:34:05Z</dc:date>
    <item>
      <title>Help with Modal Windows</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/61051#M33177</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;l am trying to set up dialog boxes in existing scripts, the first is the location of headers in the data l am importing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;l understand the following will give me a nice Display box:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Headstart = New Window( "Set Header Start Row Value",
&amp;lt;&amp;lt; Modal,
&amp;lt;&amp;lt; Return Result,
Text Box ("Please advise the row on which the header starts"),
variablebox = Number Edit Box ( 2 ),
Button Box ( "OK "),
Button Box ( "Cancel" ) 
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the next&amp;nbsp;piece of syntax then&amp;nbsp;write the user reply to&amp;nbsp;Headstart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Write ( Headstart ["variablebox"]);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How do l actually get to use the value stored in the Headstart, have tried the below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//dt=open(fileopen,private);
dt = Open(

fileopen,
Worksheets( "Lin" ),

Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( "Headstart" ),
Data Starts on Row( 37 ),
Data Starts on Column( 1 ),
Data Ends on Row( 48 ),
Data Ends on Column( 15 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 1 ),
Suppress Empty Columns( 1 ),
Treat as Hierarchy( 0 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )

),
);
　
Datasource = fileopen;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jun 2018 13:17:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/61051#M33177</guid>
      <dc:creator>Mickyboy</dc:creator>
      <dc:date>2018-06-25T13:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Modal Windows</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/61053#M33178</link>
      <description>&lt;P&gt;Mickyboy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I entered 3, show(Headstart) returns the list&amp;nbsp;{variablebox = 3, Button( 1 )}. Except for the Button, every other item in the list is an assignment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are two ways to get the values from a modal dialog, &amp;lt;&amp;lt;Return Result,&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;listname["boxname"]&amp;nbsp; so Headstart[ "variablebox" ] returns 3.&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;If the button is 1, remove the last item in the list, and eval list(listname), then each assignment is executed and you can refer to the variablebox name.&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Below is an excerpt from script 7_SimpleModalDialog.jsl, one of the scripts written for &lt;EM&gt;JSL Companion, Applications of the JMP Scripting Language, 2nd edition.&lt;/EM&gt; The first show statement uses the syntax #2 and the second show is teh syntax you can use after you remove the button and eval list().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are additional methods as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for your example,&amp;nbsp; you can use&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp; &amp;nbsp;Headers Start on Row(&amp;nbsp;Headstart["variablebox"]&amp;nbsp;)&lt;/PRE&gt;&lt;P&gt;or use code similar to the example below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&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);

usr_info = New Window("Query", &amp;lt;&amp;lt; Modal, &amp;lt;&amp;lt;Return Result,
	    Text Box("Select the query filters"), 
	    HListBox(
	      LineupBox(NCol(2),
	    	TextBox("Number of days, 30 day maximum"), ndays = numberEditBox(7),
			TextBox("Parameter name, wildcard=* "), param = textEditBox(),
			TextBox("Manufacturing Step Id"), step_id = numberEditBox()
		  ), //end LineupBox 
		  LineupBox( NCol(1), ButtonBox("OK"), ButtonBox("Cancel"))
		) //end HListBox
);

show(usr_info, usr_info[ "ndays" ], usr_info["param"], 
      usr_info["step_id"], usr_info["Button"] );
      
      
//Review chapter 5 on Lists and Assignment Lists. This output is an assignment list, except for Button()
//Usage: usr_info["ndays"] contains user repsonse or Check for OK , remove button and Eval List
If(usr_info["Button"]== -1, 
   Caption("Aborting..."); Wait(3); Caption(Remove); Throw());
StatusMsg("Processing next steps");
RemoveFrom(usr_info, NItems(usr_info));   //Remove the last item "Button(1)"
Eval List(usr_info);                      //Assignments are run
Show( usr_info, ndays, param, step_id);

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2018 09:29:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/61053#M33178</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-06-25T09:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Modal Windows</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/61065#M33188</link>
      <description>&lt;P&gt;This approach may be a little easier to understand.&amp;nbsp; Put actions you want to happen in the OK and Cancel buttons.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;hw = New Window( "Set Header Start Row Value", &amp;lt;&amp;lt;Modal,
	Text Box( "Please advise the row on which the header starts" ),
	variablebox = Number Edit Box( 2 ),
	hlistbox(
		Button Box( "OK ",
			headstart = variablebox &amp;lt;&amp;lt; get),
		Button Box( "Cancel",
			headstart = -999;),
	)
);
if (headstart == -999,
	throw("Cancel clicked")
);
show(headstart);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jun 2018 13:12:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/61065#M33188</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-06-25T13:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Modal Windows</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/61126#M33212</link>
      <description>&lt;P&gt;Hi gzmorgan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;havent had time to look at this today, will look at it tomorrow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks very much for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 06:51:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/61126#M33212</guid>
      <dc:creator>Mickyboy</dc:creator>
      <dc:date>2018-06-26T06:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Modal Windows</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/61743#M33305</link>
      <description>&lt;P&gt;Hi gzmorgan0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;l finally had a chance to do this today, it worked a treat, thank you so much, l am new to coding in JMP, and people like you are making the learning experience a hell of alot easier, and alot less fustrating, i cant thank you enough.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 23:17:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/61743#M33305</guid>
      <dc:creator>Mickyboy</dc:creator>
      <dc:date>2018-06-27T23:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Modal Windows</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/873762#M103772</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to understand why the JMP Button Box("OK") structure from examples works as it does.&lt;/P&gt;
&lt;P&gt;Is it a predefined result that if text is "OK" then "Button"=1, and any other text then "Button"=-1.&lt;/P&gt;
&lt;P&gt;My code is based on the JMP help, and similar to gzmorgan code of this discussion.&lt;/P&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;		  LineupBox( NCol(1), ButtonBox("OK"), ButtonBox("Cancel"))
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;If(usr_info["Button"]== -1, 
   Caption("Aborting..."); Wait(3); Caption(Remove); Throw());
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 11:51:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/873762#M103772</guid>
      <dc:creator>glimond67</dc:creator>
      <dc:date>2025-05-15T11:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Modal Windows</title>
      <link>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/873798#M103774</link>
      <description>&lt;P&gt;From JMP Online Help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Note"&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Modal windows require at least one button for dismissing the window. You can use&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="command"&gt;OK&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="command"&gt;Yes&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="command"&gt;No&lt;/SPAN&gt;&lt;SPAN&gt;, or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="command"&gt;Cancel&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;to label modal window buttons. If you do not include at least one of these buttons in a modal window, JMP adds an&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="command"&gt;OK&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;button.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The built-in functionality of a Modal display window returns a +1 for "OK" or "Yes" and a -1 for "Cancel" and "No"&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 14:34:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-with-Modal-Windows/m-p/873798#M103774</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-05-15T14:34:05Z</dc:date>
    </item>
  </channel>
</rss>

