Solved

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

Posted on 2010-08-23
4
1,817 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
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.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

747 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

11 Experts available now in Live!

Get 1:1 Help Now