首页 > 解决方案 > 命令按钮在子节点中不起作用

问题描述

大家好 :) 我使用 primefaces 创建了一个树表。在其中一个表格列中,我包含了 3 个按钮。问题是按钮仅适用于第一级而不适用于第二级。有人能帮助我吗。这是我的树表代码:

<h:form>
        <p:treeTable value="#{processBean.treeNode}" var="node" ajax="true"
            selectionMode="single" rowKey="#{node.id}">

            <p:ajax event="select" listener="#{processBean.onSelect(node)}" />
            <f:facet name="header">Processes View</f:facet>

            <p:column headerText="Id">
                <p:outputLabel value="#{node.id}" />
            </p:column>
            <p:column headerText="Name">
                <p:outputLabel value="#{node.name}" />
            </p:column>
            <p:column headerText="Description">
                <p:outputLabel value="#{node.description}" />
            </p:column>
            <p:column headerText="Created date">
                <p:outputLabel value="#{node.createdDate}" />
            </p:column>
            <p:column headerText="Status">
                <p:outputLabel value="#{node.status}" />
            </p:column>
            <p:column headerText="Actions" styleClass="centered-text">
                <p:commandButton title="Start" ajax="true"
                    icon="fa fa-play Fs16 white"
                    action="#{processBean.startProcess(node)}">
                </p:commandButton>
                <p:spacer width="4%" />
                <p:commandButton title="Skip" ajax="true"
                    icon="fa fa-step-forward Fs16 White"
                    actionListener="#{processBean.skipProcess(node)}">
                </p:commandButton>
                <p:spacer width="4%" />
                <p:commandButton title="Complete" ajax="true"
                    icon="fa fa-stop Fs16 white"
                    actionListener="#{processBean.completeProcess(node)}">
                </p:commandButton>
            </p:column>

        </p:treeTable>
    </h:form>

标签: primefaces

解决方案


推荐阅读