title: Primefaces datatable sorting and filtering not working until rowSelect
body: <p>I know that this question may be duplicated but i really can't find the solution for my issue; my Issue that datatable functionality like sorting and filtering not working unless i click on any row to show the details dialog after i close the dialog everything "sorting, filtering" is working normally and as expected.</p>
  
  <p>here is my code :
  Bean.java</p>
  
  <pre><code>@ViewScoped
  public class HomeBean implements Serializable {
  
      private List&lt;Ticket&gt;    filteredTickets;
      private List&lt;Ticket&gt;    tickets;
      private Ticket          selectedTicket;
      private Ticket[]        selectedTickets;
  
      public HomeBean() {
          super();
      }
  
      @PostConstruct
      public void init() {
          getData();
      }
  
      private void getData() {
          TicketFacade service;
          service = TicketFacade.getInstance();
          try {
              tickets = service.selectTickets();
          } catch (Exception e) {
              logger.error(Utilities.printStackTrace(e));
          }
      }
      // setter &amp; getters
  
      @PreDestroy
      public void finalize() {
          logger.debug("@PreDestroy");
      }
  }
  </code></pre>
  
  <p>And Here is the xhtml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt;
      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
      &lt;html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:p="http://primefaces.org/ui"
          xmlns:c="http://java.sun.com/jsp/jstl/core"&gt;
  
  &lt;f:view contentType="text/html"&gt;
      &lt;h:head&gt;
          &lt;f:facet name="first"&gt;
              &lt;meta content='text/html; charset=UTF-8' http-equiv="Content-Type" /&gt;
              &lt;title&gt;Home Page&lt;/title&gt;
          &lt;/f:facet&gt;
  
          &lt;script type="text/javascript"&gt;
              window.history.forward();
              function noBack() {
                  window.history.forward();
              }
          &lt;/script&gt;
      &lt;/h:head&gt;
  
          &lt;h:body id="body-view" onload="noBack();"
              onpageshow="if (event.persisted) noBack();" onunload=""&gt;
              &lt;f:view locale="#{userManager.locale}"&gt;
                  &lt;h:form id="Ticket"&gt;
                      &lt;p:dataTable var="ticket" value="#{homeBean.tickets}"
                          rowKey="#{ticket.id}" paginator="true" rows="15"
                          selection="#{homeBean.selectedTicket}" selectionMode="single"
                          filteredValue="#{homeBean.filteredTickets}" id="ticketsTable"
                          emptyMessage="#{lbl.noTicketsFound}"
                          style="margin-bottom:10px;margin-top:10px;"&gt;
                          &lt;p:ajax event="rowSelect" update=":Ticket:display"
                              oncomplete="ticketDialog.show()" /&gt;
  
                          &lt;f:facet name="header"&gt;#{lbl.listOfTickets}&lt;/f:facet&gt;
  
                          &lt;p:column headerText="#{lbl.tblId}" sortBy="#{ticket.id}"
                              filterBy="#{ticket.id}" id="id"&gt;
                              &lt;h:outputLink value="#{edit.xhtml?id=#{ticket.id}"&gt;#{ticket.id}&lt;/h:outputLink&gt;
  
                          &lt;/p:column&gt;
  
                          &lt;p:column headerText="#{lbl.tblTitle}" sortBy="#{ticket.title}"
                              filterBy="#{ticket.title}" id="title"&gt;   #{ticket.title}   
                                      &lt;/p:column&gt;
  
                      &lt;/p:dataTable&gt;
  
                      &lt;p:dialog header="#{lbl.moreTicketDetails}" widgetVar="ticketDialog"
                          resizable="true" width="500" showEffect="explode"
                          hideEffect="explode" closable="true" draggable="true"&gt;
  
                          &lt;h:panelGrid id="display" columns="2" cellpadding="4"
                              dir="#{lbl.dir}"&gt;
                              &lt;h:outputText for="shortDescription"
                                  value="#{lbl.shortDescription}" /&gt;
                              &lt;h:outputText id="shortDescription"
                                  value="#{homeBean.selectedTicket.shortDescription}" /&gt;
  
                              &lt;h:outputText for="callCenterList" value="#{lbl.callcenters}" /&gt;
                              &lt;h:outputText id="callCenterList"
                                  value="#{homeBean.selectedCallCenters}"&gt;
                              &lt;/h:outputText&gt;
                          &lt;/h:panelGrid&gt;
                      &lt;/p:dialog&gt;
                  &lt;/h:form&gt;
              &lt;/f:view&gt;
          &lt;/h:body&gt;
         &lt;/f:view&gt;
      &lt;/html&gt;
  </code></pre>