Hi Paolo I created issue https://www.canoo.com/jira/browse/UBA-6926 in our issue database for this problem. Your observation is perfectly correct: The window listener is "never" added because UIWindow.postInitialize() calls JDialog.setVisible(true) which (in case of a _modal_ dialog) creates a new event loop on top of the current one. I.e., the rest of the UIWindow.postInitialize() method is executed when the dialog is closed (a bit too late).
This issue will be fixed in 6.1.1. For the time being, please use the following workaround. Call dialog.upload() just before calling dialog.setVisible(true): dialog.upload(); dialog.setVisible(true); I hope this helps. Kind regards Rolf ************************************** Rolf Pfenninger Canoo Engineering AG Kirschgartenstrasse 7 CH-4051 Basel Tel +41 61 228 9444 Fax +41 61 228 9449 mailto:[EMAIL PROTECTED] http://www.canoo.com ULC - Rich Clients for J2EE http://www.canoo.com/ulc ************************************** > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Paolo Scaffardi > Sent: Freitag, 19. Mai 2006 12:31 > To: [email protected] > Subject: [ULC-developer] [ULC6.1] ULCDialog + setModal(true) BIG BUG?!? > > > Something strange happened when trying to close the application i ported > to ULC 6.1 using the default dialog close icon. Nothing happened! > > I discovered the problem was simple but very very strange... it happens > only i call the setModal(true) method of ULCDialog. > > Take this simple test: > > ULCDialog dialog = new ULCDialog() ; > dialog.setModal(true); > ULCButton button = new ULCButton("Close"); > button.addActionListener(new IActionListener() { > public void actionPerformed(ActionEvent actionevent) { > ApplicationContext.terminate(); > } > }); > > dialog.setDefaultCloseOperation(ULCDialog.DO_NOTHING_ON_CLOSE); > dialog.addWindowListener(new IWindowListener() { > public void windowClosing(WindowEvent arg0) { > ApplicationContext.terminate(); > } > }); > dialog.add(button); > dialog.setVisible(true); > > Using this sample you'll notice that you cannot close the dialog but > only using the ULCButton and not close icon on the dialog itself. > > Changing the second line with setModal(false) everything works but... > the dialog isnt modal anymore! > > Am i right or not? > > I traced the code on the client side and this problem seems to make > postInitialization method never return on UIDialog. This makes the > WindowListener never added to that dialog. > > Best regards, > Paolo Scaffardi > GFP Lab s.r.l. > http://www.gfplab.com > _______________________________________________ > ULC-developer mailing list > [email protected] > http://lists.canoo.com/mailman/listinfo/ulc-developer _______________________________________________ ULC-developer mailing list [email protected] http://lists.canoo.com/mailman/listinfo/ulc-developer
