我可以在primefaces中更改已发布的xhtml页面吗



我知道标题很奇怪,但下面是我的解释:

我有一个名为main.xhtml的主页。在main.xhtml中,包含了另一个名称为dialog.xhtml的页面。

main:

<ui:include src="../pages/dialog.xhtml"/>
<p:commandLink onclick="DialogWidget.show(); return false;"
title="dialog" />

Dialog.xhtml有一个对话框,当我点击主页中的按钮时,它会打开对话框。

当我在chrome中检查网络流量时,无论我在dialog.xhtml中做什么(比如用创建按钮打开面板),都会发布main.xhtml。这会减慢系统的速度。有没有办法在我的dialog.xhtm操作中发布dialog.xhtml?我的意思是,我可以把对话框当作main.xhtml这样的新页面吗?

您应该尝试Primefaces的Dialog Framework。它从后台bean的对话框中的xhtml页面加载内容。以下是primefaces展示中的2个链接,将帮助您入门:

基本-https://www.primefaces.org/showcase/ui/df/basic.xhtml

数据-https://www.primefaces.org/showcase/ui/df/data.xhtml