PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WB20] How can I manipulate a control outside the iFrame using code inside the iFrame?
[WB20] How can I manipulate a control outside the iFrame using code inside the iFrame?
Débuté par David Cabrera, 15 aoû. 2017 20:29 - 3 réponses
Posté le 15 août 2017 - 20:29
Good afternoon

I have the following problem:

I have a main page that contains an iFrame where that iFrame is placed all the other pages of the system, in a certain page that is inside the iFrame I need to be able to manipulate a control that is in the same page as the iFrame, but being a Level does not recognize the control.

How can I manipulate a control outside the iFrame using code inside the iFrame?

Thanks in advance
Posté le 15 août 2017 - 20:59
Hi

it MAY be possible in classic mode (ie NON AWP), if the context of the main page is open, y using pagename.controlName.

In awp mode, each page knows only itself, and there is no context, so I don't thin it's possible.

Maybe the main page could look for value in a field (hidden?) of the page displayed in the iframe, but I'm not even sure that will work, and that probably would have to be done in JS using fields alias, as only in the browser side are the 2 pages together. So in such a case, a solution would probably to relay the information by storing in the DB on one side and reading it from there on the other.

Best regards
Posté le 15 août 2017 - 21:05
Hi David,

An iFrame is a (html) document inside the current document.
So it canmot reference elements outside that document.
You need a HTML or RTA control.

Kind regards,
Piet
Posté le 17 août 2017 - 17:21
Good Morning

I could not make it work, but I solved it differently.

Thanks Fabrice and Piet.