<?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: Modal Buttons with non-standard text in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624580#M82331</link>
    <description>&lt;P&gt;To add, I got this from the documentation here:&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/zh/15.2/index.shtml#page/jmp/construct-a-modal-window.shtml" target="_blank"&gt;https://www.jmp.com/support/help/zh/15.2/index.shtml#page/jmp/construct-a-modal-window.shtml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition to the behavior mentioned, I also hear an error chirp when I click the "Continue" button before it dismisses the modal.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 22:15:24 GMT</pubDate>
    <dc:creator>mat-ski</dc:creator>
    <dc:date>2023-04-20T22:15:24Z</dc:date>
    <item>
      <title>Modal Buttons with non-standard text</title>
      <link>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624524#M82323</link>
      <description>&lt;P&gt;Hi, I am trying to write a modal that uses non standard text for the buttons. That is, according to the documentation one button with the text&amp;nbsp;&lt;SPAN class=""&gt;OK&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Yes&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;No&lt;/SPAN&gt;&lt;SPAN&gt;, or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Cancel is required as a way to close the modal. In this case I have a couple of modals where instead of "OK" I have "Continue" and instead of "Cancel" I have "Not now". I see that according to the documentation you can do something like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;acknowledgeButton = Button Box( acknowledgeText, acknowledgeButton &amp;lt;&amp;lt; Close Window ),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;In order to use a button with a different text to close the modal. The problem is that the resulting behavior is a bit strange. Specifically, when clicked, the button disappears, but there is a delay before the modal is dismissed so for about half a second you are still seeing the modal, just without the button. Is there something that I can do to get the standard "OK"/"Cancel" behavior where the modal is immediately dismissed on click?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Full code for my modal:&lt;/SPAN&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 );

simpleMessageModal = Function( {title, message, acknowledgeText},
	{Default Local}, 

	result = Associative Array();

	modal = New Window( title,
		&amp;lt;&amp;lt;Modal,
		Border Box( Left( MODAL_PADDING ), Right( MODAL_PADDING ),
			V List Box(
				Spacer Box( size( MODAL_WIDTH, SECTION_START_SPACING ) ),
				H Center Box( Text Box( message ) ),
				Spacer Box( size( MODAL_WIDTH, SECTION_END_SPACING ) ), 

			), 

		),
		H List Box(
			Spacer Box(),
			acknowledgeButton = Button Box( acknowledgeText, acknowledgeButton &amp;lt;&amp;lt; Close Window ),
			// Modals require at least one button with the text "OK", "Yes", "No", and will insert
			// one if there is no such button present, so we insert one and make it invisible.
			Button Box( "OK", &amp;lt;&amp;lt;Visibility( "collapse" ) ),

		), 

	);
	
	confirmed = modal != {Button( -1 )};

	Return( confirmed );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: more context info:&lt;BR /&gt;MacOS&amp;nbsp;13.3.1, 32 GB RAM&lt;/P&gt;&lt;P&gt;2.6 GHz 6-Core Intel Core i7&lt;/P&gt;&lt;P&gt;JMP 17&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:08:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624524#M82323</guid>
      <dc:creator>mat-ski</dc:creator>
      <dc:date>2023-06-09T16:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Modal Buttons with non-standard text</title>
      <link>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624580#M82331</link>
      <description>&lt;P&gt;To add, I got this from the documentation here:&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/zh/15.2/index.shtml#page/jmp/construct-a-modal-window.shtml" target="_blank"&gt;https://www.jmp.com/support/help/zh/15.2/index.shtml#page/jmp/construct-a-modal-window.shtml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition to the behavior mentioned, I also hear an error chirp when I click the "Continue" button before it dismisses the modal.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 22:15:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624580#M82331</guid>
      <dc:creator>mat-ski</dc:creator>
      <dc:date>2023-04-20T22:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Modal Buttons with non-standard text</title>
      <link>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624586#M82333</link>
      <description>&lt;P&gt;Running on Windows 11, with a I7-9700K processor and 32 gigs of RAM, I experience no delay in the window closing after clicking on the button.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 22:41:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624586#M82333</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-04-20T22:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Modal Buttons with non-standard text</title>
      <link>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624595#M82334</link>
      <description>&lt;P&gt;Do you happen to get any error chirp?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added system info about but to copy here as well:&lt;/P&gt;&lt;P&gt;MacOS&amp;nbsp;13.3.1, 32 GB RAM&lt;/P&gt;&lt;P&gt;2.6 GHz 6-Core Intel Core i7&lt;/P&gt;&lt;P&gt;JMP version 17&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 23:36:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624595#M82334</guid>
      <dc:creator>mat-ski</dc:creator>
      <dc:date>2023-04-20T23:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Modal Buttons with non-standard text</title>
      <link>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624636#M82339</link>
      <description>&lt;P&gt;No&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 02:58:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624636#M82339</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-04-21T02:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Modal Buttons with non-standard text</title>
      <link>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624944#M82376</link>
      <description>&lt;P&gt;In case anyone else comes across this and has the same problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw &lt;A href="https://community.jmp.com/t5/Discussions/Using-another-button-instead-of-quot-Ok-quot-Modal-windows/m-p/57885#M32189" target="_self"&gt;this post&lt;/A&gt; in the "recommendations" section of my post and decided to try that. Specifically my code is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	invisibleOkButton = Button Box( "OK", &amp;lt;&amp;lt;Visibility( "collapse" ) );
	button = Button Box( buttonText, invisibleOkButton &amp;lt;&amp;lt; Click );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Which resulted in behavior matching the standard "OK" button.&lt;BR /&gt;&lt;BR /&gt;I'm not 100% sure that this is the reason for the delay between button press and modal disappearance, but in this case pressing the button starts a network request, and the delay appears to match that timing (i.e. press button -&amp;gt; button disappears -&amp;gt; network request runs -&amp;gt; request finishes -&amp;gt; modal disappears). So that may explain why the delay does not always manifest, since it would be too fast to see if it is not waiting for the network request or something similarly slow.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 18:11:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modal-Buttons-with-non-standard-text/m-p/624944#M82376</guid>
      <dc:creator>mat-ski</dc:creator>
      <dc:date>2023-04-21T18:11:01Z</dc:date>
    </item>
  </channel>
</rss>

