在 JSF 2 中 - 尝试重新渲染 2 个 ui:repeats 之间的面板组

发布于 2024-12-11 00:47:30 字数 779 浏览 0 评论 0原文

说明我正在尝试做的事情的最佳方法就是举一个例子:

<h:form prependid="false" >
    <h:panelGroup id="layer1">
        <ui:repeat>
            <h:panelGroup id="layer2>
                <ui:repeat>
                    <h:panelGroup id="layer3">
                        <h:commandButton>
                            <f:ajax render="layer2" execute="@form" />
                        </h:commandButton>
                    </h:panelGroup>
                </ui:repeat>
            </h:panelGroup>
        </ui:repeat>
    </h:panelGroup>
</h:form>

当按下上面示例中的 h:commandButton 时,我从 JSF 得到一个异常,说 ID layer2< /代码> 不存在。

我怎样才能正确地做到这一点?

谢谢!

The best way to illustrate what i'm trying to do is just give an example:

<h:form prependid="false" >
    <h:panelGroup id="layer1">
        <ui:repeat>
            <h:panelGroup id="layer2>
                <ui:repeat>
                    <h:panelGroup id="layer3">
                        <h:commandButton>
                            <f:ajax render="layer2" execute="@form" />
                        </h:commandButton>
                    </h:panelGroup>
                </ui:repeat>
            </h:panelGroup>
        </ui:repeat>
    </h:panelGroup>
</h:form>

When pressing the h:commandButton in the example above I get an exception from JSF saying that the ID layer2 does not exists.

How can I do this correctly?

Thanks!

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

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

发布评论

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

评论(1

何处潇湘 2024-12-18 00:47:30

以下内容应该可以解决此问题:

<f:ajax render=":#{component.parent.parent.parent.parent.clientId}:layer2" execute="@form" />

它仅适用于 MyFaces,不适用于 Mojarra(目前)。它的 在很多方面都被破坏了。

The following should work out for this:

<f:ajax render=":#{component.parent.parent.parent.parent.clientId}:layer2" execute="@form" />

It works in MyFaces only, not in Mojarra (yet). Its <ui:repeat> is broken in many ways.

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