0

我正在尝试这样的事情:我有一段代码,其中显示了值列表。

<h:panelGroup id="table-wrapper">
    <p:dataTable value="#{searchBean.listUser}" var="user" rendered="#{not empty searchBean.listUser}" style="width: 10%;">
        <p:column headerText="Trigram">
            <h:outputText value="#{user.strUserid}"/>
        </p:column>
        <p:column headerText="First Name">
            <h:outputText value="#{user.strFirstname}"/>
        </p:column>
        <p:column headerText="Last Name">
            <h:outputText value="#{user.strLastname}"/>
        </p:column>
        <p:column headerText="Insert PL">
            <p:commandLink actionListener="#{searchBean.getRowDetails}" id="plValue" process="@this" title="Insert Leave">
                <h:graphicImage url="resources/images/button.png" style="height: 10px;width:10px"/>
                <f:attribute name="tri" value="#{user.strUserid}"/>
                <f:attribute name="fname" value="#{user.strFirstname}"/>
                <f:attribute name="lname" value="#{user.strLastname}"/>
            </p:commandLink>                                            
        </p:column>
    </p:dataTable>
</h:panelGroup>

在这里,actionListener单击按钮时不会触发?代码在<h:form>标签内。

使用JDK6.0 | Jboss As 7.1.1 final | JSF2.0 | PrimeFaces 3.4.2

4

1 回答 1

0

为什么不使用 Primefaces 即时行选择展示中的示例,其中选定的行显示在对话框中?如果您真的需要一个按钮,那么您可以使用命令按钮在支持 bean 中设置 selectedItem 并使用 oncomplete 以相同的方式显示对话框

http://www.primefaces.org/showcase/ui/datatableRowSelectionInstant.jsf

于 2013-06-06T09:49:35.450 回答