2 Replies Latest reply on Apr 28, 2012 9:53 PM by 921640

    setOnCloseRequest() from within controller?

      Is it possible to set OnCloseRequest event handler for a Stage from within it's Scene's controller?

      I'm not sure I'm being clear enough, so here is the scenario:

      User opens an item for editing from the list of items. Item editor is in a new window. The user makes some changes, does not save them and tries to close the editor. In that instance I want the program to ask her whether she wants to save the changes, close without saving or cancel closing.

      Of course, I want to setOnCloseRequest(EventListener<WindowEvent>) for the editor. :) Any thoughts or suggestions? It doesn't have to be my way, I just care about the functionality.