Jump to content

After upgrade to latest UniGUI 1.95.0.1580 the Chrome browser pops up message "Leave site? changes you made may not be saved." is always shown.


PatrykWro

Recommended Posts

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?

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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 b
rowser 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?" ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...