[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How can we delay the destroying of the applet

Posted on 2001-06-11
10
Medium Priority
?
312 Views
Last Modified: 2010-03-31
I have an applet that whenever it is destroyed, a dialog  with two (Yes and No) buttons appears asking for saving. this dialog is called from within the stop() method of this applet, the problem is that while we're maipulating the applet for example and then we moved ( browsed) to another html page the save dialog appears after we moved to the next page
My question is how can we delay the destruction of the applet so that the save dialog appears before moving to the next page.
0
Comment
Question by:Amani
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 3

Expert Comment

by:exorcist
ID: 6177381
listening...
0
 

Author Comment

by:Amani
ID: 6177489
I didn't get it !!
0
 
LVL 3

Expert Comment

by:exorcist
ID: 6177501
I just said I was listening. I want to get informed if someone posts a comment since this is an interesting question. Sorry for the misunderstanding.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Expert Comment

by:jimsims
ID: 6178243
the stop/destroy method will be called when you leave the page the applet is on. Not sure what you question is, exactly.  Delaying the destroy doesnt make sense in the context of your questions - sounds like you want to force teh destroy to happen earlier - BEFORE you go to the next page.  Sorry, that's implementation-dependent.....
0
 
LVL 92

Expert Comment

by:objects
ID: 6179530
Firstly the stop() method is not responsible for destroying an applet, that's what the destroy() method is for.
The stop() method is called every time you leave the page, as you are experiencing, and does not destroy the applet.
If you want the dialog to popup before the applet is destroyed then put it in the destroy() method. Though I don't think this is what you want either.

0
 

Author Comment

by:Amani
ID: 6180264
Ok, I'll re clarify the question
The user loads the applet (the applet loads an image and allows the user to add different annotations on it and save these annotations), he add some annotations and he didn't save his work, then he switch to another page that load the same applet of the same image, what is supposed to be seen is a save dialog asking for saving the annotations befor the next page is loaded so that when the user select yes (save) and then the next page appears,the saved annotations appears on the next page( since both pages having the same image then any changes done on the image in the first page must be laoded with the image in the next page) . what the applet does is that it calls the saveDialog from it's stop() method asking for saving the added annotations. the problem is that this save dialog appears after loading the next page so the image in the next page will appear without the changes done on it in the first page since the changes were not saved yet( the next page is loaded before the save dialog appeared) . How can we make the save dialog appears before moving to the next page?
0
 
LVL 92

Accepted Solution

by:
objects earned 800 total points
ID: 6180304
You can't, there is no guarantee about when stop() is going to be called except that it's after the page is left.
And you'll probably find the behaviour varies between browsers.
One solution would be to use a servlet to have the second applet delay it's startup until the first one notifies the servlet that the files saved (still popping up your save dialog in the stop() method.

0
 
LVL 8

Expert Comment

by:DennisBorg
ID: 6181378
How about an approach which simply automatically saves the changes to the image to a temporary file, perhaps as the changes occur.

You can then bring up Save Dialog, and if the user answers 'Yes', you can then replace the image with the temp file. If the user answers 'No', then simply discard the temp file.
0
 

Author Comment

by:Amani
ID: 6185637
Thanks for u all for ur suggestions, i'll try it and update u
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9027481
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[points to objects]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month19 days, 18 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question