Problem with pagination

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with pagination

Dalton Cézane
 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

RE: Problem with pagination

netwiser
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination

 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Dalton Cézane
Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

RE: Problem with pagination

netwiser
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination

Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

Problem with searchable plugin in 3 instances of the same app deployed in Tomcat

Víctor Cima Granda
In reply to this post by Dalton Cézane
I have a base app (app_server) with 3 differents configurations
  • oracle_app_server
  • mysql_app_server
  • sqlserver_app_server

The app_server use the searchable plugin and when I try to deploy in Tomcat (oracle_app_server,  mysql_app_server, sqlserver_app_server) all of them share the searchable-plugin cache.

.grails/projects/app_server/searchable-index/production

And I need something like this

.grails/projects/oracle_app_server/searchable-index/production
.grails/projects/mysql_app_server/searchable-index/production
.grails/projects/sqlserver_app_server/searchable-index/production

Can anyone help me?

Regards!

Reply | Threaded
Open this post in threaded view
|

RE: Problem with searchable plugin in 3 instances of the same app deployed in Tomcat

netwiser
Not sure this is what you need :)

http://grails.1312388.n4.nabble.com/Searchable-configuration-localCache-td1364023.html


Date: Wed, 18 Sep 2013 17:34:35 +0200
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with searchable plugin in 3 instances of the same app deployed in Tomcat

I have a base app (app_server) with 3 differents configurations
  • oracle_app_server
  • mysql_app_server
  • sqlserver_app_server
The app_server use the searchable plugin and when I try to deploy in Tomcat (oracle_app_server,  mysql_app_server, sqlserver_app_server) all of them share the searchable-plugin cache.

.grails/projects/app_server/searchable-index/production

And I need something like this

.grails/projects/oracle_app_server/searchable-index/production
.grails/projects/mysql_app_server/searchable-index/production
.grails/projects/sqlserver_app_server/searchable-index/production

Can anyone help me?

Regards!

Reply | Threaded
Open this post in threaded view
|

RE: Problem with searchable plugin in 3 instances of the same app deployed in Tomcat

netwiser
Sorry, here should be the right place to setup, overwrite the value to suit your situation:

https://svn.codehaus.org/grails-plugins/grails-searchable/trunk/src/conf/Searchable.groovy

"
 compassConnection = new File(
        "${userHome}/.grails/projects/${appName}/searchable-index/${grailsEnv}"
    ).absolutePath

"


From: [hidden email]
To: [hidden email]
Subject: RE: [grails-user] Problem with searchable plugin in 3 instances of the same app deployed in Tomcat
Date: Wed, 18 Sep 2013 11:41:45 -0400

Not sure this is what you need :)

http://grails.1312388.n4.nabble.com/Searchable-configuration-localCache-td1364023.html


Date: Wed, 18 Sep 2013 17:34:35 +0200
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with searchable plugin in 3 instances of the same app deployed in Tomcat

I have a base app (app_server) with 3 differents configurations
  • oracle_app_server
  • mysql_app_server
  • sqlserver_app_server
The app_server use the searchable plugin and when I try to deploy in Tomcat (oracle_app_server,  mysql_app_server, sqlserver_app_server) all of them share the searchable-plugin cache.

.grails/projects/app_server/searchable-index/production

And I need something like this

.grails/projects/oracle_app_server/searchable-index/production
.grails/projects/mysql_app_server/searchable-index/production
.grails/projects/sqlserver_app_server/searchable-index/production

Can anyone help me?

Regards!

Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Dalton Cézane
In reply to this post by netwiser
It still does not work. =/

def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])
[myInstanceList: myList, myInstanceTotal: myList.totalCount]   

The totalCount property does not exist. Why not use myList.size()?

Any other tip?
Thank you.


On Wed, Sep 18, 2013 at 12:21 PM, James Zhang <[hidden email]> wrote:
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination


Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Rafael Vargas Rosas
Try:

myInstanceTotal: SomeClass.CountBySomeObject(o)


On Wed, Sep 18, 2013 at 1:50 PM, Dalton Cézane <[hidden email]> wrote:
It still does not work. =/

