iframe pui.click parent

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
NicoForma
New User
Posts: 1
Joined: Fri Mar 18, 2022 6:30 am
First Name: nicolas
Last Name: Matrtinez
Company Name: Robertet
Contact:

iframe pui.click parent

Post 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
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: iframe pui.click parent

Post 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.
AymericPost
New User
Posts: 1
Joined: Fri Mar 18, 2022 11:15 am
First Name: Aymeric
Last Name: Post
Company Name: APlus
Contact:

Re: iframe pui.click parent

Post 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);
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: iframe pui.click parent

Post by Scott Klement »

Thank you, Aymeric! That looks like a good solution.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests