<?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 JSL: Slider Box Set Value in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/359819#M60977</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code from the Scripting Index for creating a Slider Box:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
sliderValue = .6;
New Window( "Example",
	Panel Box( "Slider Box",
		tb = Text Box( "Value: " || Char( sliderValue ) ),
		sb = Slider Box(
			0,
			1,
			sliderValue,
			tb &amp;lt;&amp;lt; Set Text( "Value: " || Char( sliderValue ) )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you run this example, you can right-click the slider to set a specific value:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mjoner_0-1613593250922.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30402i64B2B23847DF1DDB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mjoner_0-1613593250922.png" alt="mjoner_0-1613593250922.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's suppose I set this to 0.8. If I do, the slider moves, but the script associated with the slider fails to execute. That is, the text box above the slider doesn't update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1: Why?&lt;/P&gt;&lt;P&gt;Question 2: Is there a different way to transfer the new value to the Text Box? I tried to convert the code to use the Set Function message but this didn't solve it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have observed that if you right click a slider in a Platform (such as Custom Profiler) and Set Value that the platform seems to respond correctly (slider and associated Text Edit Box both move as expected), so I can tell there is some way to do this in JSL. I just don't know what that is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running 15.2.1 Pro on a Mac.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 22:06:21 GMT</pubDate>
    <dc:creator>mjoner</dc:creator>
    <dc:date>2023-06-09T22:06:21Z</dc:date>
    <item>
      <title>JSL: Slider Box Set Value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/359819#M60977</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code from the Scripting Index for creating a Slider Box:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
sliderValue = .6;
New Window( "Example",
	Panel Box( "Slider Box",
		tb = Text Box( "Value: " || Char( sliderValue ) ),
		sb = Slider Box(
			0,
			1,
			sliderValue,
			tb &amp;lt;&amp;lt; Set Text( "Value: " || Char( sliderValue ) )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you run this example, you can right-click the slider to set a specific value:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mjoner_0-1613593250922.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30402i64B2B23847DF1DDB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mjoner_0-1613593250922.png" alt="mjoner_0-1613593250922.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's suppose I set this to 0.8. If I do, the slider moves, but the script associated with the slider fails to execute. That is, the text box above the slider doesn't update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1: Why?&lt;/P&gt;&lt;P&gt;Question 2: Is there a different way to transfer the new value to the Text Box? I tried to convert the code to use the Set Function message but this didn't solve it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have observed that if you right click a slider in a Platform (such as Custom Profiler) and Set Value that the platform seems to respond correctly (slider and associated Text Edit Box both move as expected), so I can tell there is some way to do this in JSL. I just don't know what that is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running 15.2.1 Pro on a Mac.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:06:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/359819#M60977</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2023-06-09T22:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Slider Box Set Value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/359830#M60978</link>
      <description>&lt;P&gt;Thanks for providing a clear example and question. It made it easy to verify that this is a bug in JMP 15 (perhaps earlier versions). The callback for the slider isn't being triggered on the Set Value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also verified that we have fixed it in the upcoming JMP 16 release.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may be a tricky workaround you could code in JSL, but where you see it working in the built-in platforms it's not being done through JSL.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 20:34:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/359830#M60978</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2021-02-17T20:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Slider Box Set Value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/359833#M60979</link>
      <description>&lt;P&gt;I do not see a work-around because there is no way to associate an expression with the Set Value action. Here is a variation of the original script, but it doesn't work either because it is called when the slider is moved.&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 );

sliderValue = .6;

New Window( "Example",
	Panel Box( "Slider Box",
		tb = Text Box( "Value: " || Char( sliderValue ) ),
		Slider Box( 0, 1, sliderValue,
			&amp;lt;&amp;lt; Set Function(
				Function( { me },
					tb &amp;lt;&amp;lt; Set Text( "Value: " || Char( me &amp;lt;&amp;lt; Get ) )

				)
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Feb 2021 20:39:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/359833#M60979</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-02-17T20:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Slider Box Set Value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/359838#M60980</link>
      <description>&lt;P&gt;This doesn't address the underlying issue you identified with the script not triggering, but I often put a number&amp;nbsp;edit box next to that value with a script to set the value of the slider.&amp;nbsp; That way if someone wants to set the value they are unlikely to right click on the slider as it is easier to just click on the text edit box.&amp;nbsp; Here is one way to incldue both, while also running some function when the slider moves or a new value is typed in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_0-1613594737809.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30403i8CBC2B13FBAA9242/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_0-1613594737809.png" alt="ih_0-1613594737809.png" /&gt;&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 );
sliderValue = .6;

//Function that is called when either slider is moved or new value is typed in
dothisonchange = Function({val}, tb &amp;lt;&amp;lt; Set Text( "Value: " || Char( val) ) );

New Window( "Example",
	Panel Box( "Slider Box",
		tb = Text Box( "Value: " || Char( sliderValue ) ),
		h list box(
			sb = Slider Box(
				0,
				1,
				sliderValue,
				//Set the number edit box and call the other function
				neb &amp;lt;&amp;lt; Set( sliderValue );
				dothisonchange(sliderValue);
				
			),
			neb = Number Edit Box(
				sliderValue,
				3,
				&amp;lt;&amp;lt; Set function( Function( {this},
					sliderValue = this &amp;lt;&amp;lt; Get;
					//Set the slider and call the other function
					sb &amp;lt;&amp;lt; Set( sliderValue );
					dothisonchange(sliderValue);
				) )
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Feb 2021 20:49:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/359838#M60980</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-02-17T20:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Slider Box Set Value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/360306#M60993</link>
      <description>&lt;P&gt;You could also use this approach&amp;nbsp;&lt;LI-MESSAGE title="Combined and Connected Number Edit Box and Slider Box" uid="54255" url="https://community.jmp.com/t5/JSL-Cookbook/Combined-and-Connected-Number-Edit-Box-and-Slider-Box/m-p/54255#U54255" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2021 15:55:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/360306#M60993</guid>
      <dc:creator>MathStatChem</dc:creator>
      <dc:date>2021-02-18T15:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Slider Box Set Value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/361208#M61072</link>
      <description>&lt;P&gt;Thanks. I knew about the Number Edit Box approach and am now leaning toward going that way. The linked thread from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4467"&gt;@MathStatChem&lt;/a&gt;&amp;nbsp;sounds like a wishlist item to either create a new type of display box or to add some option to sliderbox that would optionally add a NEB control. I'm assuming that wishlist item has already been created.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 14:56:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/361208#M61072</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2021-02-21T14:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Slider Box Set Value</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/361213#M61077</link>
      <description>&lt;P&gt;Yes, I did create the wishlist item.&amp;nbsp;&lt;LI-MESSAGE title="Combined and Connected Number Edit Box and Slider Box" uid="56212" url="https://community.jmp.com/t5/JMP-Wish-List/Combined-and-Connected-Number-Edit-Box-and-Slider-Box/m-p/56212#U56212" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 13:09:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Slider-Box-Set-Value/m-p/361213#M61077</guid>
      <dc:creator>MathStatChem</dc:creator>
      <dc:date>2021-02-22T13:09:15Z</dc:date>
    </item>
  </channel>
</rss>

