Davide Vaccaro Posted September 15, 2022 Share Posted September 15, 2022 HI Everybody i open a new Browser Page with the following coomand (from the website): UniSession.BrowserWindow('news/news.dll', 1280,1024, '_blank' ); and so i start a new UniGui Application in Form Mode, it work super but when i let the user quit the application with a Form.Close the result is an empty new Browser Windows (blue screen with the "Restart Application" line.... How can i close this Browser Windows? Thanks for any help. Davide Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 15, 2022 Share Posted September 15, 2022 Hello, I use this code to open new window tab UniSession.AddJS('let printWindow;' + ' function OpenNewTab() {' + ' printWindow = window.open(''news/news.dll'', ''1280'',''1024'');' //onready do some stuff + ' ready(function(){' //Show Print Dialog //+ ' printWindow.print();' + ' });' //Close the new browser tab after 5 seconds //+ ' setTimeout(closeWin, 5000);' + '};' //wait to ready state + ' function ready(callback){' // in case the document is already rendered // + ' if (printWindow.document.readyState!=''loading'') callback();' + ' if (printWindow.document.readyState == 4 && printWindow.document.status == 200) callback();' // modern browsers + ' else if (printWindow.document.addEventListener) printWindow.document.addEventListener(''DOMContentLoaded'', callback);' // IE <= 8 + ' else printWindow.document.attachEvent(''onreadystatechange'', function(){' // + ' if (printWindow.document.readyState==''complete'') callback();' + ' if (printWindow.document.readyState == 4 && printWindow.document.status == 200) callback();' + ' });' + ' }' //Close the new browser tab + 'function closeWin() {' + ' printWindow.close();' + '};' //Start new window Tab + ' OpenNewTab(); ' ); Quote Link to comment Share on other sites More sharing options...
Davide Vaccaro Posted September 15, 2022 Author Share Posted September 15, 2022 Hi irigsoft, thanks for the quick hint in my case we have a app.dll as caller and a news.dll as called app with " UniSession.BrowserWindow('news/news.dll', 1280,1024, '_blank' ); " news.dll start in a separate Browser session... is that equivalent to a new TAB? Sorry in UniGui i am a newbie so maybe my doubt are out of place. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 15, 2022 Share Posted September 15, 2022 Hello, Where do you want to close the new tab from? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 15, 2022 Share Posted September 15, 2022 1 hour ago, Davide Vaccaro said: Hi irigsoft, thanks for the quick hint in my case we have a app.dll as caller and a news.dll as called app with " UniSession.BrowserWindow('news/news.dll', 1280,1024, '_blank' ); " news.dll start in a separate Browser session... is that equivalent to a new TAB? Sorry in UniGui i am a newbie so maybe my doubt are out of place. Sorry, my mistake, I meant "new browser page" Quote Link to comment Share on other sites More sharing options...
Davide Vaccaro Posted September 15, 2022 Author Share Posted September 15, 2022 OK, thanks, then i gonna try it tomorrow morning, Thanks! Quote Link to comment Share on other sites More sharing options...
Davide Vaccaro Posted September 15, 2022 Author Share Posted September 15, 2022 Ok i try it and i learned a lot of things....but now i understand what Sherzod mean with Where do you want to close the new tab from? I want to close the new browser Form inside the new browser form (news.dll) like the user click the borderIcon 'X' on the top/right of the form. Irigsoft, thanks again, you showed me how important is to master JavaScript.....im am an old delphi-man. I tried with soTerminateOnSession in the ServerModule with no success..... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.