Trying the example about filtering a datable, it works very well, except instead to use the rowselect event I use a commandButton such as:
Code: Select all
<p:dataTable var="policy" value="#{policyController.allPolicies}" selection="#{policyController.selectedPolicy}" paginator="true" rows="10" >
<f:facet name="header">
List of Policy
</f:facet>
<p:column styleClass="subject">
<f:facet name="header">
<h:outputText value="Subject / Role" />
</f:facet>
<h:outputText value="#{policyController.getDataOwner(policy)}" />
</p:column>
<p:column styleClass="decision" filterBy="#{policy.decision}" filterOptions="#{policyView.decisionItems}" >
<f:facet name="header">
<h:outputText value="Decision" />
</f:facet>
<h:outputText value="#{policy.decision}" />
</p:column>
<p:column >
<f:facet name="header" >
<h:outputText value="Resource" />
</f:facet>
<h:outputText value="#{policy.resource}" />
</p:column>
<p:column headerText="Manage" styleClass="manage">
<h:panelGrid columns="3">
<p:commandButton update=":form:display" oncomplete="policyDialog.show()" image="ui-icon ui-icon-search" title="View" process="@this" >
<f:setPropertyActionListener value="#{policy}" target="#{policyController.selectedPolicy}" />
<f:setPropertyActionListener value="#{false}" target="#{policyController.editMode}" />
</p:commandButton>
<p:commandButton update=":form:display" oncomplete="policyDialog.show()" image="ui-icon ui-icon-pencil" title="Edit" process="@this">
<f:setPropertyActionListener value="#{policy}" target="#{policyController.selectedPolicy}" />
<f:setPropertyActionListener value="#{true}" target="#{policyController.editMode}" />
</p:commandButton>
<p:commandButton update=":form:display" oncomplete="confirmation.show()" image="ui-icon ui-icon-close" title="Delete" process="@this">
<f:setPropertyActionListener value="#{policy}" target="#{policyController.selectedPolicy}" />
</p:commandButton>
</h:panelGrid>
</p:column>
</p:dataTable>
kind regards,
kind regards,