Class controller Stage/Window reference

Is there any way of getting the Stage/Window object of an FXML loaded file from the associated class controller?
Particularly, I have a controller for a modal window and I need the Stage to close it.

Hi!
I have a parent FXML-file (no controller added) acting as main frame, which includes several other FXML-files. In one of those included FXML-files, I have added a controller.
So, my setup looks a bit like this...
-> Parent FXML
--> include FXML-file1 + controller attached
--> ...
--> include FXML-file5
Inside that controller, I am trying to access now the stage object in a similar approach like described here. This is when i get the null pointer exception....
public class FXMLfile1Controller {
@FXML
private Button ButtonXYZ;
@FXML
protected void ButtonXYZ_Action(ActionEvent event) {
Stage stage = (Stage)ButtonXYZ.getScene().getWindow();
stage.setIconified(true);
// this doesnt work either....
// stage.close();
Can it be, that the stage-object in the controller is not the same as the stage of the parent/main FXML?

Similar Messages

  • No method (within view controlle) to get reference to the window controller

    Hello all,
    I need to fire the exit plug of the window controller out of an embedded view.
    All help I can find in the internet tell me to "easily" get a ref to the window controller and thus to fire its plug as follows:
    data: L_REF_MAIN_WINDOW type ref to IG_MAIN_WINDOW .
    L_REF_MAIN_WINDOW =   WD_THIS->GET_MAIN_WINDOW_CTR( ).
    L_REF_MAIN_WINDOW->FIRE_MY_EXIT_PLUG_PLG(  ).
    But my view-controller dos not implement a method like
    GET_MAIN_WINDOW_CTR( )
    How can I get this method generated? What am I doing wrong?
    Thanks for your replies.
    Edited by: iSD1977 on Aug 23, 2011 4:09 PM

    Hello,
    in the Properties tab of the View Controller, add Window Controller as Used Controller.
    BR, Saravanan

  • How to find window reference from CGContextRef?

    Hi, I am a highly experienced Windows / Linux developer, but have very little OSX experience (other than using Qt), so sorry, but my question will probably sound rather silly to some of you
    Ok, so my question is this: is there some way, using either C/C++ or Objective-C, that I can find a window reference (either HIWindowRef or NSView?) from a CGContextRef?
    Since I'm probably asking the wrong question, let me explain slightly... I'm working on an NPAPI (Safari/Firefox) plugin using the Cocoa event model (https://wiki.mozilla.org/Mac:NPAPIEvent_Models#The_Cocoa_eventmodel). In that mode, the plugin only receives a CGContextRef to draw with. However, I'm trying to get Qt's Cocoa classes to draw some fairly complex widgets for me (that code is already built, and working beautifully in a standalone application), so I want to be able to associate a Qt widget with browser's window.
    Of course, there may be other ways to convince Qt to do what I want (I'm working on that angle as well), but if I could indeed get some sort of window reference from the CGContextRef, then that would get me a long way there!
    Any help / thoughts would be really appreciated!
    pc.

    Hi,
    You can directly refer to the variable as shown below, instead of FindControl.
    protected void Page_Load(object sender, EventArgs e)
    hypTest.HRef = ''http://www.example.com/'';
    When you have master page and page layouts, id will change to dynamic by adding extra as shown in the below example.
    <a href="#" id="ctl00_MainContent_hypTest">
    <img src="/Images/selbar/1.jpg" id="ctl00_MainContent_isel1" />
    </a>
    Alternate way is to add the ClientIDMode="Static", then you ID will not change.  Your solution will work 
    <a id="hypTest" ClientIDMode="Static" runat="server" href="#">
    <img src="/_layouts/15/images/picture.PNG" alt="" />
    </a>
    Please mark it as answered, if your problem resolved.

  • Stage.window Change ?

    Am I missing something? i cant get this to work anymore, I
    even have flash.display.stage and nativewindow imported.
    Worked fine in the last release. Has this been changed?
    Thanks,
    Stephan

    This is what I have in my Code:
    <mx:Image mouseDown="stage.window.startMove()" x="0"
    y="0" source="{main}" alpha="0.98"/>
    <mx:Button x="961" y="5" height="23" width="23"
    click="stage.window.close();" alpha="0.0"/>
    <mx:Button x="930" y="5" height="23" width="23"
    click="stage.window.minimize();" alpha="0.0"/>
    Im getting this as an error:
    Severity and Description Path Resource Location Creation Time
    Id
    1119: Access of possibly undefined property window through a
    reference with static type flash.display:Stage.
    Im at a loss.

  • ¿Is it possible to upgrade from SCCM 2012 a domain controller in Windows Server 2008 R2 TO 2012 R2?

    Hi all.
    I want to know if is it possible to upgrade a domain controller from Windows Server 2008 r2 to 2012 r2 installing from SCCM 2012.
    Thanks.
    Regards.

    Hi all.
    I want to know if is it possible to upgrade a domain controller from Windows Server 2008 r2 to 2012 r2 installing from SCCM 2012.
    Thanks.
    Regards.
    Anything is possible if you can script it. You could create a task sequence to do the following (with scripts):
    1. Demote 2008R2 DC to member server
    2. Remove 2008R2 member server from domain
    3. Build new 2012R2 member server and join to domain
    4. Promote 2012R2 member server to DC
    You can do this. However, why would you? Just because you can doesn't mean you should. In my opinion it's more trouble and testing than it's worth. How many times would you need to do this?
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

  • Service "No valuation class exists for account reference"

    Hi,
    in AC01 trx, I cannot create a Service.
    The error is:
    No valuation class exists for account reference
    I tried with trx OMSK to link the account category reference to material type but won't work.
    The error is always: No valuation class exists for account reference

    Hi,
    try also to check from SPRO, Materials Management, External Services Management, Service Master, "Define Service Category", you have to set the standard "Account category reference" 0006 or the one (custom) you have set in customizing also check (Valuation and Account Assignment trx OMSK)
    Regards

  • Where can i download the driver for my ethernet controller on windows 7 (macbook pro 2011)

    where can i download the driver for my ethernet controller on windows 7 (macbook pro 2011).
    after the installation of windows 7 i cant use my wlan or audio.

    http://www.apple.com/support/bootcamp/

  • Install Active Directory Domain Controller on Windows server 2008 enterprise, dont login on Sql Server 2008 R2

    I install Active Directory Domain Controller on Windows server 2008 enterprise and dont login on Sql Server 2008 R2. Before install ADDC, I have logon SQL Server 2008r2 Success, After when i install ADDC is don't logon on SQL Server 2008r2 -->not success.
    I have uninstalled ADDC but i still can't login on SQL server 2008r2.
    please help me. it  is very very disaster!
    I think is loss account SQL server 2008r2!

    Hello,
    I stronly recommend you post the detail error message to us while you try to connect to SQL Server instance, it's useful for us to do further investigation.
    Microsoft recommends that you do not install SQL Server 2008 R2 on a domain controller, there are some limitations:
    You cannot run SQL Server services on a domain controller under a local service account or a network service account.
    After SQL Server is installed on a computer, you cannot change the computer from a domain member to a domain controller. You must uninstall SQL Server before you change the host computer to a domain controller.
    After SQL Server is installed on a computer, you cannot change the computer from a domain controller to a domain member. You must uninstall SQL Server before you change the host computer to a domain member.
    SQL Server failover cluster instances are not supported where cluster nodes are domain controllers.
    SQL Server Setup cannot create security groups or provision SQL Server service accounts on a read-only domain controller. In this scenario, Setup will fail.
    On Windows Server 2003, SQL Server services can run under a domain account or a local system account.
    So, I would suggest you try to open up Windows Services list and changed the account for SQL Server service.
    Regards,
    Elvis Long
    TechNet Community Support

  • Trouble Connecting a Wireless Xbox 360 Controller to Windows 8.1 via the Play & Charge Kit

    I've been trying to connect a standard black wireless Xbox 360 controller to my PC, a Dell Inspiron 17R Special Edition (what makes it special is a mystery to me, but that's the name) with the standard Play & Charge Kit.
    I downloaded the drivers from Microsoft's website <http://www.microsoft.com/hardware/en-us/d/xbox-360-wireless-controller-for-windows>. Since there was no version for Windows 8.1, I downloaded the version for windows 7 (64-bit) and ran the installer
    in compatibility mode. The installer ran just fine, and I was able to run joy.cpl with no trouble. The trouble was, my controller doesn't show up in the list of game controllers, which is blank.
    Under Devices and Printers, an item named "Xbox 360 Wireless Controller via Play and Charge Kit" appears in the "Unspecified" category. When I look at the properties of this device, there are only two tabs, "General" and "Hardware".
    Under the "Hardware" tab, there is a device also named"Xbox 360 Wireless Controller via Play and Charge Kit" whose properties have all the proper drivers and suchlike.
    Help!

    Uninstall all the driver.
    Download and install the latest driver,or,you may try the same to get via Windows Update.
    You may post here:
    http://forums.xbox.com/
    S.Sengupta, Windows Entertainment and Connected Home MVP

  • Application Modal Stage(Window) possible in JFXPanel?

    I'm working on an app using JDK 1.7 (can't move to 8 yet) where the main view code is Swing. In one subapp I am creating a JavaFX Scene which is inside a JFXPanel. I have a JFrame which has a JPanel which has a JFXPanel which has the Scene.
    I am setting up "windows" to allow operations  which are launched off off of right click ContextMenu instances on the scene. I would like these "windows" to be modal over the JFXPanel or even the whole java app if easier.
    So far I have been creating instances of Popup and putting my nodes inside that. I then show the popup over the parent node. This works fine but the popup itself isn't really modal on the scene or app. It does stay open even if the user does other actions on the scene but it also stays open even if the user goes to another subapp which isn't fx and the JFXPanel goes out of focus.
    A couple of problems are that the main app can be moved around and the popup doesn't move with it. Also actions can still be performed on the scene while the Popup is shown. I can stop the actions by in the handlers checking if a popup is open and doing nothing if it is. Also I can hide the popup if the user switches away from the fx subapp by listening on focus events on the JFXPanel.
    Some of the actions launched from within the nodes inside the Popup require confirmation windows to the user. I have been able to get those to work and they do work modally like I expect. They are on top of the Popup window and the user can't do any actions underneath the confirmation window. The confirmation dialogs are implemented by creating a new Stage and setting it's parent to the Popup and setting the modality to Application or Window.
    Since the confirmation window behavior works as I wanted I am trying to make the content nodes of my Popups to behave the same way by putting them in a new Stage and setting the modality to Application or Window. For the parent of the new stage the only thing I can think of is to call getScene().getWindow() on the JFXPanel. This returns a Window instance (EmbeddedWindow I think) and  it seems to work ok with the initOwner() call on the new Stage.
    The new Stage shows up with my contents in it when launched from the right click ContextMenu on the stage. It does seem to be modal as I can't do any operations in the JFXPanel underneath. The problem is that if I do anything in the scene inside the JFXPanel then the 2nd stage goes to the back of focus. I set the 2nd stage to application modal. If I set the 2nd stage to window modal then the other nodes in the scene are not blocked and the 2nd stage isn't modal at all.
    I think I could accomplish what I want if I put another JFXPanel with the Popup contents in it inside of a JDialog every time but I would like to do this with JFX code only if possible.
    I guess the real question is if it's possible to have some kind of truly modal window that stays on top  of a scene inside a JFXPanel using JFX 2. Any ideas that don't involve moving to JFX 8 since that isn't possible for me?
    Thanks,
    -Darryl
    EDIT:
    I see an exception now and maybe this is the real problem. I'm not sure if it was always happening or just started.
    Error: Unsupported type of owner com.sun.javafx.tk.quantum.EmbeddedStage@ce2dc4
    Exception in runnable
    java.lang.ClassCastException: com.sun.javafx.tk.quantum.EmbeddedStage cannot be cast to com.sun.javafx.tk.quantum.WindowStage
      at com.sun.javafx.tk.quantum.WindowStage.setVisible(WindowStage.java:422)
      at javafx.stage.Window$9.invalidated(Window.java:739)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:127)
      at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:161)
      at javafx.stage.Window.setShowing(Window.java:779)
      at javafx.stage.Window.show(Window.java:794)
      at javafx.stage.Stage.show(Stage.java:229)
      at javafx.stage.Stage.showAndWait(Stage.java:395)
    Message was edited by: RDarrylR Added Exception
    Message was edited by: RDarrylR
    Changed title to be more clear

    I changed the title as I think I understand the issue better now. I don't see the exception most of the time but the real question is if I can have an application wide (not just the JavaFx part but the whole outer app) modal stage shown inside a JFXPanel? If I open a Popup inside my JFXPanel on top of the JFXPanel scene then I can have a modal stage with the Popup as the parent. When trying to open a modal stage on top of the scene from the JFXPanel, the modal stage always gets pushed to the back of focus if I click on something outside the JFXPanel.

  • Valuation class and Account Category reference

    Dear Friends.
    Please Can I know Valuation class and Account Category reference for following Material Types?
    1)     Advertisement material- what is Valuation class and Account Category reference ?
    2)     Asset Material- what is Valuation class and Account Category reference ?
    3)     Trading goods-what is Valuation class and Account Category reference ?
    4)     Engineering Material-what is Valuation class and Account Category reference ?
    regards,
    Mahesh.
    Edited by: mahesh A on Jun 8, 2011 8:17 AM
    Note : Please search forum before posting,follow forum rules.
    Edited by: Jeyakanthan A on Jun 8, 2011 11:54 AM

    Please check these answered links:
    Re: What is account category reference in Account determntn??
    changing the account category reference
    Re: account category reference
    Change of Account Category Reference
    Re: What is account category reference in Account determntn??
    Edited by: Afshad Irani on Apr 29, 2010 12:07 PM

  • Starting a class as a Windows Service??

    I�ve developed a server which has a startup class. What is the best way for me to install this class as a windows service that start up automatically at computer startup??
    please help... I�m dying here
    thanx Iceland

    You could create a BAT script that starts your Java program and then use the program SRVANY.EXE to register the BAT-file as a Service.
    SRVANY is on the Resource Kit.
    Perhaps you can use http://www.firedaemon.com/ instead.
    /rolex

  • Is anyone here fluent in the Controller Assignments window?

    I have a Mackie C4 Pro and I built a rather complex environment layer of virtual sliders (that works) for controlling parameters of an external synth not supported by the C4.
    I would like to control all the knobs in this particular environment via the C4...however, Logic's implementation of the C4's driver combined with the Controller Assignments window is cryptic to say the least. Despite reading the manual, it still makes little sense as to why things are not working.
    As it stands, the mackie C4 has about 50 modes within a particular zone, most of which are usable with the exception of 8 "user" modes.
    These 8 user modes are selectable from the C4 itself yet contain no control assignments. Attempting to create control assignments yields no effect on the C4. When I try to apply even a label to my newly attempted controller assignments, the label field resets itself to blank when I switch between modes. As well, the parameter field remains ghosted and uneditable.
    Right now all I am trying to do is assign mod wheel control to one of the v-pots under the user mode #1. So far it seems to be resisting any customization.
    here is a screen shot of my controller assignments window:
    http://dl.dropbox.com/u/10478471/controllerAssignments.png

    i did now
    its kind of ironic that there's no help available through apple's website for a rather elaborate implementation in their own software...especially when considering Apple wrote the driver for the C4

  • Looking for Case studies on SAP's Adaptive Computing Controller for Windows

    Hi,
    I have been asked to do some analysis to find out about Organizations which have successfully
    implemented SAP's Adaptive computing controller on Windows Platform.
    I am interested about any case studies that are available. I had in fact searched a lot about for
    case studies available in SAP site or elsewhere but could not locate it. (due to my poor searching skills)
    Appreciate if someone help me find out. Also request information about people who have
    successfully implemented the same.
    Best Regards,
    Raghunahth L

    I am also keen to see some documents. I guess SAP generally remains neutral about the platform and database as choice will be different for each bussiness.
    May best best place to contact for this info is Marketing department @ Microsoft as they will be much keen in collecting statistics and information from their partners who are common with SAP implementation partners.
    Krishna

  • Logic crashes on entering 'controller assignments' window

    Hi, I hope someone can help me with this. When I want to enter the controller assignments window in the preferences menu, Logic Pro 7.1 crashes, telling me it will save the song I'm working on. I want to assign controllers to use my Novation ReMOTE SL25 for controlling various Audio instruments.
    Any ideas about how to solve this?
    Thanks in advance!
    G5 dual 2.0   Mac OS X (10.4.4)  

    i did now
    its kind of ironic that there's no help available through apple's website for a rather elaborate implementation in their own software...especially when considering Apple wrote the driver for the C4

