I have much the same thing.  We don't auto validate, but we show a confirmation 
that the user is leaving with some unsaved data and give them the opportunity 
to stay where they are or keep going.  We took a slightly different approach.

We extended TabNavigator and overwrote the selectedIndex setter and the 
selectedItem setter.  We simply check for the dirty data flag.  If it is true, 
then we show the confirmation.  If the user selects "No, stay where I am" then 
we simply do not call super.selectedIndex = value.  If the user selects "Yes, 
forget my changes and move on" then we simply call super.selectedIndex = value.

We have more logic than that for our situation, but hopefully you get the idea.

Dale

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Chang, Shyue-jing
Sent: Monday, May 04, 2009 11:19 PM
To: [email protected]
Subject: [AFFUG Discuss] tabnavigator

Hi,

I ran into problems with the TabNavigator.

I would like to do some validation on a form when the user leaves a tab (there 
is no save button on the form).  If there are errors, the selectedIndex is set 
back to the previous tab for the user to correct the errors.  This worked fine. 
However, after the user corrected the errors and clicked to go to the next tab, 
the change event did not fire. The new tab was highlighted, but the content 
under the old tab was displayed.  If I clicked the old tab again at this point, 
the change event fired and showed the correct old and new indexes. The old tab 
was highlighted and its content displayed.

The codes are something like:

when a change event fired,
validate form,
if errors
{ put out alert message;
  set selectedIndex = old index;
)

Any ideas on how to fix this?  Thanks.

Susan




-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------


Reply via email to