I have two jsp pages. groups.jsp and addGroup.jsp
The addGroup JSP page is opened by clicking a button in groups.jsp and after clicking the "OK" button in addGroup.jsp, I'd like to refresh the groups.jsp. How will that be possible?
addGroup.jsp
<script type="text/javascript">
function refresh() {
//Refresh page implementation here
window.close();
}
</script>
//some code here
<table>
<tr>
<td>
<h:mandButton id="buttonOK" value="#{mon.ok}" type="button" styleClass="button" onclick="submitForm(); refresh();"/>
<td>
</tr>
</table>
//some code here
I have two jsp pages. groups.jsp and addGroup.jsp
The addGroup JSP page is opened by clicking a button in groups.jsp and after clicking the "OK" button in addGroup.jsp, I'd like to refresh the groups.jsp. How will that be possible?
addGroup.jsp
<script type="text/javascript">
function refresh() {
//Refresh page implementation here
window.close();
}
</script>
//some code here
<table>
<tr>
<td>
<h:mandButton id="buttonOK" value="#{mon.ok}" type="button" styleClass="button" onclick="submitForm(); refresh();"/>
<td>
</tr>
</table>
//some code here
Share
Improve this question
asked Mar 14, 2017 at 3:43
JuniorJunior
1475 silver badges14 bronze badges
1 Answer
Reset to default 4You can use window.opener
objRef = window.opener;
Returns a reference to the window that opened this current window.
Try this in your case:
<script type="text/javascript">
function refresh() {
//Refresh page implementation here
window.opener.location.reload();
window.close();
}
</script>
...
...