在p:dataTable
selectionMode="..."
中,我尝试使用Add
,View
和Edit
。在下面的代码中,我使用Add
操作,那么如何在View
中尝试Edit
和p: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>