Maybe you are looking for

  • Error while loading loading a xml file using a batchxmlloader.java file

    Hi All, I am trying to to load the data of an xml to the order management and configurations tables of 11i. While doing this i am using a java program batchxmlloader.java while executing it its giving me the errors as shown below. can anyone help me

  • Saving Offline PDF form from Web-Dynpro with Dynamic File Name

    Hello All, We have a offline PDF form.... When we save the form, a default file name appears. We need to change this default name to some value that is already available in the form fields. I have gone through some posts in the forum. However not abl

  • Publish options stay grey?

    Hi, I successfully launched two sites, I have built a third that is ready to launch but the publish and visit option buttons are greyed out, the same applies for the drop down menu, I also have a blue dot next to each of the first two sites in the si

  • After restoring from backup on iCloud, my photos have been "downloading" for 2 days with no progress at all.

    After restoring from backup on iCloud, my photos have been "downloading" for 2 days with no progress at all.  Everything else seems to by fine, however. I have all my apps, contacts, even my photostream back, but my camera roll has said "downloading

  • Check lots by Business Areawise in F110

    HI Experts, I have a scenario, where i need to have a seperate Check lots for Business areawise. My Buss areas are my locations. The requirement is - i have one House Bank, one Acct Id & 10 Check lots. when i run Auto payment, system should pick the