JSF + Primefaces update component when exchanging pagination

0
    <p:dataList paginator="true" value="{bean.lista}"
                        var="lista">
    </:dataList>

<h:outputText value="qualquerCoisa" id="teste"/>

How do I update the outputText 'test' every time the dataList page changes? , example pagination 1,2,3,4 [...] when the user changes from page 1 to page 2 update the component 'test', when to change to another page any update again? The component must be outside the dataList or dataTable and has to be when changing the pagination, without buttons or anything of the type.

    
asked by anonymous 13.07.2016 / 00:39

1 answer

1

follows an example:

<p:dataTable var="variavel" paginator="true" rows="1" value="#{myBean.list}">
  <p:ajax event="page" update="buttons" listener="#{myBean.update}" />
  ...
</p:dataTable>

Here is the method that will update your face:

public void update(PageEvent event) {
  int var = event.getPage();
  ...
  (aqui você atualiza a variavel do seu componente)
  ...
}
    
15.07.2016 / 21:00