def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])
[myInstanceList: myList, myInstanceTotal: myList.totalCount]   

The totalCount property does not exist. Why not use myList.size()?

Any other tip?
Thank you.


On Wed, Sep 18, 2013 at 12:21 PM, James Zhang <[hidden email]> wrote:
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination


Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
Rafael Vargas Rosas
Reply | Threaded
Open this post in threaded view
|

RE: Problem with pagination

netwiser
In reply to this post by Dalton Cézane
OK, use the createCriteria then

def criteria = SomeClass.createCriteria()

def myList = criteria.list(max:params.max, offset: params.offset){
    eq('someObject',o)
}

[myInstanceList: myList, myInstanceTotal: myList.totalCount]   



Or

def query = SomeClass.where {
    someObject.equals(o)
}

def myList = query.list(max:params.max, offset: params.offset)
def totalCount = query.count
[myInstanceList: myList, myInstanceTotal: totalCount]   


Date: Wed, 18 Sep 2013 15:50:33 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination

It still does not work. =/

def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])
[myInstanceList: myList, myInstanceTotal: myList.totalCount]   

The totalCount property does not exist. Why not use myList.size()?

Any other tip?
Thank you.


On Wed, Sep 18, 2013 at 12:21 PM, James Zhang <[hidden email]> wrote:
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination


Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Dalton Cézane
In reply to this post by Rafael Vargas Rosas
Hi, Rafael.

The problem is that I have a filter before: def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])

I do not want all the objects of SomeClass, just those resulting after the filter: myList. When I use myList.size() the problem is that the pagination does not appear, just the ten first records. =/


On Wed, Sep 18, 2013 at 3:54 PM, Rafael Vargas Rosas <[hidden email]> wrote:
Try:

myInstanceTotal: SomeClass.CountBySomeObject(o)


On Wed, Sep 18, 2013 at 1:50 PM, Dalton Cézane <[hidden email]> wrote:
It still does not work. =/

def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])
[myInstanceList: myList, myInstanceTotal: myList.totalCount]   

The totalCount property does not exist. Why not use myList.size()?

Any other tip?
Thank you.


On Wed, Sep 18, 2013 at 12:21 PM, James Zhang <[hidden email]> wrote:
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination


Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
Rafael Vargas Rosas



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Rafael Vargas Rosas
But if you want pagination, you need the total count, not the paginated one.

This is, if you have 50 items, total needs to be 50, not params.max (ussualy 10). CountBy will filter your objects and returns the total of items filtered.


On Wed, Sep 18, 2013 at 2:03 PM, Dalton Cézane <[hidden email]> wrote:
Hi, Rafael.

The problem is that I have a filter before: def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])

I do not want all the objects of SomeClass, just those resulting after the filter: myList. When I use myList.size() the problem is that the pagination does not appear, just the ten first records. =/


On Wed, Sep 18, 2013 at 3:54 PM, Rafael Vargas Rosas <[hidden email]> wrote:
Try:

myInstanceTotal: SomeClass.CountBySomeObject(o)


On Wed, Sep 18, 2013 at 1:50 PM, Dalton Cézane <[hidden email]> wrote:
It still does not work. =/

def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])
[myInstanceList: myList, myInstanceTotal: myList.totalCount]   

The totalCount property does not exist. Why not use myList.size()?

Any other tip?
Thank you.


On Wed, Sep 18, 2013 at 12:21 PM, James Zhang <[hidden email]> wrote:
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination


Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
Rafael Vargas Rosas



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
Rafael Vargas Rosas
Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Rafael Vargas Rosas
Sorry, its countBy, not CountBy as my original post.

Docs: http://grails.org/doc/2.2.1/ref/Domain%20Classes/countBy.html


On Wed, Sep 18, 2013 at 2:09 PM, Rafael Vargas Rosas <[hidden email]> wrote:
But if you want pagination, you need the total count, not the paginated one.

This is, if you have 50 items, total needs to be 50, not params.max (ussualy 10). CountBy will filter your objects and returns the total of items filtered.


