2012-05-25 108 views
0

我想在PrimeFaces庫UI組件lightBox中放置整個頁面。PrimeFaces JSF庫:lightBox內的整個頁面?

比如我有:

  • Normal_page.xhtml
  • Popup_page.xhtml

是否有可能從Normal_page.xhtml推出Popup_page.xhtml並顯示它裏面收藏夾,以便Popup_page將覆蓋Normal_page?

p.s.

我曾經做到這一點使用<p:dialog><ui:include>,像這樣:

<p:dialog widgetVar="myPopup"...> 
    <ui:include src="/Popup_page.xhtml"/> 
</p:dialog> 

<p:commandButton onclick="myPopup.show();"/> 

,但是這似乎並沒有與<p:lightBox>工作。

回答

2

這兩種方法爲我工作:

燈箱聯方法:

<p:lightBox> 
    <h:outputLink value="#"> 
     <h:outputText value="Open Lightbox Popup (using inline)"/> 
    </h:outputLink> 
    <f:facet name="inline"> 
     <ui:include src="popup_Page.xhtml"/> 
    </f:facet> 
</p:lightBox> 

燈箱iframe的方法:

<p:lightBox iframe="true">  
    <h:outputLink value="popup_Page.xhtml"> 
     <h:outputText value="Open Lightbox Popup (using iframe)"/> 
    </h:outputLink> 
</p:lightBox> 
+0

感謝。我已經嘗試了第一個,它很好。一個問題是,一些actionListener似乎不像我使用'p:dialog'時那樣引發事件。所以,它應該全部作爲'p:dialog'與功能相關,只有外觀和窗口行爲是不同的? – Danijel