Loading ...
Sorry, an error occurred while loading the content.

Tab View - preventing tab changes based on user feedback

Expand Messages
  • Chisel Wright
    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
    Message 1 of 1 , Nov 19, 2007
    • 0 Attachment
      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
      (SimpleDialog?).
      - "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
      called.

      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
      callbacks?

      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.

      TIA

      Chisel
      --
      Chisel Wright
      e: chisel@...
      w: http://www.herlpacker.co.uk/

      We never decided to postpone this issue.
      We just agreed that we would deal with other issues first.
    Your message has been successfully submitted and would be delivered to recipients shortly.