On Wed, Sep 18, 2013 at 2:03 PM, Dalton Cézane <[hidden email]> wrote:
Hi, Rafael.

The problem is that I have a filter before: def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])

I do not want all the objects of SomeClass, just those resulting after the filter: myList. When I use myList.size() the problem is that the pagination does not appear, just the ten first records. =/


On Wed, Sep 18, 2013 at 3:54 PM, Rafael Vargas Rosas <[hidden email]> wrote:
Try:

myInstanceTotal: SomeClass.CountBySomeObject(o)


On Wed, Sep 18, 2013 at 1:50 PM, Dalton Cézane <[hidden email]> wrote:
It still does not work. =/

def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])
[myInstanceList: myList, myInstanceTotal: myList.totalCount]   

The totalCount property does not exist. Why not use myList.size()?

Any other tip?
Thank you.


On Wed, Sep 18, 2013 at 12:21 PM, James Zhang <[hidden email]> wrote:
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination


Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
Rafael Vargas Rosas



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
Rafael Vargas Rosas



--
Rafael Vargas Rosas
Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Dalton Cézane
In reply to this post by netwiser
Awesome!!

James, I already had tried with criteria, but I was using .size() and the pagination was not working. Now, using like you said, with totalCount, it worked fine!! =)

I just do not understand why size() does not work. :)

The problem now is that I have some sortable properties, but the sort is not working. Could you tell me, please, what I must to do to pass the right params in a way the sortable columns works properly?

Thank you very much!


On Wed, Sep 18, 2013 at 4:00 PM, James Zhang <[hidden email]> wrote:
OK, use the createCriteria then

def criteria = SomeClass.createCriteria()

def myList = criteria.list(max:params.max, offset: params.offset){
    eq('someObject',o)
}

[myInstanceList: myList, myInstanceTotal: myList.totalCount]   



Or

def query = SomeClass.where {
    someObject.equals(o)
}

def myList = query.list(max:params.max, offset: params.offset)
def totalCount = query.count
[myInstanceList: myList, myInstanceTotal: totalCount]   


Date: Wed, 18 Sep 2013 15:50:33 -0300

From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination

It still does not work. =/

def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])
[myInstanceList: myList, myInstanceTotal: myList.totalCount]   

The totalCount property does not exist. Why not use myList.size()?

Any other tip?
Thank you.


On Wed, Sep 18, 2013 at 12:21 PM, James Zhang <[hidden email]> wrote:
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination


Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Dalton Cézane
I found the solution here.

I just put (sort:params.sort, order:params.order) also in the criteria and now the columns are sortable.

Thanks to all that help me.
[ ]s


On Wed, Sep 18, 2013 at 4:22 PM, Dalton Cézane <[hidden email]> wrote:
Awesome!!

James, I already had tried with criteria, but I was using .size() and the pagination was not working. Now, using like you said, with totalCount, it worked fine!! =)

I just do not understand why size() does not work. :)

The problem now is that I have some sortable properties, but the sort is not working. Could you tell me, please, what I must to do to pass the right params in a way the sortable columns works properly?

Thank you very much!


On Wed, Sep 18, 2013 at 4:00 PM, James Zhang <[hidden email]> wrote:
OK, use the createCriteria then

def criteria = SomeClass.createCriteria()

def myList = criteria.list(max:params.max, offset: params.offset){
    eq('someObject',o)
}

[myInstanceList: myList, myInstanceTotal: myList.totalCount]   



Or

def query = SomeClass.where {
    someObject.equals(o)
}

def myList = query.list(max:params.max, offset: params.offset)
def totalCount = query.count
[myInstanceList: myList, myInstanceTotal: totalCount]   


Date: Wed, 18 Sep 2013 15:50:33 -0300

From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination

It still does not work. =/

def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])
[myInstanceList: myList, myInstanceTotal: myList.totalCount]   

The totalCount property does not exist. Why not use myList.size()?

Any other tip?
Thank you.


On Wed, Sep 18, 2013 at 12:21 PM, James Zhang <[hidden email]> wrote:
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination


Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

RE: Problem with pagination

netwiser
In reply to this post by Dalton Cézane
Base on the same criteria

