Fork me on GitHub

Is there a way to get a reference to the top level Stage in an event handler? The :on-action event contains the key :fx/event which is an ActionEvent. With this object I can sometimes get all the way to the top and get the top most Window, but in this case I have a MenuItem and don’t see a way to obtain a reference to the Stage. This is the code this is based on


I've used ext-on-instance-lifecycle in the past to catch a reference to the top level stage and store it in a promise.


I’ll look into that! Might have to do this as a workaround.


Would love to hear back if there's something simpler. Seems likely you could just navigate up the Node tree but that doesn't feel more elegant.


when looking in event, did you check both .getSource and .getTarget if it's possible to reach stage?


IIRC both source and target give me a MenuItem. From the MenuItem I don’t see a way back to reach the parent stage. I tried getParent on it and I reach the Menu which is a dead end. On mobile, excuse formatting