Bug 31386

Summary: [DataGrid] Data Window
Product: Taglibs Reporter: Luca Conte <bazu>
Component: Sandbox TaglibsAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED INVALID    
Severity: enhancement    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: Other   
OS: other   

Description Luca Conte 2004-09-23 14:02:08 UTC
Hi, I'm interested in DataGrid project because I (daily) use similar approach
for data browsing in my projects. Before DataGrid I used the pager taglib:
http://jsptags.com/tags/navigation/pager/pager-taglib-2.0.html but I'm looking
for a more powerful and quick tool. 
I use the data windows concept. If a query returns a lot of (for example more
than 10000 )  database rows (objects) I'm used to executing 2 queries: the first
one is the real query with the count statement (SELECT count(*) an num FROM foo
WHERE bla=xxx) with this one I get the total number of affected rows. Whith the
second one i get only a subset of records for example the third page (using the
LIMIT statement with the same FROM and WHERE statements).
So after an Action (for example) I have a int number (the set's cardinality) and
a Collection (only the objects that need to be displayed). Actually i use the
int nuber to initialize the pager and the Collection to display data.
I'm wondering if is it possible to integrate this concept in datagrid tag, for
exaple by adding an additional attribute "count" in which set the "global"
cardinality used by the tag to render the pager... if it's setted the tag should
 not consider the size of the collection in "items" attribute and display all
object in the collection.

Sorry for my English an sorry if I post this request in a wrong place (in this
case plz tell me where).

Bye
Comment 1 Nestor Boscan 2004-09-23 20:06:08 UTC
Hi

The DataGrid tag supports the data windows concept. To do this you must send 
the data subset to the datagrid "items" attribute and set the "custom" 
attribute to "true" in the paging element:

<paging size="20" custom="true" nextUrlVar="next" previousUrlVar="previous"/>

The size defines the window size. The datagrid knows when the window has ended 
when the size of the subset data is below the window size. This is a better 
way to do it than using a count query because between the count and the subset 
query someone may have inserted a new row. 
Comment 2 Felipe Leme 2004-09-23 20:09:01 UTC
Nestor,

If this bug didn't require any change in the code, please mark it as invalid.

-- Felipe
Comment 3 Nestor Boscan 2004-09-23 20:17:34 UTC
Bug invalid
Comment 4 Nestor Boscan 2004-09-23 20:27:15 UTC
Invalid bug. No code change required.