Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to handle the "cancel" button and "close" icon of a popup ?

912207Sep 21 2012 — edited Sep 27 2012
Hi,

I have a popup with "cancel button" and "close icon"(on the top right corner of the popup), I want the same operations to be performed on clicking of any of these two components.

Is there a way to handle such situation ?

I read about 2 cases to look into this but they didn't work too well for me.

1. I read about the "popcancellistener" but that listener is called whenever the popup closes, so suppose I have an "ok button" on the popup to create a record, after the record is created, the popup closes and goes into the "popcancellistener", now the question is "how do we know if it came there because of the 'ok button' or 'some other event'".

2. I even checked the "DialogListener", now I'm able to distinguish between the 'OK' and 'CANCEL' button in the dialoglistener using the "Dialog.Outcome.ok/cancel", but when a user clicks on the close icon, we do not enter the "DialogListener" at all, so in this case "how do we handle the close icon click event"

Do let me know if you need any more information from my side.

Thanks for the help in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2012
Added on Sep 21 2012
8 comments
2,301 views