PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → 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?
Iniciado por David Cabrera, ago., 15 2017 8:29 PM - 3 respostas
Publicado em agosto, 15 2017 - 8:29 PM
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
Publicado em agosto, 15 2017 - 8:59 PM
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
Publicado em agosto, 15 2017 - 9:05 PM
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
Publicado em agosto, 17 2017 - 5:21 PM
Good Morning

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

Thanks Fabrice and Piet.