cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: [cforms] Repeater and large collections
Date Tue, 07 Dec 2004 17:07:09 GMT
Reinhard Poetz wrote:
> Vadim Gritsenko wrote:
> 
>> Sylvain Wallez wrote:
>>
>>> Reinhard Poetz wrote:
>>>
>>>>
>>>> Suppose you have a repeater that is bound to a potentially very 
>>>> large collection of objects (e.g. a list with 8000 objects) provided 
>>>> by an O/R-mapper.
>>>> First, it is not a good idea to show all 8000 rows on one page. Some 
>>>> kind of paginating functionality is needed. Does anyone have a 
>>>> working "paging" solution?
>>>>
>>>> Second, I don't want to bind, let's say 10000 objects (means copying 
>>>> 10000 objects!) to a repeater, though the user should have the 
>>>> possibility to edit all rows.
>>>
>>>
>>>
>>>
>>>
>>> Not binding everything is indeed a good idea :-)
>>
>>
>>
>> Then, just don't bind what's not needed...
>>
>> <wb:repeater id="x" parent-path="."
>>   row-path="data[position() &gt;= $first and position() &lt;= $last]">
>>
>>
>> Vadim
>>
> 
> Where do $first and $last come from?
> 

You put them in in your flow.

function whatever() {
   // Create binding context, populate
   var context =
     Packages.org.apache.commons.jxpath.JXPathContext.newContext(bean);
   context.getVariables().declareVariable("first", 10);
   while (true) {
       form.load(context);
   ...
}


Vadim

Mime
View raw message