<?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: Tiny JSL Challenge: Escape from Modal OnClose(0) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/522052#M74706</link>
    <description>&lt;P&gt;On Validate is tied to the OK button; you can cancel without validating.&lt;/P&gt;
&lt;P&gt;On Close is tied to the window preparing to close, for any reason.&lt;/P&gt;
&lt;P&gt;You can probably use both, but I'd be hard pressed to come up with a good reason.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the OS level, &lt;A href="https://docs.microsoft.com/en-us/windows/win32/learnwin32/closing-the-window" target="_blank"&gt;https://docs.microsoft.com/en-us/windows/win32/learnwin32/closing-the-window&lt;/A&gt; shows there is another interesting hook when the window has disappeared off the display and is about to be destroyed (WM_DESTROY). JMP does not expose this event.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jul 2022 20:04:23 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2022-07-15T20:04:23Z</dc:date>
    <item>
      <title>Tiny JSL Challenge: Escape from Modal OnClose(0)</title>
      <link>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/519711#M74572</link>
      <description>&lt;P&gt;in &lt;LI-MESSAGE title="Display number of selected rows in the new window" uid="519519" url="https://community.jmp.com/t5/Discussions/Display-number-of-selected-rows-in-the-new-window/m-p/519519#U519519" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&amp;nbsp; I gave a solution that uses the &amp;lt;&amp;lt;OnClose(...) function and noted that the script ends with ;1 so the window can actually close. If it ends with ;0 the window will not close, and because it is a modal window, you are&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;stuck&lt;/LI&gt;
&lt;LI&gt;caught between a rock and a hard place&lt;/LI&gt;
&lt;LI&gt;painted into a corner&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because this example uses Graph Builder and a Data Table, there is a way out (without using Task Manager to kill JMP.)&lt;/P&gt;
&lt;P&gt;Can you find it?&amp;nbsp; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Save your work before starting!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replies here are OK, maybe there is more than one way...spoiler/solution follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6309378960112w960h540r892" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6309378960112" data-account="6058004218001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6058004218001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6309378960112w960h540r892');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.jmp.com/t5/video/gallerypage/video-id/6309378960112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/LI-SPOILER&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:50:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/519711#M74572</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-06-10T23:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Tiny JSL Challenge: Escape from Modal OnClose(0)</title>
      <link>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/519777#M74578</link>
      <description>&lt;P&gt;My solution (different from &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt; solution):&lt;/P&gt;
&lt;LI-SPOILER&gt;After some playing around I started thinking that I can most likely manipulate the buttons and use those to close the window. I took fairly easy way out and set following script to OK button&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Set Function(Function({this},
	((this &amp;lt;&amp;lt; top parent) &amp;lt;&amp;lt; On Close(1)
)))&lt;/CODE&gt;&lt;/PRE&gt;
You cannot simply set this by right clicking, but you can right click around and find one Show Properties -&amp;gt; Find the correct button box from the list and then set some simple action to Press&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1657557857632.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43864i5E4EAEF20E176E0E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1657557857632.png" alt="jthi_0-1657557857632.png" /&gt;&lt;/span&gt;
&lt;P&gt;after setting something to the press you can right click on the button and modify script it runs&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1657557890185.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43865iEBC78A58E4DCFCE8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1657557890185.png" alt="jthi_1-1657557890185.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Then Set Script which will modify the modal windows on close to return always 1, press OK and modal will close&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 16:47:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/519777#M74578</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-07-11T16:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Tiny JSL Challenge: Escape from Modal OnClose(0)</title>
      <link>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/521792#M74687</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp; solution is better; it only needs the OK button. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 11:36:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/521792#M74687</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-07-15T11:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Tiny JSL Challenge: Escape from Modal OnClose(0)</title>
      <link>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/521793#M74688</link>
      <description>&lt;P&gt;Out of curiosity: why does OnClose even set this flag, isn't that the purpose of OnValidate?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 11:43:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/521793#M74688</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2022-07-15T11:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Tiny JSL Challenge: Escape from Modal OnClose(0)</title>
      <link>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/522052#M74706</link>
      <description>&lt;P&gt;On Validate is tied to the OK button; you can cancel without validating.&lt;/P&gt;
&lt;P&gt;On Close is tied to the window preparing to close, for any reason.&lt;/P&gt;
&lt;P&gt;You can probably use both, but I'd be hard pressed to come up with a good reason.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the OS level, &lt;A href="https://docs.microsoft.com/en-us/windows/win32/learnwin32/closing-the-window" target="_blank"&gt;https://docs.microsoft.com/en-us/windows/win32/learnwin32/closing-the-window&lt;/A&gt; shows there is another interesting hook when the window has disappeared off the display and is about to be destroyed (WM_DESTROY). JMP does not expose this event.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 20:04:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Tiny-JSL-Challenge-Escape-from-Modal-OnClose-0/m-p/522052#M74706</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-07-15T20:04:23Z</dc:date>
    </item>
  </channel>
</rss>

