You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Martijn Brinkers (List)" <ma...@gmail.com> on 2008/07/03 17:43:37 UTC
T5: using the grid but not knowing the number of available rows
I have a 'query' (not a database query but a webservice query) that
possibly returns a huge number of 'records'. The query allows me to
specify the start index and the max records to return so I can use this
to only query the records shown in one grid page. The problem is that I
do not know how many records in total will be returned. I can ask for
all records to know the size but that kind of defies the paging
optimization. So, what I would like is a grid that contains something
like a "next xxx" results. Is that possible with the current T5 grid?
Thanks,
Martijn
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
[T4.1] OGNL Caching Serialization?
Posted by Aaron Kaminsky <aa...@adaptiveplanning.com>.
Hi all,
I am struggling to understand what is going on with OGNL
compilation/caching in Tapestry 4.1.3.
My first question is regarding the caching of compiled OGNL
expressions. From my reading of the code it looks like the entire
application serializes through the ExpressionCacheImpl.java lock. What
am I missing? Doesn't that mean that if I have an expression that is
very expensive to evaluate that all other hits will be blocked with that
expression is evaluated? Or is that not what the compilation does? Has
anyone else experienced any performance problems that they can trace to
this locking/serialization?
My second question has been asked before on this list, but has not been
answered (I think). Why is a given OGNL expression evaluated multiple
times in a single instance? Is there any way to turn that off or work
around it?
I have been trying to dig into the source code to figure this out, but I
think I am getting lost in the details. Can someone please explain this
or point me at the information I need?
Thanks and regards,
Aaron
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5: using the grid but not knowing the number of available rows
Posted by Martijn Brinkers <m....@gmail.com>.
But this won't allow me to step through all items because I need to get
all items I need to step over.
Martijn
On Thu, 2008-07-03 at 19:11 +0300, Andreas Andreou wrote:
> Don't know if T5 grid can natively help here, but a common trick
> is to request a few more records than what you're going to display...
>
> That way, you can be sure that there are at least a few more pages, so
> if you're showing 10 results per page, and you call the web service with
> 21 as 'max records' then (depending on the results returned)
> you'll really know if you're on the last page, the previous to the last or
> if there are more than 2 pages of results
>
> On Thu, Jul 3, 2008 at 6:43 PM, Martijn Brinkers (List)
> <ma...@gmail.com> wrote:
> > I have a 'query' (not a database query but a webservice query) that
> > possibly returns a huge number of 'records'. The query allows me to
> > specify the start index and the max records to return so I can use this
> > to only query the records shown in one grid page. The problem is that I
> > do not know how many records in total will be returned. I can ask for
> > all records to know the size but that kind of defies the paging
> > optimization. So, what I would like is a grid that contains something
> > like a "next xxx" results. Is that possible with the current T5 grid?
> >
> > Thanks,
> >
> > Martijn
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5: using the grid but not knowing the number of available rows
Posted by Andreas Andreou <an...@gmail.com>.
Don't know if T5 grid can natively help here, but a common trick
is to request a few more records than what you're going to display...
That way, you can be sure that there are at least a few more pages, so
if you're showing 10 results per page, and you call the web service with
21 as 'max records' then (depending on the results returned)
you'll really know if you're on the last page, the previous to the last or
if there are more than 2 pages of results
On Thu, Jul 3, 2008 at 6:43 PM, Martijn Brinkers (List)
<ma...@gmail.com> wrote:
> I have a 'query' (not a database query but a webservice query) that
> possibly returns a huge number of 'records'. The query allows me to
> specify the start index and the max records to return so I can use this
> to only query the records shown in one grid page. The problem is that I
> do not know how many records in total will be returned. I can ask for
> all records to know the size but that kind of defies the paging
> optimization. So, what I would like is a grid that contains something
> like a "next xxx" results. Is that possible with the current T5 grid?
>
> Thanks,
>
> Martijn
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5: using the grid but not knowing the number of available rows
Posted by Andreas Andreou <an...@gmail.com>.
It's obvious that Martijn doesn't have control of the web service and
the guys providing it
don't offer such functionality (a getRecordsCount method for instance)
hence my suggestion...
Martijn, i think i've seen in this list ppl having implemented custom
Pagers... perhaps searching
the archives will show some suggestions
On Thu, Jul 3, 2008 at 11:40 PM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> Em Thu, 03 Jul 2008 16:35:05 -0300, Martijn Brinkers (List)
> <ma...@gmail.com> escreveu:
>
>> I know about GridDataSource and have implemented that already. The
>> problem I face is that I do not know how many rows the GridDataSource
>> will return. I only know if there is more data the moment I request the
>> data.
>>
>> Would it be possible to specify MAXINT rows, remove the pager and create
>> my own pager that only contains a previous and next link?
>
> My approach is this: in the int getAvailableRows() method, I perform a query
> that only returns the number of results, without returning actual data.
> Then, in the prepare() method, I fetch the data. From here, Grid takes care
> of the rest.
>
> Thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5: using the grid but not knowing the number of available rows
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Thu, 03 Jul 2008 16:35:05 -0300, Martijn Brinkers (List)
<ma...@gmail.com> escreveu:
> I know about GridDataSource and have implemented that already. The
> problem I face is that I do not know how many rows the GridDataSource
> will return. I only know if there is more data the moment I request the
> data.
>
> Would it be possible to specify MAXINT rows, remove the pager and create
> my own pager that only contains a previous and next link?
My approach is this: in the int getAvailableRows() method, I perform a
query that only returns the number of results, without returning actual
data. Then, in the prepare() method, I fetch the data. From here, Grid
takes care of the rest.
Thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5: using the grid but not knowing the number of available rows
Posted by "Martijn Brinkers (List)" <ma...@gmail.com>.
Hi,
I know about GridDataSource and have implemented that already. The
problem I face is that I do not know how many rows the GridDataSource
will return. I only know if there is more data the moment I request the
data.
Would it be possible to specify MAXINT rows, remove the pager and create
my own pager that only contains a previous and next link?
Martijn
On Thu, 2008-07-03 at 14:58 -0300, Thiago H. de Paula Figueiredo wrote:
> Em Thu, 03 Jul 2008 12:43:37 -0300, Martijn Brinkers (List)
> <ma...@gmail.com> escreveu:
>
> > I have a 'query' (not a database query but a webservice query) that
> > possibly returns a huge number of 'records'. The query allows me to
> > specify the start index and the max records to return so I can use this
> > to only query the records shown in one grid page.
>
> Implement the GridDataSource interface
> (http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/grid/GridDataSource.html)
> and pass it to the Grid's source parameter. It has a method, void
> prepare(int startIndex, int endIndex, List<SortConstraint>
> sortConstraints), that is exactly what you're looking for.
>
> Thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5: using the grid but not knowing the number of available rows
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Thu, 03 Jul 2008 12:43:37 -0300, Martijn Brinkers (List)
<ma...@gmail.com> escreveu:
> I have a 'query' (not a database query but a webservice query) that
> possibly returns a huge number of 'records'. The query allows me to
> specify the start index and the max records to return so I can use this
> to only query the records shown in one grid page.
Implement the GridDataSource interface
(http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/grid/GridDataSource.html)
and pass it to the Grid's source parameter. It has a method, void
prepare(int startIndex, int endIndex, List<SortConstraint>
sortConstraints), that is exactly what you're looking for.
Thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org