-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi All,
I am try to change my application to work with the event thread being disabled (default in Zk 5) and need some help.
Modal windows are is most cases used in the application to edit a database record. All my modal windows have a "Save" button and a "Cancel" button. The cancel button sends an onClose event when pressed.
The "Save" button forwards the onClick event to an event handler that process the changes and save it to the database. After the data is saved to the database it calls self.detech() to close the window. The main page that invoked the modal window then needs to refresh it self. Previously (with event thread enabled) one could wait until the doModal() method exists and then do the refresh.
Using the new method, I have added forwards on the "onClose" event, but that only fires when the Close button is press. Is there an event that gets fired when the window detach? Alternatively what is the correct method to follow to handle the case when the modal window closes?
Regards
Eddie Carpenter
I solved the problem myself as follows:
All modal windows was changed to do send a "onModalExit" event as follows
Events.postEvent("onModalExit", self, null);
After a modal window was created but before calling onModal(), an addforward("onModalExit", modalWin, "onSomeHandler") was added. That handler will then do any reloading of screens etc.
Hope this helps the next person that faces this problem.
Eddie
Asked: 2010-04-21 08:19:55 +0800
Seen: 1,174 times
Last updated: May 18 '10