[OFBiz] Users - Form widget: how to set pagination

Jacopo Cappellato tiz at sastau.it
Sat Sep 17 08:08:44 EDT 2005


Great, thanks,

Jacopo

David E. Jones wrote:
> 
> Hmmm... This is a good question. We probably should support  pagination 
> over a list, so I'll put this patch in.
> 
> If the query result is large this still won't work because of memory  
> constraints on the server, and it will be slow to pull the full list  
> from the database. However, if a fairly sized list (say a few hundred  
> elements) is in memory or cache, it still makes sense to page through  
> it, so I'll throw this in.
> 
> -David
> 
> 
> On Sep 16, 2005, at 12:27 AM, Jacopo Cappellato wrote:
> 
>> David,
>>
>> thanks for the tips.
>> No, in the bsh script (that is ManageQuotePrices.bsh) I get a list:
>> however, I know that, to improve performance, I should use a list  
>> iterator, not a list, and I should manage pagination in the script  
>> (i.e. when retrieving data); however it would be nice to have  
>> pagination working in forms also over a complete list...
>>
>> I did a small change to the ModelField class to manage this (see  
>> attached patch): what do you think about it?
>>
>> Jacopo
>>
>> David E. Jones wrote:
>>
>>> Jacopo,
>>> This can be done in the same way in a bsh script as in the   
>>> performFind service. Perhaps the easiest way to handle that is  look  
>>> at what it does in the FindServices.executeFind method,  which is  
>>> basically just return the EntityListIterator object. In  the form  
>>> widget you can use an EntityListIterator OR a List  object, you just  
>>> tell it which one by using different attribute  on the form element 
>>> in  the form def XML.
>>> In your bsh script are you getting an EntityListIterator?
>>> -David
>>>
>>> <paginate.zip>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ofbiz.org
>> http://lists.ofbiz.org/mailman/listinfo/users
> 
> 
> 
> ------------------------------------------------------------------------
> 
>  
> _______________________________________________
> Users mailing list
> Users at lists.ofbiz.org
> http://lists.ofbiz.org/mailman/listinfo/users




More information about the Users mailing list