javascript not executed

262 views
Skip to first unread message

g.gatibel...@gmail.com

unread,
Apr 20, 2016, 7:25:24 AM4/20/16
to Fujitsu RunMyProcess Developer Community
hi,

im trying to make dynamic list. im using the following code to change the list if the language is change

var getLangu = window.location.search.split("&");
getLangu.forEach(function(element){
if(element == "P_language=en"){
wid5.loadList("live/112501426007396846/data/46665500-06ce-11e6-bacc-066d75fba2ef?P_version=${157768}&P_mode=${LIVE}");
wid26.loadList("live/112501426007396846/data/1bc9cb80-06d1-11e6-bacc-066d75fba2ef?P_version=${157768}&P_mode=${LIVE}");
id_hebergement.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
wid30.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
wid15.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
id_voyage_avec_un_autre_collaborateur.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
}else if(element == "P_language=fr"){
wid5.loadList("live/112501426007396846/data/7f3e1980-4d65-11e5-8e86-22000b5494ab?P_version=${157768}&P_mode=${LIVE}");
wid26.loadList("live/112501426007396846/data/c1b88800-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
id_hebergement.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
wid30.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
wid15.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
id_voyage_avec_un_autre_collaborateur.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
}
});


if i launch it in the console it work fine but not in the WI in a widget script nothing happen the script isn't executing

ty by advance
Regards

Murali

unread,
Apr 20, 2016, 8:12:40 AM4/20/16
to Fujitsu RunMyProcess Developer Community, g.gatibel...@gmail.com
Hi Gary,

Please execute/call above JS code from the function, while you executing from the Widget/Script configurations and make sure that the code block returns true/false.


Regards,
Murali
Fujitsu RunMyProcess Support

g.gatibel...@gmail.com

unread,
Apr 20, 2016, 8:35:22 AM4/20/16
to Fujitsu RunMyProcess Developer Community, g.gatibel...@gmail.com
i updated the widget with the following code :

function SetLang(){


var getLangu = window.location.search.split("&");
getLangu.forEach(function(element){
if(element == "P_language=en"){
wid5.loadList("live/112501426007396846/data/46665500-06ce-11e6-bacc-066d75fba2ef?P_version=${157768}&P_mode=${LIVE}");
wid26.loadList("live/112501426007396846/data/1bc9cb80-06d1-11e6-bacc-066d75fba2ef?P_version=${157768}&P_mode=${LIVE}");
id_hebergement.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
wid30.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
wid15.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
id_voyage_avec_un_autre_collaborateur.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${157768}&P_mode=${LIVE}");
}else if(element == "P_language=fr"){
wid5.loadList("live/112501426007396846/data/7f3e1980-4d65-11e5-8e86-22000b5494ab?P_version=${157768}&P_mode=${LIVE}");
wid26.loadList("live/112501426007396846/data/c1b88800-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
id_hebergement.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
wid30.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
wid15.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
id_voyage_avec_un_autre_collaborateur.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${157768}&P_mode=${LIVE}");
}
});

return true
}
SetLang();

changed nothing , no error , the application doesn't read the widget at all i think. there is other widget js in the application that are working fine.

ps : it's a test version of a live version

Regards
Gatibelza Gary
Neopost france

Murali

unread,
Apr 21, 2016, 6:26:45 AM4/21/16
to Fujitsu RunMyProcess Developer Community, g.gatibel...@gmail.com
Hi Gary,

Could you please detail your requirement and the configurations you were trying to achieve it.(attach a screenshot possibly)

g.gatibel...@gmail.com

unread,
Apr 21, 2016, 8:09:47 AM4/21/16
to Fujitsu RunMyProcess Developer Community, g.gatibel...@gmail.com
Hi,

i have a working app in prod.

i need to translate the app.

i already work with the app translator but the app can't translate list so i made a js code for this purpose.

if i launch the js from the console js in the explorer it work but when i put it in a widget it doesn't.

i can't figure out what blocking the code from executing. the label appear but not the console.log or anything else.

Regards

2016-04-21 13_56_07-Travel Request.png
2016-04-21 13_56_26-Travel Request.png
2016-04-21 13_57_54-RunMyProcess.png
2016-04-21 13_58_22-RunMyProcess.png

Bidisha Das

unread,
Apr 21, 2016, 10:05:19 AM4/21/16
to suppor...@runmyprocess.com
Hi Gary,
Please refer to the code below & let me know if it worked.


function SetLang()
{
        var getLangu = window.location.search.split("&");
        getLangu.forEach(function(element){
                if(element == "P_language=en"){
                        wid5.loadList("live/112501426007396846/data/46665500-06ce-11e6-bacc-066d75fba2ef?P_version=${P_version}&P_mode=${P_mode}");
                        wid26.loadList("live/112501426007396846/data/1bc9cb80-06d1-11e6-bacc-066d75fba2ef?P_version=${P_version}&P_mode=${P_mode}");
                        id_hebergement.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${P_version}&P_mode=${P_mode}");
                        wid30.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${P_version}&P_mode=${P_mode}");
                        wid15.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${P_version}&P_mode=${P_mode}");
                        id_voyage_avec_un_autre_collaborateur.loadList("live/112501426007396846/data/ac3d6f10-0626-11e6-a4be-02b3a23437c9?P_version=${P_version}&P_mode=${P_mode}");
                }else if(element == "P_language=fr"){
                        wid5.loadList("live/112501426007396846/data/7f3e1980-4d65-11e5-8e86-22000b5494ab?P_version=${P_version}&P_mode=${P_mode}");
                        wid26.loadList("live/112501426007396846/data/c1b88800-57c8-11e5-9cc5-22000b8b31dc?P_version=${P_version}&P_mode=${P_mode}");
                        id_hebergement.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${P_version}&P_mode=${P_mode}");
                        wid30.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${P_version}&P_mode=${P_mode}");
                        wid15.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${P_version}&P_mode=${P_mode}");
                        id_voyage_avec_un_autre_collaborateur.loadList("live/112501426007396846/data/c1d2edd0-57c8-11e5-9cc5-22000b8b31dc?P_version=${P_version}&P_mode=${P_mode}");
                }
        });
       return true;
}
SetLang();


In your code,you have wrongly used the mode & version. P_version should either be : P_version=157768(hard-coded) or P_version=${P_version}(dynamic)

Same goes for P_mode: P_mode=LIVE or P_mode=${P_mode}.



Thanks & regards
Bidisha

g.gatibel...@gmail.com

unread,
May 2, 2016, 2:43:05 AM5/2/16
to Fujitsu RunMyProcess Developer Community, g.gatibel...@gmail.com
it worked ty

regard

Reply all
Reply to author
Forward
0 new messages