<?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: Number Edit Box on change script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47216#M26915</link>
    <description>&lt;P&gt;Thanks, all of you for great suggestions. I haven't tried them all out yet, but I will as soon as I get a break from my "real" work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the meantime, I think at the root of a lot of my problems is that I haven't found detailed documentation for the App Builder (AB). It must exist, but I can't find it. Does anyone have a link?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I didn't know what the "Script" field in the Properties menu of AB&amp;nbsp;was for, and I didn't make the connection with the Number Edit Box&amp;nbsp;(NEB) documentation. I'm groping my way along here, obviously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another example of my confusion, the "Increment" entry field in the AB&amp;nbsp;Properties pane for NEBs exists, but won't accept an entry. I could go on…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like I say, some good documentation on AB, and also some excellent examples of complex modal dialog box scripts would be great.&amp;nbsp;Also, is there a way to actually see the code that AB generates for the interface?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2017 14:21:39 GMT</pubDate>
    <dc:creator>john_madden</dc:creator>
    <dc:date>2017-11-14T14:21:39Z</dc:date>
    <item>
      <title>Number Edit Box on change script</title>
      <link>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47170#M26882</link>
      <description>&lt;P&gt;I'm new to JSL and Application Builder, so bear with me.&lt;/P&gt;&lt;P&gt;I'm trying to build a dialog box that has a series paired&amp;nbsp;Number Edit Boxes.&amp;nbsp;One of each pair represents a "start" time and the other a corresponding "end" time:&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="screenshot_386.png" style="width: 172px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8320i94CE517B3D4C916C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="screenshot_386.png" alt="screenshot_386.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to avoid the situation where the user puts in a "start" time later than the "end" time, or an "end" time prior to the "start" time.&lt;/P&gt;&lt;P&gt;My first thought was to add an "on change" script to each box, something like this for the "start" box:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( (Start &amp;lt;&amp;lt; Get) &amp;gt; (End &amp;lt;&amp;lt; Get),
	End &amp;lt;&amp;lt; Set( Start &amp;lt;&amp;lt; Get )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and like this for the "end" box:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Start &amp;lt;&amp;lt; Get &amp;gt; End &amp;lt;&amp;lt; Get,
	Start &amp;lt;&amp;lt; Set( End &amp;lt;&amp;lt; Get )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But this doesn't work (in the sense that nothing happens when the unwanted condition occurs).&lt;/P&gt;&lt;P&gt;I'm probably doing something quite silly, but help would be appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 15:32:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47170#M26882</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2017-11-13T15:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Number Edit Box on change script</title>
      <link>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47174#M26885</link>
      <description>&lt;P&gt;You can do this by Setting the Min/Max values for both the start and end NumberEditBoxes within the SetFunction (instead of OnChange).&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Window( "Example",
	Lineup Box( N Col( 2 ),
		Text Box( "Work Starts" ),
		Text Box( "Work Ends" ),
		start_neb = Number Edit Box(
			0,
			&amp;lt;&amp;lt;Set Format( Format( "h:m:s" ) ),
			&amp;lt;&amp;lt;Set Function(
				Function( {this},
					end_neb &amp;lt;&amp;lt; Set Minimum( this &amp;lt;&amp;lt; Get )
				)
			)
		),
		end_neb = Number Edit Box(
			0,
			&amp;lt;&amp;lt;Set Format( Format( "h:m:s" ) ),
			&amp;lt;&amp;lt;Set Function(
				Function( {this},
					start_neb &amp;lt;&amp;lt; Set Maximum( this &amp;lt;&amp;lt; Get )
				)
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Nov 2017 15:57:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47174#M26885</guid>
      <dc:creator>Justin_Chilton</dc:creator>
      <dc:date>2017-11-13T15:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Number Edit Box on change script</title>
      <link>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47175#M26886</link>
      <description>&lt;P&gt;A couple of things to try:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Look in the log window - although nothing appears to happen there may be an error being reported that will give you a clue&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Reduce the code to something as simple as possible.&amp;nbsp; This will help you figure out what works, what doesn't.&amp;nbsp; For example, this seems to work the way you describe:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Window("Test",
		neb1 = NumberEditBox(0),
		neb2 = NumberEditBox(0)
);
neb1 &amp;lt;&amp;lt; Set Function(
	If( (neb1 &amp;lt;&amp;lt; Get) &amp;gt; (neb2 &amp;lt;&amp;lt; Get),
		neb2 &amp;lt;&amp;lt; Set( neb1 &amp;lt;&amp;lt; Get )
	)
);
neb2 &amp;lt;&amp;lt; Set Function(
	If( (neb1 &amp;lt;&amp;lt; Get) &amp;gt; (neb2 &amp;lt;&amp;lt; Get),
		neb1 &amp;lt;&amp;lt; Set( neb2 &amp;lt;&amp;lt; Get )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 15:58:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47175#M26886</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2017-11-13T15:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Number Edit Box on change script</title>
      <link>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47186#M26893</link>
      <description>&lt;P&gt;You need to set up scripts to call for each of the number edit boxes.&amp;nbsp; I created a simple example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;start_time_neb&lt;/STRONG&gt;: number edit box for the start time&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;end_time_neb&lt;/STRONG&gt;: number edit box for the end time&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I right-clicked on each of the number edit boxes and selected &lt;STRONG&gt;Scripts &amp;gt; Script&lt;/STRONG&gt; (not Number changed).&amp;nbsp;&amp;nbsp;Here are the scripts I added:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
// This function is called when the number edit value is committed
start_time_nebScript=Function({this},{start_time_value, end_time_value},
	start_time_value = this &amp;lt;&amp;lt; Get;
	end_time_value   = end_time_neb &amp;lt;&amp;lt; get;
	
	if (!is missing(start_time_value) &amp;amp; !is missing(end_time_value),
		if (start_time_value &amp;gt; end_time_value,
			nw = new window("Error", &amp;lt;&amp;lt; modal(),
				text box("The Start Time cannot be after the End Time")
			);
			this &amp;lt;&amp;lt; set(.);
		);
	);
	
);


// This function is called when the number edit value is committed
end_time_nebScript=Function({this},{start_time_value, end_time_value},

	start_time_value = start_time_neb &amp;lt;&amp;lt; get;
	end_time_value   = this &amp;lt;&amp;lt; Get;
	
	if (!is missing(start_time_value) &amp;amp; !is missing(end_time_value),
		if (start_time_value &amp;gt; end_time_value,
			nw = new window("Error", &amp;lt;&amp;lt; modal(),
				text box("The End Time cannot be before the Start Time")
			);
			this &amp;lt;&amp;lt; set(.);
		);
	);
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 19:34:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47186#M26893</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2017-11-13T19:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Number Edit Box on change script</title>
      <link>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47187#M26894</link>
      <description>&lt;P&gt;Here's the example.&amp;nbsp; Created using JMP 13, so may not work in earlier versions.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 19:36:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47187#M26894</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2017-11-13T19:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Number Edit Box on change script</title>
      <link>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47216#M26915</link>
      <description>&lt;P&gt;Thanks, all of you for great suggestions. I haven't tried them all out yet, but I will as soon as I get a break from my "real" work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the meantime, I think at the root of a lot of my problems is that I haven't found detailed documentation for the App Builder (AB). It must exist, but I can't find it. Does anyone have a link?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, I didn't know what the "Script" field in the Properties menu of AB&amp;nbsp;was for, and I didn't make the connection with the Number Edit Box&amp;nbsp;(NEB) documentation. I'm groping my way along here, obviously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another example of my confusion, the "Increment" entry field in the AB&amp;nbsp;Properties pane for NEBs exists, but won't accept an entry. I could go on…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like I say, some good documentation on AB, and also some excellent examples of complex modal dialog box scripts would be great.&amp;nbsp;Also, is there a way to actually see the code that AB generates for the interface?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 14:21:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47216#M26915</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2017-11-14T14:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Number Edit Box on change script</title>
      <link>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47220#M26919</link>
      <description>&lt;P&gt;Yes, you can open the saved app builder files in a&amp;nbsp;text editor, but the app builder gui is the only supported way for editing the file. (Still worth a look if you want to have an idea what happens when the script is opened.)&lt;/P&gt;
&lt;P&gt;Here's some links to resources on the web.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discovery-Summit-2016/Building-Dashboards-and-Applications-Poster-and-Tutorial/ta-p/22374" target="_blank"&gt;https://community.jmp.com/t5/Discovery-Summit-2016/Building-Dashboards-and-Applications-Poster-and-Tutorial/ta-p/22374&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;div class="video-embed-center video-embed"&gt;&lt;iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXyiQqUELc2A&amp;amp;type=text%2Fhtml&amp;amp;schema=google&amp;amp;display_name=YouTube&amp;amp;src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXyiQqUELc2A" width="600" height="337" scrolling="no" title="YouTube embed" frameborder="0" allow="autoplay; fullscreen; encrypted-media; picture-in-picture;" allowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&lt;div class="video-embed-center video-embed"&gt;&lt;iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPWmQ_Ul4I9Y&amp;amp;type=text%2Fhtml&amp;amp;schema=google&amp;amp;display_name=YouTube&amp;amp;src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPWmQ_Ul4I9Y" width="600" height="337" scrolling="no" title="YouTube embed" frameborder="0" allow="autoplay; fullscreen; encrypted-media; picture-in-picture;" allowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 15:12:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47220#M26919</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-11-14T15:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Number Edit Box on change script</title>
      <link>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47234#M26928</link>
      <description>&lt;P&gt;Application Builder takes some time to learn, but it's worth it.&amp;nbsp; I've been using it since JMP version 10, and it gets better with each version.&amp;nbsp; I've attached a presentation I gave at the JMP Discovery 2013 JSL Roundtable which may be of some help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 18:45:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47234#M26928</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2017-11-14T18:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Number Edit Box on change script</title>
      <link>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47328#M26992</link>
      <description>&lt;P&gt;Thanks for all the help guys!!!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 19:33:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Number-Edit-Box-on-change-script/m-p/47328#M26992</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2017-11-16T19:33:35Z</dc:date>
    </item>
  </channel>
</rss>