def criteria = SomeClass.createCriteria()

def myList = criteria.list(max:params.max, offset: params.offset){
    eq('someObject',o)
    if (params.sort) { order(params.sort, params.order ?: 'asc' ) }
    // or order('YourDesignatedSortColumn', 'desc' or 'asc') 
}

[myInstanceList: myList, myInstanceTotal: myList.totalCount]   



Date: Wed, 18 Sep 2013 16:22:38 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination

Awesome!!

James, I already had tried with criteria, but I was using .size() and the pagination was not working. Now, using like you said, with totalCount, it worked fine!! =)

I just do not understand why size() does not work. :)

The problem now is that I have some sortable properties, but the sort is not working. Could you tell me, please, what I must to do to pass the right params in a way the sortable columns works properly?

Thank you very much!


On Wed, Sep 18, 2013 at 4:00 PM, James Zhang <[hidden email]> wrote:
OK, use the createCriteria then

def criteria = SomeClass.createCriteria()

def myList = criteria.list(max:params.max, offset: params.offset){
    eq('someObject',o)
}

[myInstanceList: myList, myInstanceTotal: myList.totalCount]   



Or

def query = SomeClass.where {
    someObject.equals(o)
}

def myList = query.list(max:params.max, offset: params.offset)
def totalCount = query.count
[myInstanceList: myList, myInstanceTotal: totalCount]   


Date: Wed, 18 Sep 2013 15:50:33 -0300

From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination

It still does not work. =/

def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])
[myInstanceList: myList, myInstanceTotal: myList.totalCount]   

The totalCount property does not exist. Why not use myList.size()?

Any other tip?
Thank you.


On Wed, Sep 18, 2013 at 12:21 PM, James Zhang <[hidden email]> wrote:
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination


Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

Re: Problem with searchable plugin in 3 instances of the same app deployed in Tomcat

Víctor Cima Granda
In reply to this post by netwiser
El 18/09/2013 17:45, James Zhang escribió:
Sorry, here should be the right place to setup, overwrite the value to suit your situation:

https://svn.codehaus.org/grails-plugins/grails-searchable/trunk/src/conf/Searchable.groovy

"
 compassConnection = new File(
        "${userHome}/.grails/projects/${appName}/searchable-index/${grailsEnv}"
    ).absolutePath

"


From: [hidden email]
To: [hidden email]
Subject: RE: [grails-user] Problem with searchable plugin in 3 instances of the same app deployed in Tomcat
Date: Wed, 18 Sep 2013 11:41:45 -0400

Not sure this is what you need :)

http://grails.1312388.n4.nabble.com/Searchable-configuration-localCache-td1364023.html


Date: Wed, 18 Sep 2013 17:34:35 +0200
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with searchable plugin in 3 instances of the same app deployed in Tomcat

I have a base app (app_server) with 3 differents configurations
  • oracle_app_server
  • mysql_app_server
  • sqlserver_app_server
The app_server use the searchable plugin and when I try to deploy in Tomcat (oracle_app_server,  mysql_app_server, sqlserver_app_server) all of them share the searchable-plugin cache.

.grails/projects/app_server/searchable-index/production

And I need something like this

.grails/projects/oracle_app_server/searchable-index/production
.grails/projects/mysql_app_server/searchable-index/production
.grails/projects/sqlserver_app_server/searchable-index/production

Can anyone help me?

Regards!

Oks! Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Dalton Cézane
In reply to this post by netwiser
Thanks, James.


On Wed, Sep 18, 2013 at 4:43 PM, James Zhang <[hidden email]> wrote:
Base on the same criteria


def criteria = SomeClass.createCriteria()

def myList = criteria.list(max:params.max, offset: params.offset){
    eq('someObject',o)
    if (params.sort) { order(params.sort, params.order ?: 'asc' ) }
    // or order('YourDesignatedSortColumn', 'desc' or 'asc') 
}

[myInstanceList: myList, myInstanceTotal: myList.totalCount]   



Date: Wed, 18 Sep 2013 16:22:38 -0300

From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination

Awesome!!

