Primefaces dataTable not rendered correctly after change page
14:49 28 Aug 2024

I created a notifications tray. Firstly its structure was coded using p:tabView tag and two tabs, each tab with a p:dataTable inside. When I try to change the page of one of the p:dataTable, the new page is not rendered correctly and paginator disappears. I thought that the problem was the p:tabView component and I replaced the p:tabView structure to nested h:panelGroup. In two ways problem persists.

This is the initial state of the page:

Initial state

When I press the page 2, the dataTable is rendered like this:

error page

Now, if I press the "Actualizar" button (update button), now the page 2 is rendered correctly:

page 2

I don't understand this behavior. This is the previous code using p:tabView tag:


    


    

Notificaciones

       

     

This is the current code using nested h:panelGroup:


    


    

Notificaciones

Bandeja de Entrada (#{notificacionesBean.unread})
Papelera

     
   

This is the code of "Actualizar" button (update button):

public void updateNotificacionesButton() {
    inboxMsjs = mensajesService.findMensajesBandejaEntrada(usuario.getIdUsuario(), (short) 1);
    unread = inboxMsjs.size();
    PrimeFaces.current().ajax().update("globalForm:bandejas");
}

I am using this in my project:

  • Primefaces 14.0.4
  • Payara 6.2024.5
  • OpenJDK 17.0.2
  • Jakarta 10.0

I'll appreciate any hint about what is happening. Thanks.

jsf primefaces