PatrykWro Posted March 3 Share Posted March 3 I've updated UniGui 1.90.0.1535 (2021) to 1.95.0.1580 (2024). Also I've updated Delphi 11 to 12 and EurekaLog to the latest. I didn't change the source codes. Also BackButtonAction is set to bbaDoNothing. Unfortunately now after upgrade always when use button "Logout" in my application (close session and main window) i see in the Chrome browser pops up message "Leave site? changes you made may not be saved.". Has anything changed? What did I miss? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 4 Share Posted March 4 Hello, Can you check if the standard demo works correctly? Quote Link to comment Share on other sites More sharing options...
PatrykWro Posted March 4 Author Share Posted March 4 Probably so. But which demo exactly? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 4 Share Posted March 4 10 minutes ago, PatrykWro said: But which demo exactly? I think any demo, adding your logic, "logout" code. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted March 5 Share Posted March 5 On 3/3/2024 at 9:16 PM, PatrykWro said: I've updated UniGui 1.90.0.1535 (2021) to 1.95.0.1580 (2024). Also I've updated Delphi 11 to 12 and EurekaLog to the latest. Hello, Good practices : Never change the engine and the chassis and the tires at the same time for an F1. Test one by one. We spent and lost many times in the past with this scenario (not with unigui) : with new Database engine, new acces DB, new Delphi, ... "Driver, go slowly, we are in a hurry" Quote Link to comment Share on other sites More sharing options...
PatrykWro Posted March 9 Author Share Posted March 9 I checked demo with Login Page and it works correctly. After that I've started check my code again and I found the problem. For my MainForm in the Script property I have a code like below: var IDLE_TIMEOUT = 3600; //seconds var _idleSecondsCounter = 0; document.onclick = function() { _idleSecondsCounter = 0; }; document.onmousemove = function() { _idleSecondsCounter = 0; }; document.onkeypress = function() { _idleSecondsCounter = 0; }; window.setInterval(CheckIdleTime, 1000); function CheckIdleTime() { _idleSecondsCounter++; var oPanel = document.getElementById("SecondsUntilExpire"); if (oPanel) oPanel.innerHTML = (IDLE_TIMEOUT - _idleSecondsCounter) + ""; if (_idleSecondsCounter >= IDLE_TIMEOUT) { ajaxRequest(MainForm.form, '_idle_timeout', []); } else { ajaxRequest(MainForm.form, '_curr_timeout', ['IDLE_TIMEOUT='+IDLE_TIMEOUT,'_idleSecondsCounter='+_idleSecondsCounter]); } } onbeforeunload = function() { return "To spowoduje zamknięcie aplikacji bez zapisu ewnetualnych zmian! Czy jesteś pewien?"; }; This is part of code to automatic logout if user doesn't use mouse. It works correctly but the problem i in the last line: onbeforeunload = function() { return "To spowoduje zamknięcie aplikacji bez zapisu ewnetualnych zmian! Czy jesteś pewien?"; }; When I removed this line, the problem was solved. Chrome browser no more pops up message "Leave site? changes you made may not be saved.". This solves my problem. There are only two things I don't know: 1. This line no longer works before, but it didn't cause a problem in UniGui 1.90.0.1535 (2021). 2. Why does this line cause browser pops up message "Leave site? changes you made may not be saved." and not display this text "To spowoduje zamknięcie aplikacji bez zapisu ewnetualnych zmian! Czy jesteś pewien?" ? 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.