View Full Version : Commit FormModel on losing focus on FormPage
afida
Sep 1st, 2004, 02:16 AM
Is it possible to get the state of FormModel either changed or not as a whole form not by a property? I want to prompt user to save their changes if they move away from FormPage and FormModel has been changed.
Amad
oliverhutchison
Sep 2nd, 2004, 02:42 AM
You'll need to do something like this:
void onFocusLost() {
if (formModel.isDirty()) {
// prompt user to save
}
}
Ollie
afida
Sep 2nd, 2004, 04:33 AM
Thanks Ollie . Now If I can only make JPanel to work with FocusListener... For some reason or bug JPanel never gets focusGained or focusLost events.
But thanks for your help, any ideas about my other post on CreateCompoundChild
Thanks
Amad
pdbruycker
Sep 15th, 2004, 08:14 AM
A JPanel never receives focus (it's not focusable), so it never receives focusLost or focusGained events.
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.