RPG doesn't know slider value

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
Thomas Garvey
Profound User
Posts: 22
Joined: Fri Jul 30, 2010 1:37 pm
First Name: Thomas
Last Name: Garvey
Company Name: Unbeaten Path Intl
Phone: 630-462-3991
State / Province: Illinois
Zip / Postal Code: 60188
Country: United States
Contact:

RPG doesn't know slider value

Post by Thomas Garvey »

I have a Slider widget and a displayed value that changes as the user adjusts the slider button. Works great. However, when the user has finished their adjustment (which I guess is OnMouseUp) I need to check the value they left the slider at and, depending on value, either turn on or off a separate radio button.
I'm guessing I have to use JavaScript for this because I can't figure out how to have my RPG program know when the user is done with the slider (and thus check the value and set/reset the radio button). That is, other than JavaScript. I can't bind a Response Indicator to it.
Any ideas, or JavaScript for this type of thing?
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: RPG doesn't know slider value

Post by Brian »

The screen would need to be submitted for your RPG to regain control of anything. You could just put a call to pui.click() on the onmouseup event of the slider. This should return control to RPG after they adjust the slider. Let me know if that meets your need.
Thomas Garvey
Profound User
Posts: 22
Joined: Fri Jul 30, 2010 1:37 pm
First Name: Thomas
Last Name: Garvey
Company Name: Unbeaten Path Intl
Phone: 630-462-3991
State / Province: Illinois
Zip / Postal Code: 60188
Country: United States
Contact:

Re: RPG doesn't know slider value

Post by Thomas Garvey »

That didn't really help. My program gets control, but the new value of the slider is not provided to the program.
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: RPG doesn't know slider value

Post by Brian »

Did you bind a field to the "value" property of the slider?
Thomas Garvey
Profound User
Posts: 22
Joined: Fri Jul 30, 2010 1:37 pm
First Name: Thomas
Last Name: Garvey
Company Name: Unbeaten Path Intl
Phone: 630-462-3991
State / Province: Illinois
Zip / Postal Code: 60188
Country: United States
Contact:

Re: RPG doesn't know slider value

Post by Thomas Garvey »

yes, and that field also appears on the display
Thomas Garvey
Profound User
Posts: 22
Joined: Fri Jul 30, 2010 1:37 pm
First Name: Thomas
Last Name: Garvey
Company Name: Unbeaten Path Intl
Phone: 630-462-3991
State / Province: Illinois
Zip / Postal Code: 60188
Country: United States
Contact:

Re: RPG doesn't know slider value

Post by Thomas Garvey »

The OnChange event for the slider has this JavaScript Code...
changeElementValue("spAdjust", this.value);

So, the value is changing but the pui.click(); code in the OnMouseUp for the slider does not place the new value in the 'buffer' that my RPG program sees.
Thomas Garvey
Profound User
Posts: 22
Joined: Fri Jul 30, 2010 1:37 pm
First Name: Thomas
Last Name: Garvey
Company Name: Unbeaten Path Intl
Phone: 630-462-3991
State / Province: Illinois
Zip / Postal Code: 60188
Country: United States
Contact:

Re: RPG doesn't know slider value

Post by Thomas Garvey »

THis is why I think the only way is to have JavaScript in the OnMouseUp event for the slider that tests the value of the slider and then changes the value of the othere field (a radio button).
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: RPG doesn't know slider value

Post by Brian »

That is strange. What happens if you bind a field to your displayed value? Can RPG see the current value there?
Thomas Garvey
Profound User
Posts: 22
Joined: Fri Jul 30, 2010 1:37 pm
First Name: Thomas
Last Name: Garvey
Company Name: Unbeaten Path Intl
Phone: 630-462-3991
State / Province: Illinois
Zip / Postal Code: 60188
Country: United States
Contact:

Re: RPG doesn't know slider value

Post by Thomas Garvey »

The bound field for Value is the same for both widgets. The slider ID is Spinner1 and the bound field for Value is spAdjust. The displayed field is an Output Field, whose ID is spAdjust and the bound field for Value is spAdjust.
I'm not sure why, but the following JavaScript is in the OnChange Event for BOTH the slider AND the display output field.
changeElementValue("spAdjust", this.value);
The Display Output field would never experience an OnChange Event, right? Why would this JavaScript code be there? And does it matter, as it regards this problem?
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: RPG doesn't know slider value

Post by Brian »

I'm not really sure what is happening. I'm going to try to recreate the situation here so that I can debug it.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests