Paginate in java ee jsf from data or files entered by the user

1

The specific query is: we are using JSF with Framework Primefaces It turns out that we need to display on the screen Paginated Data We have a list of objects and each object has a TITLE and CONTENT, that we owe show in some component ONE object per PAGE. We were looking at DataList with Pagination (PrimeFaces) that's what we need ... The inconvenience is that it shows me all the objects in the SAME PAGE

        <p:dataList id="paginacionTeorico" value="#{teoricoControlador.listaTeoricosIdTema}" var="teorico" widgetVar="teo" rows="1"  paginator="true" paginatorPosition="bottom" 
                    rowsPerPageTemplate="2,4,6" type="none" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" >


            <p:column>
                <p:panel header="#{teorico.titulo}">
                    <h:outputText value="#{teorico.contenido}"/>

                </p:panel>
            </p:column>
        </p:dataList>

    </h:form>

</div>

ManagedBean

public List<Teorico> getListaTeoricosIdTema() throws PersistenciaExcepcion {

    Map<String, String> parametro = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
    int id = Integer.parseInt(parametro.get("idTema"));

    return listaTeoricosIdTema = fachada.listarTeoricosPorId(id);
}
    
asked by Seel G 05.09.2017 в 01:35
source

1 answer

0

According to what I see of differences between your code and that of primefaces datalist , you you need styleClass="paginated" like this in the third example:

<p:dataList value="#{dataListView.cars3}" var="car" type="unordered" itemType="none" paginator="true" rows="10" styleClass="paginated"> .

    
answered by 05.09.2017 / 02:31
source