?
Solved

How to auto close a popup and refresh the parent page in JSF?

Posted on 2010-08-23
4
Medium Priority
?
1,999 Views
Last Modified: 2013-11-24
I have requirement where in the parent page a link is provided.Onclick of a link,it will open a new popup jsp and will populate required fields from the parent jsp.

From the popup,I will do some actions and using command button I will update the database with few business validations.

Now the question is if  I successfully goes through the validations I have to auto close my popup and refresh the parent JSP and if any validation failures,then popup should not be closed,parent page should not be refreshed and validations need to be displayed as a overlay on the popup jsp.

Any help in doing this is completely appreciated.

Thanks,
Sandeep
0
Comment
Question by:deepuhassan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 750 total points
ID: 33508084
return this to close and update

<script type="text/javascript">
opener.location.reload(1);
window.close();
</script>


If you get issues with this - the opener changed because you load another page, you have two possibilities

1. in main window do
<script type="text/javascript">
 window.name="parentWindow"
</script>

2. in popup do
 <script type="text/javascript">
var w = window.open('','parentPage'); // gets the handle
w.location.reload(1);
window.close();
</script>

OR

have a frameset in the popup and return

<script type="text/javascript">
top.opener.location.reload(1);
window.close();
</script>

0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 33508485
in popoup window
u can wirte this code self.close();
 
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 33508492
Same as window.close() as already posted
0
 

Author Closing Comment

by:deepuhassan
ID: 33710582
I used a part of the soln while implementing
0

Featured Post

Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

Question has a verified solution.

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

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

752 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