Cancel a close event
Is there a way to cancel the close event - ie when a user hits the back button?
I have a window, which displays a popup view in response to user input. I'd like to close the popup if it's open - otherwise close the window.
I have an event listening on the window itself - there's no close event on views.
There doesn't appear to be a property on the args passed to the event and returning true/false when you have a listener on the window doesn't appear to do anything.
5 Answers
-
I think this might be related to https://appcelerator.lighthouseapp.com/projects/32238/tickets/824-parent-events-fired-when-child-view-has-same-event-callback which appears to have made it only to the iPhone tree
-
is there any known and working workaround since that time?
-
Couple ways i could think of
1)
Open another window with opacity lower than the view, add view to the window, technically, that window blocks the background window with back button and they can't click on it without closing or respond to the pop-op view.
2) Assign null to the pop-up view first before creating one, then check if the pop-up has engaged on back button, close it if it does.
~~~ -
Aye - the first is the work-around I'm testing.
The 2nd doesn't help - I'm doing this already which works - but the close behaviour still triggers the window close. -
Humm - the work around doesn't work - unless the window is fullscreen the close event gets fired on the parent window.
It also appears that you can't open a modal window without it being fullscreen - passing {modal:true, fullscreen:false} doesn't change the behaviour.