PrimeFaces:<f:setpropertyactionlistener>,Treetable只能运行一次

时间:2016-08-20 22:08:20

标签: jsf primefaces managed-bean

我是Primefaces的新手,并用一个对话框显示一个简单的Treetable 我用来设置对话框数据的键值 但是,它仅适用于顶级节点,子节点不会触发set方法

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="./template.xhtml">
            <ui:define name="content">
                <h:form id="form">
                    <p:treeTable value="#{homeBean.model}" var="item" style="display: block;direction: rtl ">
                        <f:facet name="header">
                            ملخص الغياب للفصل الدراسي الحالي
                        </f:facet>
                        <p:column style="direction: rtl " headerText="التفاصيل">
                            <p:outputLabel value="#{item.title}" escape="false"/>
                        </p:column>
                        <p:column style="width:40px">
                            <p:commandLink update=":form:documentPanel" oncomplete="PF('documentDialog').show()" title="View Detail" styleClass="ui-icon ui-icon-search">
                                <f:setPropertyActionListener target="#{homeBean.key}" value="#{item.key}" />
                            </p:commandLink>
                        </p:column>
                        <p:column style="direction: rtl " headerText="إجمالي الغياب">
                            <p:outputLabel value="#{item.count}" escape="false"/>
                        </p:column>
                    </p:treeTable>
                    <p:dialog closeOnEscape="true"  id="dialog" header="التفاصيل" showEffect="fade" widgetVar="documentDialog" resizable="false">
                        <p:outputPanel id="documentPanel">
                            <p:outputLabel value="STV" />
                            <p:outputLabel value="#{homeBean.key}" />
                            <p:dataTable  value="#{homeBean.summary}" var="item2" dir="rtl" scrollable="true" scrollHeight="450">
                                <p:column headerText="م" width="20%">
                                    <p:outputLabel value="#{item2[0]}" />
                                </p:column>
                                <p:column headerText="الإسم" width="20%">
                                    <p:outputLabel value="#{item2[1]}" />
                                </p:column>
                                <p:column headerText="التاريخ" width="20%">
                                    <p:outputLabel value="#{item2[2]}" />
                                </p:column>
                            </p:dataTable>
                        </p:outputPanel>
                    </p:dialog>
                </h:form>
            </ui:define>

        </ui:composition>

    </h:body>
</html>

0 个答案:

没有答案