I populated a DataTable in a DialogBox using a ActionListener of a button in the same form. But after the data is populated the pagination and filtering do not work when populated with actionListener. My object is Serializable.
Code: Select all
<?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.prime.com.tr/ui"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<f:view contentType="text/html">
<h:head>
<title>eLease Security</title>
<style>
.ui-widget,
.ui-widget .ui-widget {
font-size: 12px !important;
}
</style>
</h:head>
<h:body styleClass="ui-widget">
<h:form id="task_form">
<p:commandButton label="Populate List" value="Populate List" update="taskList" actionListener="#{taskController.fetchTaskList}"/>
<p:dataTable var="task"
value="#{taskController.taskList}"
id="taskList"
paginator="true"
selection="#{taskController.selectedTask}"
selectionMode="single"
rows="15">
<f:facet name="header">
Task Details
</f:facet>
<p:column headerText="Lease Actions" filterBy="#{task.leaseAction}">
<h:outputText value="#{task.leaseAction}" />
</p:column>
<p:column headerText="Phase" filterBy="#{task.phase}">
<h:outputText value="#{task.phase}" />
</p:column>
<p:column headerText="Process" filterBy="#{task.process}">
<h:outputText value="#{task.process}" />
</p:column>
<p:column headerText="Task Name" filterBy="#{task.task}">
<h:outputText value="#{task.task}" />
</p:column>
<p:column headerText="Task Description">
<h:outputText value="#{task.description}" />
</p:column>
</p:dataTable>
</h:form>
</h:body>
<ui:include src="footer.xhtml"/>
</f:view>
</html>