Solved

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

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
couple of eclipse 5 46
login jsp example 24 68
login form jsp example 2 37
sql import cannot be resolved jsp 3 49
New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
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.

830 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