Tab View - preventing tab changes based on user feedback
- Hi all,
I was just wondering if there was a general (sane) way to do something
like this with the tab-view:
- monitor fields on a form for changes
- if/when a user tries to change tab (with unsaved changes) prompt them
- "continue" => show the desired tab
- "cancel" => don't change tab
I've got an event listener for beforeActiveTabChange, which pops up a
SimpleDialog [monitoring modified fields can be tackled later], but the
dialog is independent of the beforeActiveTabChange function that's
I'm not sure of a "clean" way of doing this. Should I be looking at
always denying the tab change in the listener (a la 'return false;')
then when appropriate using "tabView.set('activeIndex', tabIndex);" in
the dialog callback(s)?
If so, how do I pass the active and target tabs through to the dialog
Is there a more sensible way of doing this?
I'm still relatively new to YUI, so I'm still having some trouble
knowing the best approach to solving certain problems.
We never decided to postpone this issue.
We just agreed that we would deal with other issues first.