2013-02-11 102 views
2

我在Lightbox iframe中有一个按钮。如何通过单击该按钮关闭该iframe?Lightbox iframe关闭

我的代码如下所示:

<p:lightBox id="posetastavkeListaLightBox" 
      widgetVar="posetastavkeListaLightBoxWidget" 
      iframe="true" width="900px" height="700px">   
</p:lightBox> 
+0

可能重复http://stackoverflow.com/questions/7874254/close-a-lightbox-primefaces -from-iframe-button) – Nix 2013-02-11 14:10:41

回答

1

通过this answerClose a lightBox primefaces from iframe Button

<p:lightBox id="light" iframe="true" width="80%" height="80%" widgetVar="dlg"> 

iframe方:

<p:commandButton value="Close" onsuccess="parent.dlg.hide();" ajax="true" process="@none" /> 
的[关闭从iframe的按钮灯箱primefaces(
+0

重新加载非常昂贵,我失去了一些数据。但类似的东西可以帮助 – 2013-02-11 14:23:24

+1

我更新了答案。当前的答案不会重新加载。 – JSuar 2013-02-11 14:24:19

+0

谢谢。这帮助了我。 – 2013-02-12 09:22:11