James, I already had tried with criteria, but I was using .size() and the pagination was not working. Now, using like you said, with totalCount, it worked fine!! =)

I just do not understand why size() does not work. :)

The problem now is that I have some sortable properties, but the sort is not working. Could you tell me, please, what I must to do to pass the right params in a way the sortable columns works properly?

Thank you very much!


On Wed, Sep 18, 2013 at 4:00 PM, James Zhang <[hidden email]> wrote:
OK, use the createCriteria then

def criteria = SomeClass.createCriteria()

def myList = criteria.list(max:params.max, offset: params.offset){
    eq('someObject',o)
}

[myInstanceList: myList, myInstanceTotal: myList.totalCount]   



Or

def query = SomeClass.where {
    someObject.equals(o)
}

def myList = query.list(max:params.max, offset: params.offset)
def totalCount = query.count
[myInstanceList: myList, myInstanceTotal: totalCount]   


Date: Wed, 18 Sep 2013 15:50:33 -0300

From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination

It still does not work. =/

def myList = SomeClass.findAllBySomeObject(o, [max:params.max, offset: params.offset])
[myInstanceList: myList, myInstanceTotal: myList.totalCount]   

The totalCount property does not exist. Why not use myList.size()?

Any other tip?
Thank you.


On Wed, Sep 18, 2013 at 12:21 PM, James Zhang <[hidden email]> wrote:
With the [max:max,offset:offset] in the findAllBy* will return a PagedResultList which has an attribute totalCount

Not too much document mentions this: I found a similar desc for it. http://jira.grails.org/browse/GRAILS-5853

--J


Date: Wed, 18 Sep 2013 11:58:34 -0300
From: [hidden email]
To: [hidden email]
Subject: Re: [grails-user] Problem with pagination


Hi, James Zhang.

Thanks for your reply. But the property totalCount does not exist in my class. And with just the first change (params.max) the pagination still does not work. Now all the records are showed at same page.

Any other help?


On Wed, Sep 18, 2013 at 11:48 AM, James Zhang <[hidden email]> wrote:
There are couple of issues here, let me try to correct them.

       params.max = Math.min(params.max ?: 10, 100)

       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.totalCount]   


--J


Date: Wed, 18 Sep 2013 11:35:25 -0300
From: [hidden email]
To: [hidden email]
Subject: [grails-user] Problem with pagination


 Hi. I am having a problem with pagination. In my controller, I have the following code:

       params.max = Math.min(max ?: 10, 100)
       SomeObject o = SomeObject.findById(myId)
       def myList = Something.findAllBySomeObject(o, [max: params.max, offset: params.offset])
       [myInstanceList: myList, myInstanceTotal: myList.size()]   


In my view, I have:
            <g:if test="${myInstanceTotal > 10}">
            <div class="pagination">
                <g:paginate total="${myInstanceTotal}" maxsteps="5" />
            </div>
            </g:if>


The problem is that the page only shows 10 results, without pagination to the other records.

Can anyone help me with this?

Thanks.

--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)



--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)
Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Ian Roberts
In reply to this post by Dalton Cézane
On 18/09/2013 20:22, Dalton Cézane wrote:
> I just do not understand why size() does not work. :)

Because size() is the size of this page of results (i.e. at most 10),
whereas what the g:paginate tag requires is the total number of results
that the query would return if you ran it without specifying any
pagination parameters.  This latter number is what .totalCount gives you.

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Problem with pagination

Dalton Cézane
Thanks for explanation, Ian.

[ ]


On Wed, Sep 18, 2013 at 7:29 PM, Ian Roberts <[hidden email]> wrote:
On 18/09/2013 20:22, Dalton Cézane wrote:
> I just do not understand why size() does not work. :)

Because size() is the size of this page of results (i.e. at most 10),
whereas what the g:paginate tag requires is the total number of results
that the query would return if you ran it without specifying any
pagination parameters.  This latter number is what .totalCount gives you.

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
=======================================================
Dalton Cézane
Mestrando/Especialista/Bacharel  em Ciência da Computação (UFCG)
Técnico em Informática (ETER)