Home > Forum > Forms > Q: How to deacitvate Alert-Message "data will be lost" while leaving page?

Q: How to deacitvate Alert-Message "data will be lost" while leaving page?
1

MVP

Good morning,

we just updated WEBCON from 2021.1.4.154 to 2022.1.4.127

We noticed that there is a new functionality in the frontend that checks
for unsaved fields when exiting the page. Overall, a great new feature,
but unfortunately it leads to a negative user experience in some specific cases.

For example, we often use only one start step to implement a search for the users.

The user has the option to select or enter some filters and the DATA TABLE shows the
remaining instances. Clicking on the (activated) "instance hyperlink"
(in this case configured as -Open existing item in new window-) opens,
ONLY in the new version, an alert window with the message (translated)
"All unsaved data will be lost".

The alarm refers to the previously entered filters. In the old version, these
unsaved entries were ignored.

Does anyone know, if there is a possible configuration to disable this actually
good function in special cases?


Thanks in advance,
Bjoern

MVP

Hi Björn,


instead of only opening the hyperlink, you could create a little JavaScript which would be executed instead.
javascript: sessionStorage.setItem("WebconBPS_FormIsDirty",sessionStorage.getItem("WebconBPS_FormIsDirty").replace(":true}",":false}"));document.location.href="/db/1/app/14";

I haven't tested this explicit line above, but used something similar in the past.
The script would change the current "IsDirty", value, for example with this "burte foce method":
Maybe it would be even better to execute the reset the FormIsDirty on the "Value has been changed" trigger.

The WebconBPS_FormIsDirty was found by Sebastian Gębuś
https://community.webcon.com/forum/thread/2411?page=1#m2447

Best regards,
Daniel