动态插入的素面组件未正确渲染

发布于 2024-11-18 17:59:01 字数 608 浏览 4 评论 0原文

为什么 Primefaces 组件在部分页面更新时无法正确呈现?

问题是 -

我有一个带有 ui:include 的视图 -

<ui:include src="#{navBean.viewId}.xhtml}"/>

和 p:commandButton -

<p:commandButton action="#{navBean.setViewId('page1')}" value="Load DataTable"/>

而 page1.xhtml 是我有 ap:dataTable 的地方

<ui:composition xmlns ...
    <h:head/>
        <h:form>
            <p:dataTable ...

现在,当我单击命令按钮时,会发生部分更新,并且所有内容都已加载,但数据除外表未正确呈现。

这里有人知道如何解决这个问题吗?

我浏览了 Primefaces 论坛中的一些主题,但没有任何效果。

谢谢。

Why aren't the Primefaces components rendered properly on partial page update?

The problem is -

I have a view with ui:include -

<ui:include src="#{navBean.viewId}.xhtml}"/>

and p:commandButton -

<p:commandButton action="#{navBean.setViewId('page1')}" value="Load DataTable"/>

and page1.xhtml is where I have a p:dataTable

<ui:composition xmlns ...
    <h:head/>
        <h:form>
            <p:dataTable ...

Now, when I click on the command button, partial update takes place and everything is loaded but the data table is not rendered properly.

Does anybody here know how to get around this problem?

I went through some of the topics in the Primefaces forum but they didn't do any good.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

腹黑女流氓 2024-11-25 17:59:01

解决方案很简单 -

只需包含 a

<h:head/>

如下 -

<ui:composition xmlns ...
    <h:head/>
        <h:form>
            <p:dataTable ...

现在 p:dataTable 即使在部分页面更新时也会按预期呈现。

Solution was simple -

Just include a

<h:head/>

as follows -

<ui:composition xmlns ...
    <h:head/>
        <h:form>
            <p:dataTable ...

And now the p:dataTable renders as it is supposed to even on partial page update.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文