cancel
Showing results for 
Search instead for 
Did you mean: 

dialog from wdDoBeforeNavigation?

Former Member
0 Kudos

I'm trying to use wdDoBeforeNavigation to catch the condition when the user leaves a page without saving changes. I had planned on popping up a confirmation dialog asking the user to save changes, discard changes, or cancel.

1. The problem is that the dialog seems to pop up after navigation is completed. Is that to be expected?

2. Also, my component is a plug-in. If the user navigates off to a different plug-in without saving I get an exception: Creating new Controllers while/after exiting a Component is not allowed.

3. The idea for the cancel button was to cancel the navigation (take the user back to the page he/she was on). How do I do this?

Thanks,

-Keith

Message was edited by: Keith Taylor

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

How the user go to the next screen/plug-in?

Suppose that user press a button to go to next screen. Define an action "OnAction" for button. In that action handler, define your logic to check for the unsaved data, displaying confirmation dialog. When you want to go next screen, fire outbound plug wdThis.wdFirePlug<outbound_plug_name>(). In all other cases, you stay in same screen.

All the buttons defined in Confirmation dialogs require to attach with some event.

If you add 'Cancel' button in Confirmation dialog, Don't write any code in that event handler. In that case it does nothing and stay in same screen.

Not clear? Pls let me know, will post code here.

Former Member
0 Kudos

Thanks for the reply. This will work for some things and is probably the way I'll have to go. I was trying to have one set of code that handles a couple of different things, but it looks like it won't work. The user is ultimately using a web browser, so there will always be cases where data the user entered could be lost without notification.

Answers (0)