2017-03-14 8 views
2

私は2つのjspページを持っています。 groups.jspaddGroup.jspjspページを別のJSPページからリフレッシュするには?

前記addGroup JSPページはgroups.jspでボタンをクリックすることにより開かれ、addGroup.jspで「OK」ボタンをクリックした後、私はリフレッシュしたいのですがgroups.jsp。それはどのように可能になるでしょうか?

addGroup.jsp

<script type="text/javascript"> 
    function refresh() {       
     //Refresh page implementation here 
     window.close(); 
    } 
</script> 

//some code here 
<table> 
    <tr> 
    <td> 
    <h:commandButton id="buttonOK" value="#{common.ok}" type="button" styleClass="button" onclick="submitForm(); refresh();"/> 
    <td> 
    </tr> 
</table> 
//some code here 

答えて

1

を使用できwindow.opener

OBJREF =いるwindow.opener。

この現在のウィンドウを開いたウィンドウへの参照を返します。

あなたのケースでこれを試してみてください:

<script type="text/javascript"> 
    function refresh() {       
     //Refresh page implementation here 
     window.opener.location.reload(); 
     window.close(); 
    } 
</script> 
... 
... 
関連する問題