[英]How to load an XHTML page into a dialog in primefaces only when the button is clicked?
按下按鈕時,我需要在素面的對話框中加載XHTML頁面,到目前為止,我嘗試將頁面立即加載到主要XHTML中,而我可以使用瀏覽器中的視圖源顯示該頁面,我只需要加載它即可僅在按下按鈕時。
我嘗試過的事情:
<p:commandButton value="Learn More" style="float:right;"
onclick="helpDialogVar.show(); return false;" />
<p:dialog id="basicDialog" header="Learn More"
widgetVar="helpDialogVar" height="300" width="500" resizable="false"
position="right" closable="true" closeOnEscape="true" draggable="true"
>
<ui:include src="page_to_load_inside_dialog.xhtml"
</p:dialog>
還使用iframe:
<p:commandButton value="Learn More" style="float:right;"
onclick="helpDialogVar.show(); return false;" />
<p:dialog id="basicDialog" header="Learn More"
widgetVar="helpDialogVar" height="300" width="500" resizable="false"
position="right" closable="true" closeOnEscape="true" draggable="true"
onHide="jQuery('#someId').hide();" onShow="jQuery('#someId').show();">
<h:form prependId="false">
<h:outputFormat escape="false">
<iframe frameborder="0" align="left" src="page_to_load_inside_dialog.xhtml"
name="someName" id="someId" scrolling="auto" width="750"
height="500" marginheight="5" marginwidth="10">
</iframe>
</h:outputFormat>
</h:form>
</p:dialog>
還有其他建議嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.