I have tried many different variations but can not get this to work correctly when it comes to bringing windows to top by using a dynmic ID name. Please explain how to initialize multiple windows. I do not know the number of windows the user will open so need to give each window an id dynamically. Below are the functions I currently use. if I run the first function it opens a number of times in sequence it opens each window correctly. However if I then run the second function the window opens up blank with no URL attached. Java error: dhxWins.window(“CDiscussWin”+WinID) is null.
function CDiscuss() {
WinPos=WinPos+20;
var WinTop=posTop()+(80+WinPos);
var WinRight=posRight()-(860+WinPos);
if (!dhxWins) dhxWins=new dhtmlXWindows();
dhxWins.createWindow(“CDiscussWin”+WinID,WinRight,WinTop,823,255);
dhxWins.window(“CDiscussWin”+WinID).setText(“New Discussion”);
dhxWins.window(“CDiscussWin”+WinID).attachURL(“CDiscussWindow.php?NR=”+row+“&S=”+customer+“&C=”+Contact+“&E=”+CExternal+“&SoftDB=”+SoftBase+“&ClientID=”+ExtID+“&Priv=P&P=”+P+“&WinID=”+WinID+“&”);
dhxWins.window(“CDiscussWin”+WinID).denyResize;
dhxWins.attachEvent(“onFocus”, function() {
dhxWins.window(“CDiscussWin”+WinID).bringToTop();
});
WinID++;
}
function SDiscuss() {
WinPos=WinPos+20;
alert("WinID is "+WinID)
var WinTop=posTop()+(80+WinPos);
var WinRight=posRight()-(860+WinPos);
if (!dhxWins) dhxWins=new dhtmlXWindows();
dhxWins.createWindow(“SDiscussWin”+WinID,WinRight,WinTop,823,255);
dhxWins.window(“SDiscussWin”+WinID).setText(“New Discussion”);
dhxWins.window(“SDiscussWin”+WinID).attachURL(“SDiscussWindow.php?NR=”+row+“&S=”+supplier+“&C=”+Contact+“&E=”+CExternal+“&SoftDB=”+SoftBase+“&SupplierID=”+ExtID+“&Priv=P&P=”+P+“&WinID=”+WinID+“&”);
dhxWins.window(“SDiscussWin”+WinID).denyResize;
dhxWins.attachEvent(“onFocus”, function() {
dhxWins.window(“SDiscussWin”+WinID).bringToTop();
});
WinID++;
}