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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Jacopo Cappellato
Hi all,

I have a problem with pagination in list forms.

The list forms use default parameters for pagination: 100 rows per page.

However, pagination doesn't really work: if you click over the "next"
link you return to the initial page (i.e. you can only see the first 100
rows).

I know that, if in the screen you set the VIEW_INDEX and VIEW_SIZE
parameters:

<set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
<set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer"
default-value="50"/>

and in the form definition you add an action tag to call the generic
"performFind" service, pagination will work (and you can also override
the default parameters, as in the above example).

However this is not a good solution for list forms without an action
element (for examples the forms that iterate over a list of elements
prepared by a bsh script).

Am I missing something? How can I make pagination work?

Thanks for your help,

Jacopo


 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

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

Hans Bakker
Hi jacopo,

i just implemented that in the new Accounting component, the only thing i had
to do was:

in the screen widget add the following lines:
                <set field="viewIndex" from-field="parameters.VIEW_INDEX"
type="Integer"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE"
type="Integer" default-value="50"/>

the the form make sure the following parameters are there:
paginate-target="/findInvoices" list-iterator-name="listIt"

about the list iterator i am not completely sure, i use it with the new
performFind service. The paginate-target should point back the the url used
to called the screen.

hope this helps...

Hans



On Thursday 15 September 2005 22:57, Jacopo Cappellato wrote:

> Hi all,
>
> I have a problem with pagination in list forms.
>
> The list forms use default parameters for pagination: 100 rows per page.
>
> However, pagination doesn't really work: if you click over the "next"
> link you return to the initial page (i.e. you can only see the first 100
> rows).
>
> I know that, if in the screen you set the VIEW_INDEX and VIEW_SIZE
> parameters:
>
> <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
> <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer"
> default-value="50"/>
>
> and in the form definition you add an action tag to call the generic
> "performFind" service, pagination will work (and you can also override
> the default parameters, as in the above example).
>
> However this is not a good solution for list forms without an action
> element (for examples the forms that iterate over a list of elements
> prepared by a bsh script).
>
> Am I missing something? How can I make pagination work?
>
> Thanks for your help,
>
> Jacopo
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users
--
Regards,
Hans Bakker
ANT Websystems Co.,Ltd (http://www.antwebsystems.com)

If you want to verify that this message really originates from
from the above person, download the public key from:
http://www.antwebsystems.com/hbakkerAntwebsystems.asc

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Jacopo Cappellato
Hi Hans,

yes, I know that it works in this way (i.e. using the performFind in the
form's action and then setting viewIndex and viewSize in the screen's
action); my problem is that I have some forms in which I cannot use the
performFind method (the list is prepared and passed to the form by bsh
script)... and for them the paginate links don't work.

Thanks for your feedback,

Jacopo


Hans Bakker wrote:

> Hi jacopo,
>
> i just implemented that in the new Accounting component, the only thing i had
> to do was:
>
> in the screen widget add the following lines:
>                 <set field="viewIndex" from-field="parameters.VIEW_INDEX"
> type="Integer"/>
>                 <set field="viewSize" from-field="parameters.VIEW_SIZE"
> type="Integer" default-value="50"/>
>
> the the form make sure the following parameters are there:
> paginate-target="/findInvoices" list-iterator-name="listIt"
>
> about the list iterator i am not completely sure, i use it with the new
> performFind service. The paginate-target should point back the the url used
> to called the screen.
>
> hope this helps...
>
> Hans
>
>
>
> On Thursday 15 September 2005 22:57, Jacopo Cappellato wrote:
>
>>Hi all,
>>
>>I have a problem with pagination in list forms.
>>
>>The list forms use default parameters for pagination: 100 rows per page.
>>
>>However, pagination doesn't really work: if you click over the "next"
>>link you return to the initial page (i.e. you can only see the first 100
>>rows).
>>
>>I know that, if in the screen you set the VIEW_INDEX and VIEW_SIZE
>>parameters:
>>
>><set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
>><set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer"
>>default-value="50"/>
>>
>>and in the form definition you add an action tag to call the generic
>>"performFind" service, pagination will work (and you can also override
>>the default parameters, as in the above example).
>>
>>However this is not a good solution for list forms without an action
>>element (for examples the forms that iterate over a list of elements
>>prepared by a bsh script).
>>
>>Am I missing something? How can I make pagination work?
>>
>>Thanks for your help,
>>
>>Jacopo
>>
>>
>>
>>_______________________________________________
>>Users mailing list
>>[hidden email]
>>http://lists.ofbiz.org/mailman/listinfo/users
>
>
>
> ------------------------------------------------------------------------
>
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users


 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

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

David E. Jones

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


On Sep 15, 2005, at 11:09 PM, Jacopo Cappellato wrote:

> Hi Hans,
>
> yes, I know that it works in this way (i.e. using the performFind  
> in the form's action and then setting viewIndex and viewSize in the  
> screen's action); my problem is that I have some forms in which I  
> cannot use the performFind method (the list is prepared and passed  
> to the form by bsh script)... and for them the paginate links don't  
> work.
>
> Thanks for your feedback,
>
> Jacopo
>
>
> Hans Bakker wrote:
>
>> Hi jacopo,
>> i just implemented that in the new Accounting component, the only  
>> thing i had to do was:
>> in the screen widget add the following lines:
>>                 <set field="viewIndex" from-
>> field="parameters.VIEW_INDEX" type="Integer"/>
>>                 <set field="viewSize" from-
>> field="parameters.VIEW_SIZE" type="Integer" default-value="50"/>
>> the the form make sure the following parameters are there:
>> paginate-target="/findInvoices" list-iterator-name="listIt"
>> about the list iterator i am not completely sure, i use it with  
>> the new performFind service. The paginate-target should point back  
>> the the url used to called the screen.
>> hope this helps...
>> Hans
>> On Thursday 15 September 2005 22:57, Jacopo Cappellato wrote:
>>
>>> Hi all,
>>>
>>> I have a problem with pagination in list forms.
>>>
>>> The list forms use default parameters for pagination: 100 rows  
>>> per page.
>>>
>>> However, pagination doesn't really work: if you click over the  
>>> "next"
>>> link you return to the initial page (i.e. you can only see the  
>>> first 100
>>> rows).
>>>
>>> I know that, if in the screen you set the VIEW_INDEX and VIEW_SIZE
>>> parameters:
>>>
>>> <set field="viewIndex" from-field="parameters.VIEW_INDEX"  
>>> type="Integer"/>
>>> <set field="viewSize" from-field="parameters.VIEW_SIZE"  
>>> type="Integer"
>>> default-value="50"/>
>>>
>>> and in the form definition you add an action tag to call the generic
>>> "performFind" service, pagination will work (and you can also  
>>> override
>>> the default parameters, as in the above example).
>>>
>>> However this is not a good solution for list forms without an action
>>> element (for examples the forms that iterate over a list of elements
>>> prepared by a bsh script).
>>>
>>> Am I missing something? How can I make pagination work?
>>>
>>> Thanks for your help,
>>>
>>> Jacopo
>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> [hidden email]
>>> http://lists.ofbiz.org/mailman/listinfo/users
>>>
>> ---------------------------------------------------------------------
>> ---
>>  _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.ofbiz.org/mailman/listinfo/users
>>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users
>

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Jacopo Cappellato
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
>
>

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

paginate.zip (496 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

David E. Jones

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
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Jacopo Cappellato
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
>> [hidden email]
>> http://lists.ofbiz.org/mailman/listinfo/users
>
>
>
> ------------------------------------------------------------------------
>
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users


 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users