数据表中的更新不起作用

时间:2017-06-22 15:44:12

标签: jsf primefaces datatable

我无法更新我的数据表。命令p:commandButton update =“i_dtb2”不起作用。

这里是代码xhtml:

<h:body>
<ui:composition template="/layouts/template.xhtml">
    <ui:define name="content">

    <h3 align="center">User Access Management</h3>
        <h:form id="projAccess" enctype="multipart/form-data">

    <p:dataTable id="i_dtb2" styleClass="tableStyle" var="p" value="#{comBean.l_uSrcRes}" paginator="true" rows="5" rowsPerPageTemplate="5,10"
        paginatorPosition="bottom">

    <p:columnGroup type="header">
        <p:row>
            <p:column rowspan="2" headerText="User" />
            <p:column rowspan="2" headerText="Asset" />
            <p:column colspan="5" headerText="Roles" />
            <p:column rowspan="2" colspan="2" headerText="Action" />
        </p:row>
        <p:row>
            <p:column headerText="Project Manager Deputy"></p:column>
            <p:column headerText="Business Analyst"></p:column>
            <p:column headerText="Functional Analyst"></p:column>
            <p:column headerText="Technical Analyst"></p:column>
            <p:column headerText="Developer"></p:column>
        </p:row>
    </p:columnGroup>

        <p:column >
            <h:outputText value="#{p.usercd}" />
        </p:column>

        <p:column>
            <h:outputText value="#{p.asset}" />
        </p:column>

        <p:column>
        <p:selectBooleanCheckbox value="#{p.role02}" />
        </p:column>

        <p:column>
        <p:selectBooleanCheckbox value="#{p.role03}" />
        </p:column>

        <p:column>
        <p:selectBooleanCheckbox value="#{p.role04}" />
        </p:column>

        <p:column>
        <p:selectBooleanCheckbox value="#{p.role05}" />
        </p:column>

        <p:column>
        <p:selectBooleanCheckbox value="#{p.role06}" />
        </p:column>


        <p:column>
            <p:commandButton update="i_dtb2" action="#{ubean.m_updateAccess}"  ajax="true" icon="ui-icon-pencil">
                <f:setPropertyActionListener value="#{p}" target="#{ubean.f_selectedUser}" />
                    <f:param name="area" value="project" />
            </p:commandButton>
        </p:column>

        <p:column>
            <p:commandButton update="i_dtb2" action="#{ubean.m_deleteUser}" ajax="true" icon="ui-icon-trash">
                <f:setPropertyActionListener value="#{p}" target="#{ubean.f_selectedUser}" />
                    <f:param name="area" value="project" />
            </p:commandButton>
        </p:column>

    </p:dataTable>
        </h:form>
    </ui:define>
</ui:composition>

当我点击命令“更新”或命令“删除”时,表格不会更新。 请帮帮我。

非常感谢。

1 个答案:

答案 0 :(得分:0)

尝试添加进程=&#34; @ this&#34;到你的commandButton