p:dataTable selectionMode用于查看和编辑

时间:2016-01-15 09:30:14

标签: jsf primefaces

p:dataTable selectionMode="..."中,我尝试使用AddViewEdit。在下面的代码中,我使用Add操作,那么如何在View中尝试Editp:dataTable操作?

<p:dataTable id="checkboxDT" var="car" value="#{dtSelectionView.cars6}" selection="#{dtSelectionView.selectedCars}" rowKey="#{car.id}" style="margin-bottom:0">
        <f:facet name="header">
            Checkbox
        </f:facet>
        <p:column selectionMode="multiple" style="width:16px;text-align:center"/>
        <p:column headerText="Id">
            <h:outputText value="#{car.id}" disabled="#{dtSelectionView.fieldDisabled} />
        </p:column>
        <p:column headerText="Year">
            <h:outputText value="#{car.year}" disabled="#{dtSelectionView.fieldDisabled} />
        </p:column>
        <p:column headerText="Brand">
            <h:outputText value="#{car.brand}" disabled="#{dtSelectionView.fieldDisabled}/>
        </p:column>
        <p:column headerText="Color">
            <h:outputText value="#{car.color}" disabled="#{dtSelectionView.fieldDisabled}/>
        </p:column>
        <p:column><p:commandButton value="Edit" 
        action="#{dtSelectionView.editAction} update="checkboxDT"/></p:column>
        <f:facet name="footer">
            <p:commandButton process="checkboxDT" update=":form:multiCarDetail" icon="ui-icon-search" value="View" oncomplete="PF('multiCarDialog').show()" />
        </f:facet>
</p:dataTable>

0 个答案:

没有答案