Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with self.close()

 
Parashuram Hallur
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Experts:

My belief is that self.close() should work with any of the browsers. However, I'm facing problem with this function in Mozilla. I know that this can be used to close the pop up windows opened by the script and the pop up Im opening is with the script.

I have written the following script



The backing bean decides which function to execute based on the server side code execution. This works well with the IE and Firefox, but does not work with the Mozilla, I mean the pop up does not close only in Mozilla. The trick I have worked out is on the first load of the page the doNothing() should be called and on submitting the page the method reloadTheParentAndCloseTheChild() should be called. Parent window is getting refreshed, however the pop up does not get close and I see there are no errors listed in the javascript console too. Agian, Im facing this issue only in Mozilla. Does any one know whats the problem here and the solution.

Thanks for your time and help

Regards,
Parash
 
Parashuram Hallur
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friend:

Im desparately looking out for some pointers on this issue. Please let me know if I need to help you more to understand the problem.

I hope some one there responds

Thanks,
Parash
 
Anirvan Majumdar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried using window.close()?
 
Parashuram Hallur
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Anirvan, I have tried with the window.close() too. It does not help me.
 
Alaa Nassef
Ranch Hand
Posts: 471
Hibernate Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, what I know is that self.close() and window.close() work only in browser windows opened by a script only. You cannot do that to any normal window. It seems that this is what you are trying to do, since you are speaking about a pop-up window. both self.close() and window.close() work well with with all browsers, so this just makes me suspect that something might be wrong with opening the pop-up.

Marcos Drake once had a solution for closing firefox windows and tabs, but that doesn't work now on the newer versions of firefox.
 
Parashuram Hallur
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Alaa Naseef for the response. I'm using the script to open the pop up.

Here it is

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic