Solved

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

Posted on 2010-08-23
4
1,852 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
  • 2
4 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 250 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
strCopies  challenge 17 87
Reason for High TTFB 1 59
java 8 lambda expresssions exception handling 3 88
Recieving large files from China 4 133
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…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now