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.

Actually, this was stupid, because it doesn't work until you assign current Scene to a Stage. So, in early phases (i.e. initialization) it causes the NullPointerException to be thrown. So, the only way is from the outside?
Just talking to myself here.... perfectly normal... B-)

Similar Messages

  • Id like to be able to initialize my 7344 Motion Controller card from within Labview and not through motion and automation explorer

    Every time I boot my PC , I have to reinitialize my 7344 through Motion and Automation Explorer  in order for it to work. Does anyone have any suggestions as to how to initialize it from within labview itself?
    thanks

    Hi,
    I am sending you a Vi for initializing the controller.The only thing you have to do is that you need to use sequence structure. In the first sequence you need to use the VI which is attached i.e 0 (default). Then the next sequence will be the program itself.
    So that as soon as you run your vi the first thing done will be initialising controller using LabVIEW. Then your program will run.
    Here the led in the front panel will glow green only the first time you are initializing.The next time it will be dim but no doubt your initializing will be taking place.Hope this vi solves your problem.
    Thxs
    Manish Karnik
    Application Engineer
    Cruiser Controls
    Mumbai, India. 
    Attachments:
    Initializing controller.vi ‏42 KB

  • Flash From Within, now won't charge.  Please help

    I have a 17 inch PowerBook 1.33, running the latest everything. I had my laptop plugged in (its a relatively new charger too, replaced recently) and was typing away with the laptop sitting on my lap.
    I went to put it on the table in front of me, and at the moment that I put the computer on the table, I saw 2 blinks from within the computer. I saw these blinks through the left speaker, towards the top, right near where the charger plugs into the computer. As soon as that happened, the LED light on the charger went off, and the computer no longer thought it was charging.
    I reset the PMU multiple times (shut down, ShiftControl+OptionPower Button, release, wait 5 seconds, start up computer) but to no avail.
    I have a very depressing feeling that I blew something on the logic board, or soemthing happened that is going to require the loevely $700 charge from Apple to fix.
    I figured I'd bring it into the Apple store and have Genius look at it, but I doubt that will solve anything.
    Any help would be appreciated.
    -From a poor college student who is freakin out.

    A brand new battery would require a full charge in order to be used;
    so you are lucky, in that the new battery had enough power already.
    So that is not an indicator of much, other than the MagSafe Board
    in the computer itself may have sustained damages due to ???
    and would need to be checked over by an authorized tech or if you
    are near an Apple Store with Genius bar, call ahead for appointment
    to have a diagnostic test done and take along the MagSafe adapter
    so they can see if that is part of the problem.
    Of course, an optical drive issue could be part of a diagnostic check.
    If you are in the US or Canada, the retail Apple Store offers a free
    service of a diagnostic, even though the computer is no longer
    covered by an AppleCare plan. So that is worth taking a drive...
    Check the details here, and follow them to see if you can make it go:
    •Intel-based Macs: Resetting the System Management Controller
    http://support.apple.com/kb/ht3964
    •About NVRAM and PRAM:
    http://support.apple.com/kb/HT1379
    Are the contacts on both the MagSafe adapter and MagSafe port
    clean, or do they have an odd color or debris in/on them? It is
    possible to clean them of debris, but don't use watery stuff. A
    tool such as a wooden toothpick could be used to see if anything
    on there could be rubbed off or out of the contact areas.
    Good luck & happy computing!

  • Determining Edit/Display Mode from Within Freestyle Component

    I am new to FPM.  We are running ESS.
    I have enhanced a new Web Dynpro Component onto an Edit page of an OVP (as a Freestyle Component).
    I want the new WDC to behave differently based on the mode I am in.
    How, from within the new WDC, can I tell if I have entered the Edit page in Edit (pencil) or Display mode?
    Thanks...
    ...Mike

    Hello Mike,
    Firstly, welcome to the wonderful world of FPM
    Well, usually with FPM, you have an Edit (or Read-only) button in the top, underneath the title (Identification Region, IDR). This, being standard, has some standard FPM events behind it.
    In your freestyle WD component, you implemented IF_FPM_BUILDING_BLOCK interface, and with it you have some additional methods in your COMPONENT CONTROLLER, such as FLUSH, PROCESS_EVENT, and so on...
    In your PROCESS_EVENT method, you can basically catch all FPM events at application level. Usually you have a big CASE, something like:
    case io_event->mv_event_id.
         when ...
         when 'FPM_EDIT'. "you can find some constants behind CL_FPM_EVENT=>GC... Right now I'm not sure how it's called exactly. But it's advised to use this constants!
              You can write your code here in order to change the behavior, basically, you can do whatever.
              also, it's the same with 'FPM_READ_ONLY'
         when others.
              return.
    endcase.
    I strongly recommend you download the latest version of FPM Cookbook, or the one that is suited with your SAP NW version.
    FPM Developer's Handbook SAP NetWeaver 7.03/7.31 SP4
    Hope I made things a little more clear!
    Tudor

  • Fireing outbound plug of interface view from within component

    Hi all,
    is there a better way of firing an outbound plug of an wd component interface view than from within the interface view controller itself?
    The problem is, that you easly get a cyclic reference if you evaluate inbound component plugs in the interface controller (usage from int view ctrl --> int ctrl needed) and then try to fire an outbound plug from this interface controller (usage comp int --> comp int view usage needed).
    One workaround is to use some custom controller with usage of the interface view, but this doesn't seem to be a nice solution.
    So is it possible to fire outbound comp plugs from, lets say the component controller - without any usage releation to the comp int view - instead, maybe via wdComponentAPI? If yes, could you provide a code snippet?
    Thanks you and best regards,
    Christian

    Hi Christian,
    this is not possible by using the public API only, i'm afraid. It is of course possible, if you decide to forget about the possible drawbacks of using methods and classes reserved for internal use. But you have to use it at your own risk. I hacked this together some weeks ago, don't know whether it still works
    * Fires an outbound plug of an interface view with parameters.
    * @param wdComponentAPI Component API "owning" the interface view.
    * @param windowName Name of window
    * @param plugName Name of outbound plug
    * @param callerParameterMap optional Map of plug parameters.
    public static final void fireOutboundPlug(
      IWDComponent wdComponentAPI,
      String windowName,
      String plugName,
      Map callerParameterMap)
      throws WDRuntimeException {
      // Find window requested
      IWDWindowInfo windowInfo = wdComponentAPI.getComponent().getComponentInfo().findInWindows(windowName);
      if (windowInfo == null) {
        throw new WDRuntimeException(
          "Can't find window: " + windowName + " in component: " + wdComponentAPI.getQualifiedName());
      // Get info of interface view
      IWDInterfaceViewInfo ifViewInfo = windowInfo.getInterfaceView();
      if (ifViewInfo == null) {
        throw new WDRuntimeException("Window: " + windowName + ", no interface view info found");
      // Find outbound plug
      IWDOutboundPlugInfo outboundPlug = ifViewInfo.findInOutboundPlugs(plugName);
      if (outboundPlug == null) {
        throw new WDRuntimeException(
          "The interface view: " + ifViewInfo.getName() + " has no outbound plug: " + plugName);
      // Parameter passing
      Collection plugParameters = outboundPlug.getParameters();
      // TODO make check optional, check caller map parameter keys against existing
      if (plugParameters == null || plugParameters.isEmpty()) {
        // No caller parameters allowed.
        if (callerParameterMap != null && !callerParameterMap.isEmpty()) {
          throw new WDRuntimeException(
            "The outbound plug: " + plugName + " has no parameters, callerParams must be empty/null.");
      // TODO This is a hack, use of internal WD runtime classes and methods (don't use productive).
      InterfaceView ifViewController =
        (InterfaceView) ((Component) wdComponentAPI.getComponent()).getController(ifViewInfo.getName());
      ifViewController.navigate(outboundPlug.getName(), callerParameterMap);
    Please remember, that not everything which is technically possible, makes sense
    Regards
    Stefan

  • Securing a JSP call from within the OAF

    Dear All
    I am calling a custom JSP file ($OA_HTML/test.jsp) from within the controller class of an OAF page using the pageContext.setForwardURL where the JSP file is registered as an AOL function, so therefore the first parameter of the setForwardURL call is the function name.
    Now the whole reason of wrapping this JSP file around OAF, is to take advantage of OAF’s security framework and Apps Specific Functionality, so that we can perform various security checks and validation before proceeding with the call to the JSP page.
    This is working fine and we are getting the desired result, however, there is nothing stopping someone from directly typing the call to the JSP into the browser and executing the JSP and effectively bypassing the OAF page/controller, e,g:
    http://server.host.domain:port/OA_HTML/test.jsp
    Now the question is, is there any way for us to either
    ·     Prevent a direct execution of the JSP from the URL, by placing some kind of special JSP commands, which intrinsically ties the JSP with the OA controller.
    ·     Inside JSP validate and authenticate a user.
    ·     Any other methodologies that will secure the JSP file.
    Your help and Guidance is appreciated.
    Thanks
    Patrice

    Actually there is AOL security u can use to validate whether the particular jsp is directly invoked or coming from secure session.You can use code like
    WebAppsContext webAppsContext = WebRequestUtil.validateContext(request, response);
    The validateContext method checks whether the session associated with the request and response streams is a valid one - if so it returns a properly validated context. If the session is invalid or expired, this will take care of displaying a login page to the user and the method will return null.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Cannot send email from within iPhoto

    Using OX X 10.7.5 cannot send email from within iPhoto.  I get this error message: "Your email did not go through because the server did not reply."
    If I change the preference to use email, everything goes fine but I lose the formatting feature.

    iPhoto Menu ->
    Preferences ->
    Accounts ->
    Delete and recreate your email settings.
    Alternatively, use Apple's Mail for the job. It has Templates too - and more of them. Check out the Stationery...

  • How can I execute an external program from within a button's event handler?

    I am using Tomcat ApacheTomcat 6.0.16 with Netbeans 6.1 (with the latest JDK/J2EE)
    I need to execute external programs from an event handler for a button on a JSF page (the program is compiled, and extremely fast compared both to plain java and especially stored procedures written in SQL).
    I tried what I'd do in a standalone program (as shown in the appended code), but it didn't work. Instead I received text saying the program couldn't be found. This error message comes even if I try the Windows command "dir". I thought with 'dir' I'd at least get the contents of the current working directory. :-(
    I can probably get by with cgi on Apache's httpd server (or, I understand tomcat supports cgi, but I have yet to get that to work either), but whatever I do I need to be able to do it from within the button's event handler. And if I resort to cgi, I must be able to maintain session jumping from one server to the other and back.
    So, then, how can I do this?
    Thanks
    Ted
    NB: The programs that I need to run do NOT take input from the user. Rather, my code in the web application processes user selections from selection controls, and a couple field controls, sanitizes the inoputs and places clean, safe data in a MySQL database, and then the external program I need to run gets safe data from the database, does some heavy duty number crunching, and puts the output data into the database. They are well insulated from mischeif.
    NB: In the following array_function_test.pl was placed in the same folder as the web application's jsp pages, (and I'd tried WEB-INF - with the same result), and I DID see the file in the application's war file.
            try {
                java.lang.ProcessBuilder pn = new java.lang.ProcessBuilder("array_function_test.pl");
                //pn.directory(new java.io.File("K:\\work"));
                java.lang.Process pr = pn.start();
                java.io.BufferedInputStream bis = (java.io.BufferedInputStream)pr.getInputStream();
                String tmp = new String("");
                byte b[] = new byte[1000];
                int i = 0;
                while (i != -1) {
                    bis.read(b);
                    tmp += new String(b);
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + tmp);
            } catch (java.io.IOException ex) {
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + ex.getMessage());
            }

    Hi Fonsi!
    One way to execute an external program is to use the System Exec.vi. You find it in the functions pallet under Communication.
    /Thomas

  • Email from within iPhoto '08 (7.1.1) quit working

    I am running Leopard (10.5.1) and iPhoto '08 (7.1.1) on a 2.4ghz 17" MBP. Whenever I try to email a photo from within iPhoto it pops up a window to let me choose size & options, I hit the Compose button, it will then popup a window saying that it is Preparing photos for email... then that window just goes away and it never creates the new email. I see this same behavior regardless of whether or not Mail is already open and regardless of what photo I am trying to email. This was working fine in the past... believe that it quit working after the upgrade to 10.5.1 (but not absolutely positive of that)... Any troubleshooting ideas would be greatly appreciated as I use this feature quite often.
    Cheers!
    Kirk

    Kirk:
    Try deleting the iPhoto preference file, com.apple.iPhoto.plist, that resides in your User/Library/Preferences folder. Next, if needed, download and run BatChmod on the iPhoto Library folder with the settings shown here, putting your administrator login name, long or short, in the owner and group sections. You can either type in the path to the folder or just drag the folder into that field.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Send email from within apex 2.1 application

    Hello,
    I like to send email from within apex application. I use oracle 10g xe with apex 2.1
    thx for advice
    Edited by: wucis on Feb 27, 2012 11:49 AM

    That is a very old version indeed. The documentation for sending emails from Apex 2.2 is here:
    http://docs.oracle.com/cd/B31036_01/doc/appdev.22/b28550/advnc.htm#BABJHJJF

  • I cannot email photos from within iPhoto (v. 9.5.1). When I hit send I get a message: "Your email did not go through because the server did not reply." This happens for both my iCloud account and my Shaw account. What to do???

    I cannot email photos from within iPhoto (v. 9.5.1). When I hit send I get a message: "Your email did not go through because the server did not reply." This happens for both my iCloud account and my Shaw account. What to do???

    Are you able to email from Mail with those two accounts?  If so:
    1 - go to iPhoto's Accounts preference pane and delete both accounts. Now add them back and try again.
    2 - a better solution IMO is to set Mail as the email client for iPhoto is iPhoto's General preference pane.  This gives you better access to your contacts, a sent copy of all emails and, if you want a layout similar to iPhoto's, photo layouts located in Mail's stationary.

  • Just upgraded to Lion an am discovering that I cannot send email photos from within iPhoto. Error message says bad Internet connection or server not working, when that's not the case. Never happened in Snow Leopard! Help!!!

    Just upgraded to Lion an am discovering that I cannot send email photos from within iPhoto. Error message says bad Internet connection or server not working, when that's not the case. Never happened in Snow Leopard! Help!!!

    what email service - Yahoo mail have been acting up lately
    you can try setting Mail as your email client - it resolves this pfoblem for some people
    LN

  • Cannot send an email from within contacts on iPhone

    I’m trying to send email from within my contacts list app on my iPhone but the send button will not highlight and therefore cannot be pressed to send the email.   Sending email from the mall app works fine. Anyone know why this is happening?

    That also occurs for me and looks like a bug. The problem seems to be that, although the "To" address appears in the draft email, the iPhone does not think that it is there and won't activate the Send button. If one simply touches the "To" field the address disappears.
    Submit this as a bug at http://www.apple.com/feedback/iphone.html

  • Oracle Forms 11gR2 - Cannot deploy locally from within Forms

    I cannot deploy locally from within forms.  The server is up and running and I can deploy the form by putting the correct URL in the address line of the browser window.  When I try to deploy from within forms it comes up with some crazy URL that differs everytime.
    This is what the URL should be and this works from the browser:
    http://machinename:7002/forms/frmservlet?form=WRD608ADMIN_11g.fmx&userid=&otherparams=useSDI=yes
    Here is one of the URLs it came up with when I try to run it from within Forms:
    http://localhost:60231/lysVL2VjqT33znjfvLwanktVRxTIc6dEwVeRNXXRmhYU2qjf
    Localhost is always there, but the rest varies.
    In Forms, I have the Preferences, Runtime set to:
    http://machinename:7002/forms/frmservlet
    Where machine name is my PC, it is the same for this address as the URL above that works directly from the browser.
    So what am I missing?
    Thank you in advance.

    Generally speaking, it is discouraged to manually edit any of the configuration files if they are managed by WLS Console or EM.  In this case, default.env is managed by EM.  Therefore, changes to the file should be done through EM.  If however, you want to alter the file manually, the following is likely the best way to accomplish this:
    1.  Stop the WLS Admin Server and Node Manager
    2.  Locate the proper file you wish to edit.  By proper I mean, there are several copies of most config files.  Most of the config files found in the Oracle Home are actually template files and are not used at runtime.  Altering these will not give you the change you want.  The default.env you want would be here (assuming Windows)
    C:\Oracle\Middleware\user_projects\domains\ClassicDomain\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.2\config
    If you are using a "Development" installation type, the above path will reflect AdminServer instead of WLS_FORMS.  Remember that Development installations are not for multi-user purposes.  Production deployments require the "Deployment" installation type, which can also include the Builders.
    Do NOT make any changes yet.
    3.  Once you find the correct file, create a backup copy.  Then open the file for edit (not the backup).
    4.  Make the desired changes and save.
    5.  Restart Node Manager and Admin Server if you plan to use them.
    For more information about using EM to manage your configuration, refer to the product documentation:
    http://docs.oracle.com/cd/E38115_01/doc.111210/e24477/configure.htm#CHDCCGHI

  • Opening an https connection from within a Servlet.

    I am having problems trying to establish an HTTPS connection to a servlet from within a different servlet.
    I get the java.net.MalformedURLException: unknown protocol: https. SSL is setup for the web server. Direct connections from the browser to a servlet work fine with SSL, but a connection from one servlet to another servlet fails. I'm stumped. Is there a separate SSL install/configuration required for the servlet engine? Could anyone explain?

    When you set up SSL enabled web server, you should be getting a trust cert file that knows the hand shake protocol to talk to that server. Once you have that file, you can load that file from that servlet using System.load and then you would be able to talk to anything that runs on that SSL enabled Web server.
    Also you must have JSSE jar files installed in your system .
    Check out this url:
    http://java.sun.com/products/jsse/INSTALL.html
    Let me know if you still have problems

Maybe you are looking for