How to trigger a javascript

436 views
Skip to first unread message

mme...@avanxo.com

unread,
Feb 6, 2015, 3:58:34 PM2/6/15
to suppor...@runmyprocess.com, Joseph Wrian Ceron Iriarte
Hi team,

I'm triying to trigger a javascript widget when the List's "Value variable" has changed from a List Widget to set a value to other Text widget. My List is custom list based and I've defined a default value.

The javascript have the following conde:

--------------
function valueChanged(name, value){
alert('Name ' + name + ' Value ' + value);
var pais = "[[pais_legaliza]]";
var monedaconsumo = "[[moneda_consumo]]";
var monedalegaliza = '';

alert('Llave ' + pais+monedaconsumo);

switch(pais+monedaconsumo) {
case "ColombiaPESO COLOMBIANO COP $":
monedalegaliza = 'PESO COLOMBIANO COP $';
break;
case "BrasilREAL BRASILEÑO BRL $":
monedalegaliza = 'REAL BRASILEÑO BRL $';
break;
case "MexicoPESO MEXICANO MXN $":
monedalegaliza = 'PESO MEXICANO MXN $';
break;
case "PerúNUEVO SOL PERUANO PEN $":
monedalegaliza = 'NUEVO SOL PERUANO PEN $';
break;
default:
monedalegaliza = 'DÓLAR EEUU USD $';
}

id_moneda_legaliza.setText(monedalegaliza);
}

RMPApplication.addListener(valueChanged);
--------------

The js widget is listen to "pais_legaliza" and "moneda_consumo" variables.

I attach two images about my web interface design.

Thank you for your help.

Best regards.

Manuel Medina
id_moneda_consumo.PNG
id_pais_legaliza.PNG

Pankaj Kumar

unread,
Feb 6, 2015, 10:29:04 PM2/6/15
to suppor...@runmyprocess.com, mme...@avanxo.com, Joseph Wrian Ceron Iriarte
HI Manuel,

You want to trigger the js widget code when any of the list value changed, is this correct.

Since you have already added the variable "pais_legaliza" and "moneda_consumo" in the jswidget "Listen to" property, please confirm whether the code js code is not executing when the value is changed in the list.

Also you have added the RMPApplication.addListener(valueChanged); listener, your function "valueChanged" will be executed for the whole web interface rather than only for the change in the list.

Since you are already using the "Listen to" in the js widget, is there any specific reason using the listener function.


Thanks,
Pankaj Kumar



--
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/a6bcd037-8986-40e1-aaa5-d6efbe6f36b6%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

mme...@avanxo.com

unread,
Feb 9, 2015, 8:08:40 AM2/9/15
to suppor...@runmyprocess.com, mme...@avanxo.com, jce...@avanxo.com
Hi Pankaj,

I didn't have a reason for use RMPApplication.addListener function.

The error was solved to adding a default value to target field, this target field is a text field which didn't have a configured default value.

I don't understand why this JSWidged needed a default value in the target field.

I attach two images about before and after solution, only with this additional configuration the error was solved.

Thank you for your help.

Best regards.

Manuel Medina.
id_moneda_legaliza_WithDefaultValue.PNG
id_moneda_legaliza_WithoutDefaultValue.PNG
Reply all
Reply to author
Forward
0 new messages