Focus event not firing on the original window when the modal is closed
I can't get the "Focus" event to fire on a window once the modal has been closed. What reason/s might this be happening?? I need the data on the original window to automatically update when data has been selected on the modal. How can I fix this??
Thanks in advance!!
5 Answers
-
Something like:
function my_update() { // do your stuff here } the_modal_win.addEventListener('close', function(){ my_update(); })
of course you will have to store all the data you are modifying in the modalwin to be accessible by the function my_update.
~~~ -
Can't you trigger a custom "update" event when the modal closes? ( so on the modal's clase event) ?
-
Thanks Tamas…I'm having trouble trying to update the labels on the original window with info created on the modal. Do you have an example maybe? Sorry I'm a beginner.
-
Thanks Tamas…I'm having trouble trying to update the labels on the original window with info created on the modal. Do you have an example maybe? Sorry I'm a beginner.
-
The reason this is happening is because Titanium quality control is a joke and every update adds back bugs which were 'fixed' in the previous one.
One strategy which will overcome your problem is to use the 'open' event instead of the 'focus' event (so far, Titanium still recognises an open event…).
When you close the modal window, force another open on the original window which will update your data. Instructions on how to do this from the modal 'close' event can be found in the documentation under 'Window'.
Regards, JH