<?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 Multiple &amp;quot;OK&amp;quot; Buttons in Modal Window in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10472#M10147</link>
    <description>&lt;P&gt;Is it possible to design a modal window with multiple "OK" choices?&amp;nbsp; I think my main difficulty is closing the window after selection of the second OK button.&amp;nbsp; Is there a more clever way to do this?&amp;nbsp; I am using JMP11.&amp;nbsp; Example is below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&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;PRE&gt;&lt;CODE class=" language-jsl"&gt;w1 = New Window( "New Window",
  &amp;lt;&amp;lt;Modal,
  // Get user input,
  H List Box(
  Button Box( "OK",
  // Proceed with option 1
  ),
  Button Box( "Other OK",
  w1 &amp;lt;&amp;lt; Close Window; // I can not get this to work.
  // Proceed with option 2
  ),
  Button Box( "Cancel", Throw( "Script cancelled by user." ) )
  )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2018 20:42:02 GMT</pubDate>
    <dc:creator>robot</dc:creator>
    <dc:date>2018-02-01T20:42:02Z</dc:date>
    <item>
      <title>Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10472#M10147</link>
      <description>&lt;P&gt;Is it possible to design a modal window with multiple "OK" choices?&amp;nbsp; I think my main difficulty is closing the window after selection of the second OK button.&amp;nbsp; Is there a more clever way to do this?&amp;nbsp; I am using JMP11.&amp;nbsp; Example is below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&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;PRE&gt;&lt;CODE class=" language-jsl"&gt;w1 = New Window( "New Window",
  &amp;lt;&amp;lt;Modal,
  // Get user input,
  H List Box(
  Button Box( "OK",
  // Proceed with option 1
  ),
  Button Box( "Other OK",
  w1 &amp;lt;&amp;lt; Close Window; // I can not get this to work.
  // Proceed with option 2
  ),
  Button Box( "Cancel", Throw( "Script cancelled by user." ) )
  )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 20:42:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10472#M10147</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2018-02-01T20:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10473#M10148</link>
      <description>&lt;P&gt;Try &lt;STRONG&gt;Current Window() &lt;/STRONG&gt;instead of trying to refer to w1.&amp;nbsp; This worked for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;w1 = New Window( "New Window",
  &amp;lt;&amp;lt;Modal,
  // Get user input,
  H List Box(
  Button Box( "OK",
    // Proceed with option 1
  ),
  Button Box( "Other OK",
     // w1 &amp;lt;&amp;lt; Close Window; // I can not get this to work.
     Current Window() &amp;lt;&amp;lt; Close Window;
   Write( "\!NHello from other OK button" );
     // Proceed with option 2
  ),
  Button Box( "Cancel", Throw( "Script cancelled by user." ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 20:43:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10473#M10148</guid>
      <dc:creator>Eric_Hill</dc:creator>
      <dc:date>2018-02-01T20:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10474#M10149</link>
      <description>&lt;P&gt;Hi Eric,&lt;BR /&gt;Thank you for the response. When I run your script,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Current Window() &amp;lt;&amp;lt; Close Window;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;closes the Script window, not the message box. Are you doing anything special to make it work?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 20:45:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10474#M10149</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2018-02-01T20:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10475#M10150</link>
      <description>&lt;P&gt;It looks like Eric's solution works in (soon-to-be-released) JMP 12, but JMP 11 has a different behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One problem in the original script is that w1 cannot be used until the New Window call completes, and in the case of a Modal window the call does not complete until the window is dismissed!&amp;nbsp; And because the window is gone by the time the call returns, the return value from a Modal call to New Window is not a window reference at all.&amp;nbsp; Instead it is {Button(1)} if OK was pressed and {Button(-1)} if Cancel was pressed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fortunately, you can send a &amp;lt;&amp;lt;Close Window message to any display box.&amp;nbsp; The following script should work in either JMP 11 or JMP 12:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;w1 = New Window( "New Window",
       &amp;lt;&amp;lt;Modal,
       // Get user input,
       H List Box(
              Button Box( "OK",
                     // Proceed with option 1
        ),
        b = Button Box( "Other OK",
            b &amp;lt;&amp;lt; Close Window;
                     // Proceed with option 2
        ),
              Button Box( "Cancel", Throw( "Script cancelled by user." ) )
    )
);&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;Note that the behavior for the added button is closer to 'Cancel' than 'OK' - the return value w1 will be {Button(-1)} for the "Other OK" button and the On Validate() script [if it exists] will not be run.&amp;nbsp; That's ok - you can simply do your own validation within the button script, but keep this in mind if looking at the return value from New Window().&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 20:42:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10475#M10150</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2018-02-01T20:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10476#M10151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2014 20:08:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10476#M10151</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2014-12-23T20:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10477#M10152</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another wrinkle to this question: is there a way to have a modal dialog box &lt;SPAN style="text-decoration: underline;"&gt;without&lt;/SPAN&gt; the OK or Cancel buttons?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nw = new window("Test Modal", &amp;lt;&amp;lt; modal(),
    panelbox("Actions",
        hlistbox(
            a = button box("Close A",
                print("Closing with A");
                a &amp;lt;&amp;lt; close window;
            ),
            b = button box("Close B",
                print("Closing with B");
                b &amp;lt;&amp;lt; close window;
            )
        )
    )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 20:45:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10477#M10152</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-02-01T20:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10478#M10153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, there is currently no way to avoid the addition of the OK button in this case.&amp;nbsp; This is done to guarantee that the window can be dismissed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 19:12:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10478#M10153</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2015-01-05T19:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10479#M10154</link>
      <description>&lt;P&gt;Maybe just a curiosity, but it is possible to have two working "OK" buttons as long as one is a "YES" button.&lt;/P&gt;
&lt;P&gt;In the modal window generatet by the code below, pressing the first "OK" or the "YES" both return &lt;STRONG&gt;{Button( 1 )}&lt;/STRONG&gt; whereas the second "OK" is inactive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-size: 15px; font-family: Courier; color: #942193;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Window( "New Window",
  &amp;lt;&amp;lt;Modal,
  H List Box(
  Button Box( "OK" ), // Works!
  Button Box( "OK" ), // Useless!
  Button Box( "YES" ), // Works!
  )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="font-size: 15px; font-family: Courier;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 20:46:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10479#M10154</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2018-02-01T20:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10480#M10155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MS, thanks for pointing this out.&amp;nbsp; We do look for different names for the buttons.&amp;nbsp; Generally this is just to handle the OK/Cancel and Yes/No variants, but yes, they can be used at the same time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 15:11:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/10480#M10155</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2015-01-09T15:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/41286#M24093</link>
      <description>&lt;P&gt;Hi Guys, I am new to this. if you want a window to prompt the user for two options only&lt;/P&gt;&lt;P&gt;1) Ok, then the script after that will continue on doing whatever needs to be done.&lt;/P&gt;&lt;P&gt;2) Cancel, if this option is selected, I want to stop/exit the script or go to end of the script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 23:42:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/41286#M24093</guid>
      <dc:creator>SamH</dc:creator>
      <dc:date>2017-06-27T23:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/41287#M24094</link>
      <description>&lt;P&gt;Here is an example of what you would need to do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
nw = New Window( "test",
	modal,
	Text Box( "Click OK if you want to continue" ),
	H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);
If( nw["button"] == -1,
	Throw()
);
Show( "Continuing processing" );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jun 2017 00:09:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/41287#M24094</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-06-28T00:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/41342#M24131</link>
      <description>&lt;P&gt;I'd also like this. &amp;nbsp;The OK-ness of a button should be related to a property of the button other than the button title.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 11:59:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/41342#M24131</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2017-06-29T11:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/41343#M24132</link>
      <description>&lt;P&gt;I question the need for more than one OK or Cancel button in any dialog. These controls and their associated actions have special meaning. These two buttons are meant to be the only ways to dismiss the dialog.&amp;nbsp;User interface design principles generally avoid duplicating controls, especially standard controls.&lt;/P&gt;
&lt;P&gt;The example that you started with could use another control to determine the desired option before dismissing the dialog. It looks like a radio box would be appropriate in this situation.&lt;/P&gt;
&lt;P&gt;You want to use separate controls for separate and distinct purposes.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 12:32:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/41343#M24132</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2017-06-29T12:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple "OK" Buttons in Modal Window</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/50577#M28752</link>
      <description>&lt;P&gt;Mark:&lt;/P&gt;&lt;P&gt;Your response reminds me of what my freshman-level programming professor said to the class about this. &amp;nbsp;It was something to the effect of, "Don't intentionally confuse the user. &amp;nbsp;For example, don't have a Cancel button perform [delete *.*]." &amp;nbsp;I got a chuckle back then...and now!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 20:38:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-quot-OK-quot-Buttons-in-Modal-Window/m-p/50577#M28752</guid>
      <dc:creator>Judah</dc:creator>
      <dc:date>2018-02-01T20:38:23Z</dc:date>
    </item>
  </channel>
</rss>

