how can we trigger function from another webscreen

Hi all,

i have written JavaScript function in webscreen1 and calling those function in webscreen 2..is it possible ?


Solution

Hi Ronan,

Just add the javascript function to the javascript property of the module (eSpace) for it to be available through the entire module.

Kind regards,

Nordin

Solution

Great you've got it working Ronan.

Could you please mark the answer as solution so that it can help other community members?

Thanks!

Nordin Ahdi wrote:

Great you've got it working Ronan.

Could you please mark the answer as solution so that it can help other community members?

Thanks!

Hi Nordin,

thank you,it worked fine, and now what i need to achieve is ,how to prevent executing JS  function on page load.or how to restrict execute specific function onpage load.



Hi Ronan,

If you don't call the JS function defined in the javascript property of the module from a specific webscreen, it won't execute.

Unless you mean sometimes it needs to execute and sometimes it doesn't. In that case you need to code a condition around it.

Regards,
Nordin

Hi Nordin,

1)i have 2 pages,i mean 2 webscreens. and  when i click back button of 2nd webscreen it should redirect to the 1st screen and  it will  perform different function and when i click home icon of 2nd screen it supposed to do different fucntion 


2)onload()  has 2 different functions 

1st fun() is for 1st webscreen.

2nd fun() is for 2nd webscreen. ->with the help of window.onload i am trying to call 2nd fun() of onload()


Ps:onload() is written in 1st webscreen