【问题标题】:f:ajax not rendering table on included pagef:ajax 不在包含页面上呈现表格
【发布时间】:2014-11-19 00:56:55
【问题描述】:

我有一个用户表,点击一个用户名,用户表下会显示一个用户数据表。唯一有效的问题是h:commandLink 提交表单并重新加载整个页面,显示正确的数据但页面重新加载。

用户数据表位于另一个页面上,该页面来自ui:include。该页面具有基于所选用户数据集的呈现条件。这是有问题的按钮:

h:column>
        <f:facet name="header">
            <h:outputText value="Username " />
        </f:facet>
        <h:commandLink value="#{user.username}" immediate="true">
            <f:param name="username" value="#{user.username}" />
            <f:ajax
                render="-welcomePageForm-grootPageSubView-adminUserPageSubview-testSubviewUserPage-entriesTable"></f:ajax>
        </h:commandLink>
    </h:column>

如您所见,我在包含的页面上使用表的绝对路径,但这不起作用,我不知道为什么。

快速注意,这个h:column 显然在数据表中,所有这些都在f:subview 中,这并不重要。所有周围的元素都有一个 id,没有嵌套形式。而且我不知道为什么这不起作用。

如果您能帮上忙,我将不胜感激!

【问题讨论】:

    标签: ajax jsf-2


    【解决方案1】:

    使用容器 ID 的 : 前缀引用嵌套命名容器,因此 render=" " 应类似于:

    render=":welcomePageForm:grootPageSubView:adminUserPageSubview:testSubviewUserPage:entriesTable"
    

    【讨论】:

    • 通常是这样,但在 web.xml 中,我将 : 字符更改为 - 字符。在我更改字符之前,jQuery 会抛出语法错误
    猜你喜欢
    • 1970-01-01
    • 2013-11-20
    • 1970-01-01
    • 1970-01-01
    • 2019-01-28
    • 1970-01-01
    • 1970-01-01
    • 2017-11-22
    • 1970-01-01
    相关资源
    最近更新 更多