Thanks for the collaboration Sergio, it helped a lot for the issue, but I had to make some adjustments, because the list of objects is a bit more complex than a string, for example ..
The resolution was as follows:
I thought about using PostMessage, but for this I would need the modal iframe to be open, first step then create the modal.
In the newly created modal, it returns to the previous iframe, and collapses the object. We called the getItem () function onload.
function getItem() {
try {
var returnToUrl = "FCADQUAL.aspx";
var msgAddr = window.location.protocol + "//" + window.location.host + returnToUrl;
var o = parent.document.getElementById("ifr_FCADQUAL");
o.contentWindow.postMessage("100;0", msgAddr);
} catch (e) {
Save Exception();
}
}
In the previous iframe then, it receives the post message, and adds the object to the parameter, and sends it back:
window.addEventListener("message", receiveMessage, false);
function receiveMessage(e) {
try {
//url que verifica se post message é valido
var url = window.location.protocol + "//" + window.location.host
//testa se origem do post é do mesmo dominio
if (e.origin !== url)
return;
var sData = e.data.split(";")
//Solicita informações do item para a tela de informações diversas
sendInfoDiver();
} catch (e) {
Save Exception();
}
}
function sendInfoDiver() {
try {
var returnToUrl = "FCADELEM.aspx";
var msgAddr = window.location.protocol + "//" + window.location.host + returnToUrl;
var o = parent.document.getElementById("ifr_FCADELEM");
o.contentWindow.postMessage(elementsList, msgAddr);
} catch (e) {
Save Exception();
}
}
Then, in the modal screen that just opened, it receives the object and starts the treatment.
window.addEventListener("message", receiveMessage, false);
function receiveMessage(e) {
try {
//url que verifica se post message é valido
var url = window.location.protocol + "//" + window.location.host
//testa se origem do post é do mesmo dominio
if (e.origin !== url)
return;
if (typeof e.data == "object") {
//Recebe o objeto item e popula campos do formulário
setData(e.data);
}
//Oculta a mensagem de loading
parent.hideLoading();
} catch (e) {
Save Exception();
}
}
function setData(PlReturn) {
...
}
And to send the updated data back, just do the reverse.
Thank you for your collaboration, and remain the source for future community inquiries.
Embrace