Paginator shouldn't display when no records found

UI Components for JSF
ratking
Posts: 44
Joined: 15 Dec 2010, 14:27

16 Nov 2011, 18:07

Paginator shouldn't display when no records found and paginator="true" and paginatorAlwaysVisible="false".

In the current version (primefaces-3.0.M4.jar or primefaces-3.0.RC1-SNAPSHOT.jar),

Code: Select all

<p:dataTable var="car" value="#{tableBean.cars}"
                             paginator="true" rows="10"
                            paginatorAlwaysVisible="false">
The paginator don't display when p:dataTable has one record or some records and the records' count less than the value of attribute rows.
On the contrary, the paginator do display when p:dataTable has zero record, which is wrong.

As the same as paginator within p:dataList or p:dataGrid.

Submit issue #2824
http://code.google.com/p/primefaces/iss ... il?id=2824
Last edited by ratking on 28 Nov 2011, 12:35, edited 1 time in total.
GlassFish 3.1.2.2(with Weld 1.1.8 and Mojarra 2.2.4) + PrimeFaces 4.1-SNAPSHOT + Seam 3.1.0 + JPA 2.0 + NetBeans 7.4

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

17 Nov 2011, 01:49

This is definitely a nice to have, but I am using dynamic ui:include and bean methods to check if List<Object> == null, then display a page which displays "No records found", so the default p:dataTable will not be rendered. I don't do this in all cases throughout JSF web app i'm working on, but I did just start doing this, to clean up display, since I like using p:dataTable, whenever possible.

Code: Select all

    public String getViewPage(String page, List list) {
        String viewPage = null;
        if (list != null && list.size() > 0)
            viewPage = "/orders/pf_View" + page + ".xhtml";
        else
            viewPage = "/pageNoRecordsFound.xhtml";
        return viewPage;
    }
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

17 Nov 2011, 01:53

Forgot to add the following to my previous post. :)

JSF page

Code: Select all

                <p:panel header="Pricing, Payment, Order Status, Attractions, Contact Persons, Flights, Hotels, Meal Stops, Local Bus Companies" toggleable="true">
                    
                    <p:tabView>

                        <p:tab title="Pricing">

                            <ui:include src="#{pf_ordersController.getViewPage('OrderCostDetails', pf_ordersController.selected.orderCostDetails)}"/>

                        </p:tab>

                        <p:tab title="Payment">

                            <ui:include src="/orders/pf_ViewPayment.xhtml"/>

                        </p:tab>

                        <p:tab title="Order Status">

                            <ui:include src="/orders/pf_ViewStatus.xhtml"/>

                        </p:tab>

                        <p:tab title="Attractions">

                            <ui:include src="#{pf_ordersController.getViewPage('Attraction', pf_ordersController.selected.attractions)}"/>

                        </p:tab>

                        <p:tab title="Contact Persons">

                            <ui:include src="#{pf_ordersController.getViewPage('PointOfContact', pf_ordersController.selected.pointOfContacts)}"/>

                        </p:tab>

                        <p:tab title="Flights">

                            <ui:include src="#{pf_ordersController.getViewPage('Flight', pf_ordersController.selected.flights)}"/>

                        </p:tab>

                        <p:tab title="Hotels">

                            <ui:include src="#{pf_ordersController.getViewPage('Hotel', pf_ordersController.selected.hotels)}"/>

                        </p:tab>

                        <p:tab title="Meal Stops">

                            <ui:include src="#{pf_ordersController.getViewPage('MealStop', pf_ordersController.selected.mealStops)}"/>

                        </p:tab>

                        <p:tab title="Local Bus Companies">

                            <ui:include src="#{pf_ordersController.getViewPage('LocalBus', pf_ordersController.selected.localBuses)}"/>

                        </p:tab>

                    </p:tabView>

                </p:panel>

Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

ratking
Posts: 44
Joined: 15 Dec 2010, 14:27

23 Nov 2011, 03:44

@smithh032772
Your scheme is inconvenient sine p:dataTable has the attribute paginatorAlwaysVisible and emptyMessage.

My way is following:

Code: Select all

<p:dataTable id="resultTable"
                    var="car"
                    value="#{tableBean.cars}"
                    paginator="true"
                    paginatorAlwaysVisible="false"
                    emptyMessage="No Records Found"
                    rows="10"
                    paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                    rowsPerPageTemplate="10,20,50,100">
<!-- p:column... -->
</p:dataTable>
GlassFish 3.1.2.2(with Weld 1.1.8 and Mojarra 2.2.4) + PrimeFaces 4.1-SNAPSHOT + Seam 3.1.0 + JPA 2.0 + NetBeans 7.4

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

23 Nov 2011, 03:51

On the contrary, the paginator do display when p:dataTable has zero record, which is wrong.
Thanks for the recommendation. Are you still experiencing this when you set paginatorAlwaysVisible and emptyMessage, accordingly?
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

ratking
Posts: 44
Joined: 15 Dec 2010, 14:27

23 Nov 2011, 05:17

Yes, I think the issue does exist and should be resolved in the next version.

I've just submitted a screenshot to http://code.google.com/p/primefaces/iss ... il?id=2824

The following is an excerpt from the primefaces_users_guide:
paginatorAlwaysVisible -->Defines if paginator should be hidden if total data count is less than number of rows per page.
GlassFish 3.1.2.2(with Weld 1.1.8 and Mojarra 2.2.4) + PrimeFaces 4.1-SNAPSHOT + Seam 3.1.0 + JPA 2.0 + NetBeans 7.4

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

23 Nov 2011, 05:46

Okay, I saw your pic, and I just tried the paginatorAlwaysVisible="false" on a p:dataTable that has paginator="false", and that reminded me why I wrote code (as demonstrated in an earlier post of mine, above). I'm using dataTable to neatly display data, sometimes List/Collection data, or sometimes single-record data, which will only render as one row on p:dataTable, so I really have no need of paginatorAlwaysVisible="false", because I only use paginator in use cases where user is browsing data in the database tables that have large result sets. I think I have a few use cases where paginatorAlwaysVisible="false" will apply. I'll add that now to at least 2 pages that come to mind. Thanks.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

ratking
Posts: 44
Joined: 15 Dec 2010, 14:27

28 Nov 2011, 12:34

There is the correlative topic
viewtopic.php?f=3&t=16372&p=50098

There is the issue and have a solution :-)
http://code.google.com/p/primefaces/iss ... il?id=2824
GlassFish 3.1.2.2(with Weld 1.1.8 and Mojarra 2.2.4) + PrimeFaces 4.1-SNAPSHOT + Seam 3.1.0 + JPA 2.0 + NetBeans 7.4

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Nov 2011, 16:06

Fixed now!

ratking
Posts: 44
Joined: 15 Dec 2010, 14:27

29 Nov 2011, 06:21

hurrah
GlassFish 3.1.2.2(with Weld 1.1.8 and Mojarra 2.2.4) + PrimeFaces 4.1-SNAPSHOT + Seam 3.1.0 + JPA 2.0 + NetBeans 7.4

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 37 guests