Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on unsaved changes doesn't work #102

Open
sejal27 opened this issue Jun 19, 2018 · 4 comments
Open

Warn on unsaved changes doesn't work #102

sejal27 opened this issue Jun 19, 2018 · 4 comments
Assignees

Comments

@sejal27
Copy link

sejal27 commented Jun 19, 2018

I replaced my current multi select item with select 2 plug in and it had Warn on Unsaved Changes set to Ignore. But when I refresh the page, it still prompts for unsaved changes.

@nbuytaert1 nbuytaert1 self-assigned this Apr 2, 2019
@steffi80
Copy link

I have the same issue. @sejal27 did you find a way to ignore unsaved changes?

@tonupold
Copy link

tonupold commented Feb 14, 2020

I have the same issue: Apex 19.1.0.00.15 and Select2 version 3.0.3.

Traced down that it happens when "Display null value" is set to NO

image

So workarund is to leave "Display null value" to YES on SELECT2 item when "Warn on Unsaved Changes" is set to "Ignore".

The reason is that apex.page.isChanged() returns True, because the $('#P1_SELECT2_ITEM').val() returns Null. But on normal select items the $('#P1_SELECT_ITEM').val() returns empty string "".

To repeat it set "Execute when Page Loads" to :

alert(apex.page.isChanged()); // true
alert($('#P1_SELECT2_ITEM').val()); // null

In apex "desktop_all.min.js?v=19.1.0.00.15" the situation happens in function "apex.item(x).isChanged()" here as p():

image

@rimblas
Copy link
Contributor

rimblas commented Feb 14, 2020

@tonupold just a debugging tip, if you turn on Debug on the page, the desktop_all.min.js file will get exploded into all the un-minified individual components making it very easy to track the correct code.
The code you identified is part of apex/item.js and in particular the isChanged function.
Perhaps the plugin should have it's own isChanged callback as highlighted below.
Not sure... have not looked into the issue in detail.
image

@MichelVogelpoel
Copy link

In Apex 18.2 we still found this issue when using Select2 plugin.
As a workaround I have added the following class in the page Item Advanced CSS classes: js-ignoreChange
Now I don't receive the popup any more if I change in the item with Select2 type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants