yui3

YUI3: Re-fire an event that I stopped from propagating?


I've got a form within a tabview with input fields. If the user changes the input fields, doesn't save, and then tries to change the tab I want to ask them if they want to save changes before the tab is changed. I'm preventing the tab-change from occurring using e.stopPropagation(). I then prompt the user to ask if they want to save their changes, discard them, or cancel. If the user chooses save or cancel I'd like to perform the operation and then change them over to the tab they requested.

Is there a way for me to re-fire the event? Or will I have to extract what tab they were requesting from the event and then manually change the active tab?


Solution

  • I would think that the best way to tackle this issue would be to select the tab programmatically instead of trying to "re-fire" the event somehow.

    To select a tab programmatically with tabView, you need to use the selectChild(index) method.