JS widget - Listen to variables - Running scipt if any of the variables change, not once all variables change

589 views
Skip to first unread message

onei...@gmail.com

unread,
Aug 22, 2014, 3:51:25 AM8/22/14
to suppor...@runmyprocess.com
Hi

I have a JS widget, i'd like to run the code in the JS widget anytime one of three radio widget variables change.

I have added the variables to the 'listen to variables' property of the JS Widget


However i find that the JS Script only runs once all three of radio widgets have been changed. How can I run the script if 'any' rather than 'all' of the three radio widgets change?

many Thanks

Jamie

Gareth Thiveux

unread,
Aug 22, 2014, 4:25:58 AM8/22/14
to suppor...@runmyprocess.com
Hi Jamie,

There are three ways of doing so :
- You can define a default value for each of your radio buttons, this way, the automatic set up of the default value will trigger the first change of your widgets. So if you then change the value of any of your three widgets, as all the values have been already considered as changed, it would trigger your JS.
- You can create as many JS as widgets to listen, each one would be listening to one of your radio button widget.
- You can create a "manual" listener by using the RMPApplication.addListener( valueChanged ) function : 
function valueChanged(name,value) {
if (name == "variable_of_your_radio_button1" || name == "variable_of_your_radio_button2" || name == "variable_of_your_radio_button3") {
alert("New value : "+value);
}
}

RMPApplication.addListener(valueChanged);


Regards,

Customer Solutions Engineer
 Fujitsu RunMyProcess
3 rue de Gramont, 75002 Paris - France

     


Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.



--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/640db792-bc61-4e53-bf2c-b077f9107c8c%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

Jamie

unread,
Aug 22, 2014, 10:57:28 AM8/22/14
to suppor...@runmyprocess.com
Thank you

I have tried to set the radio widgets to a default value by using the following code in a JS widget, but it doesn't seem to work.

id_r1.setSelectedValue("Pending Review");
id_r2.setSelectedValue("Pending Review");
id_r3.setSelectedValue("Pending Review");

Screenshot attached


You received this message because you are subscribed to a topic in the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/a/runmyprocess.com/d/topic/supportforum/YqkJCaARDbI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supportforum...@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
RMP_SS2.png

Sweta Suman

unread,
Aug 23, 2014, 12:58:17 AM8/23/14
to suppor...@runmyprocess.com
Hi Jamie,

Since, your JS code is loaded first followed by radio button widget it's not setting to default value.
Write " id_r1.setSelectedValue("Pending Review") " in Post Loaded Script of respective radio button widget. Make sure ""Pending Review"" is custom list value. In order to use "label" of custom list  write "id_r1.setSelectedLabel("pending review");"

Please find attached screenshot.

If you are still facing problem,feel free to ask.

Thanks and Regards,
Sweta



screenshot.png
Reply all
Reply to author
Forward
0 new messages