communication between DSPF and IFrame DSPF

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
DavidBal
Profound User
Posts: 24
Joined: Fri Apr 13, 2018 4:06 am
First Name: David
Last Name: Baltromei
Company Name: H. Gautzsch Firmengruppe
Country: Germany
Contact:

communication between DSPF and IFrame DSPF

Post by DavidBal »

Hi,

I created a DSPF with a Tab Panel(main DSPF). Every Tab has its own IFrame(child DSPF).
If I click on a button(Speichern) in my main DSPF I am able to change a input field in my child DSPF's. That works.
start_save.PNG
start_save.PNG (466.08 KiB) Viewed 701 times
Buttons onclick:

var iframe = document.getElementById("IFrame1");
var innerDoc = iframe.children[0].contentDocument || iframe.children[0].contentWindow.document;

var box = innerDoc.getElementById("TXTSPEICHE");
parent.changeElementValue(box,'1');


My question is how can I detect the changes I made with JavaScript to the field in my child DSPF's?
Onchange or Oninput in the input field does not work. I need to place a pui.click().
I attached the main(zztst1fm) and a child(zztestdba) DSPF.

Hope you can help me!

Thanks

David
Attachments
ZZTST1FM.json
(3.93 KiB) Downloaded 102 times
ZZTESTDBA.json
(4.9 KiB) Downloaded 76 times
User avatar
Kaylee Law
Profound Logic Staff Member
Posts: 13
Joined: Mon Sep 18, 2017 11:36 am
First Name: Kaylee
Last Name: Law
Company Name: Profound Logic
Contact:

Re: communication between DSPF and IFrame DSPF

Post by Kaylee Law »

Hello David,

Thank you for writing in.

It looks like you are trying to execute a pui.click() on the display file located inside of the iFrame (zztestdba) is this correct?

If so you can simply call the pui.click() from the button located on your main display file (zztst1fm) by adding the following line at the end of your button's onclick event:
var iframe = document.getElementById("IFrame1");
var innerDoc = iframe.children[0].contentDocument || iframe.children[0].contentWindow.document;

var box = innerDoc.getElementById("TXTSPEICHE");
parent.changeElementValue(box,'1');

getObj('IFrame1').childNodes[0].contentWindow.pui.click()
This code will select the PUI object located inside of the iFrame and run it's version of pui.click().

Could you try this code and see if it accomplishes what you are looking for?
Kaylee Law
Technical Support Specialist
Profound Logic Software
DavidBal
Profound User
Posts: 24
Joined: Fri Apr 13, 2018 4:06 am
First Name: David
Last Name: Baltromei
Company Name: H. Gautzsch Firmengruppe
Country: Germany
Contact:

Re: communication between DSPF and IFrame DSPF

Post by DavidBal »

Hi Kyle,

great to see that only one line of code is needed to get my expected result. :)
Works great. Many thanks!

David
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests