On 9 avr, 16:45, "Nicholas Paldino [.NET/C# MVP]"
[quoted text, click to view] <m...@spam.guard.caspershouse.com> wrote:
> It's hard to say what is going on. Without seeing the Javascript code
> for ShowMenu, it's impossible to say what exactly is going on.
We can assume that the javascript function return the hand to the
caller only after a selection is made in the popupmenu.
I suppose we will get the same result if the javascript function was
"WaitUntilForever" with code like "do while(true) //infinitive loop
Here is the javascript code for ShowMenu :
function ModalPopUp(items,xpos,ypos) {
alert('Custom Controls are not Installed.');
return false;
popupHeight = items.length * 17 + 32;
popupWidth = 0;
for (i=0; i<items.length; i++) {
stringWidth = 5.5 * items[i].length;
if (stringWidth > popupWidth) {
popupWidth = stringWidth;
}
}
popupWidth = Math.floor(popupWidth+25);
if (event) {
top.ActiveEvent = event;
}
if (!xpos) {
try {
xpos = top.ActiveEvent.screenX;
} catch (ee) { xpos=1; }
}
if (!ypos) {
try {
ypos = top.ActiveEvent.screenY;
} catch (ee) { ypos=1; }
}
return window.showModalDialog(top.BASE_HREF + '/blablabla/
modalmenu.html',items,
'dialogTop:'+ypos+'px;dialogLeft:'+xpos+
'px;dialogHeight:'+popupHeight+'px;dialogWidth:'+popupWidth
+'px;help:no;status:no;scroll:no;title:no');
}
function ShowMenu(menuName,xpos,ypos) {
try {
if (xpos && ypos) {
paramtext = "xpos,ypos";
} else {
paramtext = '';
}
eval(menuName + ".PopUp("+paramtext+")");
} catch (e) {
eval("val = ModalPopUp(" + menuName +
"Items.toArray(),xpos,ypos);");
if (val>0) {
try {
eval(menuName + "_Click(val)");
} catch (e1) {}
}
}
}
Is it possible to access and interract with a window.showModalDialog
with DOM or something else???
thanks!