Skip to Content
0
Former Member
Nov 19, 2014 at 03:10 PM

Give confirmation before view unload

474 Views

Hi All,

I am working on Single Page application using SAPUI5. I load various view using oContorller.router.navTo("myRoutPathName").

In my page I have few link in header as well as Left hand side(LHS) column. Main content area is in center of page, in which all view are loaded.

Now, I am having one view which hold editable control(say form). I want if use click on any header/LHS link he should get confirmation prompt before other view loaded, as "Are you sure, you don't want to Save changes?" if user click on Yes then destination view should get load. else if user click on cancel or close confirmation popup, then user should remain in same view.

I know how to use SPAUI5 confirmation prompt. but don't know which global event should I write this code. Also don't know how to prevent user form going to next selected view.

thanks in Advanced. Any help is appreciated.