Results 1 to 2 of 2

Thread: onPreWindowClose not called by ExitCommand

  1. #1
    Join Date
    Aug 2004
    Location
    Liège, Belgique
    Posts
    47

    Default onPreWindowClose not called by ExitCommand

    When ExitCommand is called to quit, it calls Application.instance().close() which calls System.exit(0). The windows of the application are not closed cleanly.

    Solution :

    Change close() in Application:
    Code:
        public void close() {
          if (windowManager.close())
            System.exit(0);
        }
    Change close() in WindowManager:
    Code:
        public boolean close() {
            List t = (List)((ArrayList)windows).clone();
            Iterator e = t.iterator();
            while (e.hasNext()) {
                ApplicationWindow window = (ApplicationWindow)e.next();
                if (!window.close())
                  return false;
            }
            if (subManagers != null) {
                e = subManagers.iterator();
                while (e.hasNext()) {
                    WindowManager wm = (WindowManager)e.next();
                    if (!wm.close())
                      return false;
                }
            }
          return true;
        }
    Change close() in ApplicationWindow:
    Code:
        public boolean close() {
            boolean mustClose = getApplicationAdvisor().onPreWindowClose(this);
            if (mustClose) {
              control.dispose();
              control = null;
              if (windowManager != null) {
                 windowManager.remove(this);
              }
              windowManager = null;
            }
            return mustClose;
        }

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    I incorporated these fixes and your other ApplicationWindow bug report regarding onWindowCreated. Thanks Patrick!
    Keith Donald
    Core Spring Development Team

Similar Threads

  1. handleInvalidSubmit called, why?
    By sulam in forum Web
    Replies: 9
    Last Post: Feb 2nd, 2007, 03:11 AM
  2. Replies: 6
    Last Post: Nov 30th, 2005, 04:21 AM
  3. Forcing onSubmit to be called
    By biguniverse in forum Web
    Replies: 1
    Last Post: Aug 2nd, 2005, 01:54 PM
  4. onSubmit not called
    By christophe in forum Web
    Replies: 4
    Last Post: Jul 29th, 2005, 05:10 PM
  5. indirectly called method not intercepted
    By springtester in forum AOP
    Replies: 1
    Last Post: Sep 1st, 2004, 06:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •