Page 1 of 1

iframe pui.click parent

Posted: Fri Mar 18, 2022 6:45 am
by NicoForma
Hi, my name is nick, i post for the first time because i have a problem.

I put in my program an iframe, where i call a program.
I would like tu use a button to update the child iframe program and then leave the program.

Actually i manage to update my iframe but my program doesn't leave onclick.

My JS looks like :

Code: Select all

getObj("IFrame1").firstChild.contentWindow.pui.click();
pui.click();
Any suggestion or idea ?

Thank you so much for your help.
Nick

Re: iframe pui.click parent

Posted: Fri Mar 18, 2022 10:31 am
by Scott Klement
You are using pui.click() in the child iframe, so I guess that iframe is a Rich Display application? I think you will need to wait for that child iframe to complete it's processing before running it in the parent iframe. Otherwise, you will close the iframe before it finishes processing.

Re: iframe pui.click parent

Posted: Fri Mar 18, 2022 11:31 am
by AymericPost
Hello, 1st timer here too. I'm a colleague of NicoForma.

Thank you for your answer, Scott Klement. Indeed, we can't do 'pui.click()' while the server is working. We found a solution using 'pui.isServerBusy()'.

Code: Select all

getObj("IFrame1").firstChild.contentWindow.pui.click();
const intervalId = setInterval(() => {
  if(!pui.isServerBusy()) {
    clearInterval(intervalId);
    pui.click();
  }
}, 200);

Re: iframe pui.click parent

Posted: Sat Mar 19, 2022 7:32 pm
by Scott Klement
Thank you, Aymeric! That looks like a good solution.