does not work add the <p:column selectionMode="multiple" />

UI Components for JSF
Post Reply
Alberon
Posts: 5
Joined: 31 Jan 2011, 18:04

26 Oct 2011, 14:44

I'm using version 2.2.1 primefaces

Why DataTable pagination does not work!
There's something I'm doing esquercendo?

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition template="../layouts/layoutPrincipal.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:rich="http://richfaces.ajax4jsf.org/rich"          
                xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:define name="cabecalho">
        <link href="#{appResources.css}/cabecalho.css" rel="stylesheet" type="text.css"/>
        <ui:include src="/cabecalhoex.xhtml"/>
    </ui:define>
    <ui:define name="topo"></ui:define>

    <ui:define name="conteudo">
        <h:head> </h:head>

        <h:body  style="padding-left: 5px">
            <div style="text-align: left">
                <h:form prependId="false">

                    <p:fieldset legend="MONTAGEM AVALIAÇÃO">
                        <h:panelGrid columns="2" width="100%" border=""  cellpadding="0" cellspacing="0" style=" padding-left: 10px ; padding-top: 15px">

                            <h:outputLabel style="padding-left: 10px" styleClass="menuPreto" value="Informe o Período:"/>
                            <p:column>
                                <div style="padding-right: 340px; padding-top: 5px">
                                    <p:inputText size="8" id="periodo" required="true" requiredMessage="Campo é obrigatório:" value="#{EventoQuestaoMB.eventoquestao.periodo}" immediate="true"/>
                                    &nbsp;&nbsp;<h:message for="periodo" errorStyle="color:red"/>
                                </div>
                            </p:column>

                            <h:outputLabel style="padding-left:10px" styleClass="menuPreto" value="Escolha o evento:"/>
                            <p:column>
                                <div style="padding-top: 10px">
                                    <h:selectOneListbox value="#{EventoQuestaoMB.eventoquestao.codevento}" size="1">
                                        <f:selectItems value="#{EventoQuestaoMB.listaEventos}"/>
                                    </h:selectOneListbox>
                                </div>
                            </p:column>

                        </h:panelGrid>
                        <br/>
                      
                        <p:dataTable value="#{EventoQuestaoMB.listaQuestaoMontagem}" emptyMessage="Nenhum registro encontrado."
                                     var="listaquestao" rows="10" paginator="true">
                            <f:facet name="header">
                                Questões Disponivel na Base de Dados!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                            </f:facet>
                            <p:column selectionMode="multiple" />

                            <p:column headerText="Selecione as questões para montar o questionário">
                                <h:outputText value="#{listaquestao.nome}"/>
                            </p:column>

                            <f:facet name="footer">
                                <p:commandButton value="salva" action="#{EventoQuestaoMB.create}" ajax="false" immediate="true" />
                                <p:commandButton value="Cancelar" image="ui-icon ui-icon-cancel" />
                            </f:facet>
                        </p:dataTable>
                          


                    </p:fieldset>
                </h:form>
            </div>
        </h:body>
    </ui:define>

    <ui:define name="rodape">
        <ui:include src="/rodape.xhtml"/>
    </ui:define>
</ui:composition>

foxleung
Posts: 5
Joined: 20 Oct 2011, 00:17

26 Oct 2011, 16:24

have you tried paginatorAlwaysVisible="true"? there are a couple more paginator-related attributes like paginatorTemplate in the user guide. hope it helps.
Primefaces 3.0.M3; Mojarra 2.1.2; JBoss 7.0.1+Eclipse 3.7

Alberon
Posts: 5
Joined: 31 Jan 2011, 18:04

26 Oct 2011, 18:07

Hello foxleung.
I did as you said acresentei paginatorAlwaysVisible = "true" but the paging does not work!
That is my datatable has 5 paginas.Se click on page 2 to page 2 it will but does not change the page content remains the same from page 1!
What can be??

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 39 guests