Re: [Wicket-user] DataView (extentions)

2006-07-12 Thread Frank Silbermann



Several months ago I mentioned that I was developing 
classes based on WicketExtensions' DataTable and SortableDataProvider to display 
arbitrary SQL SELECT result sets, with arbitrary sorting capability 
built-in.

My approachis only appropriate for small result 
sets or for prototyping, as theResultSet's datais kept in the data 
provider between page renderings:

  
  The developer overrides the method that generates the 
  SQL query string. If the generated text varies from one postback to the 
  next (or if an event sets a special flag), the data is replaced by a new query 
  to the database. 
  
  A general routine handles sorting events 
  (column-header clicks) by delegating to column type's default comparator and 
  the built-in ArrayList sorting capability. 
  
  A hook isprovidedwhere thedeveloper 
  canspecify massaging of the databetween download and presentation, 
  e.g.to compute and adda summary row, to insert additional computed 
  columns, or toreplace date or number objectsby formatted strings 
  (to bypass DataTable's default rendering of these 
  objects).
(Perhaps someone can adapt some of my ideas to a more 
general solution that doesn't keep result-set data in the DataProvider between 
postbacks.)

My 
implementationconsists of just a few hundred lines of code infour 
classes,two of which are trivial javabeans. A few readers of this 
group expressed interest; what would be the easiest way of sharing? I 
suppose I could build a tiny jar file and attach it to an e-mail, but it might 
be easier to discuss the implementation if I send a few e-mails, each directly 
containing the source code for one or two classes. Would that be an 
appropriate use of this mailing list?



From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Vincent 
JenksSent: Wednesday, March 15, 2006 9:29 AMTo: 
wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] DataView 
(extentions)
I'd love to see this (along w/ an example or two on usage) ;)
On 3/15/06, Frank 
Silbermann [EMAIL PROTECTED]  
wrote:

  
  
  I have come up with 
  my own subclass of DataTable and implementation of IDataProvider to display 
  any arbitrary database java.sql.ResultSet. The basic idea 
  is that my IDataProvider implementation contains a List of rows, each row 
  consisting of a List of Object. Also in the implementation 
  is an array of descriptors, one per column, each of which contains the column 
  name and an indicator as to whether I want to be able to sort on that 
  column. (The column name comes from the ResultSetMetadata; 
  a method is provided to set the sortability flag.) My 
  implementation of the abstract method to deliver a sequence of rows will 
  delegate to the List.sublist() command from the Java Collections API, and each 
  time the DataTable delivers a sort criteria I apply the Collections.sort() 
  method to my list of rows, passing it a Comparator that delegates to the 
  Comparator of the Object at the relevant column index. My 
  implementation of IDataProvider can also look at my array of column 
  descriptors and generate a list of IColumn objects (needed to construct the 
  DataTable).
  It's actually a bit 
  more complicated than that, because sometimes the user needs to add one or more 
  summaryrows or add computed 
  columns.
  The code is actually 
  quite compact; when I'm finished I'll post it to the list if there is any 
  interest.
  
  
  
  -Original 
  Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Igor VaynbergSent: Tuesday, March 14, 
  2006 5:21 
  PMTo: wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] DataView 
  (extentions)
  
  there is also a 
  DataTable component which wraps 
  DataView+paging+sorting.-Igor
  
  On 3/14/06, Vincent 
  Jenks  
  [EMAIL PROTECTED] wrote:
  I'm using 1.1.1 Are there any plans to whittle 
  down the amount of code it takes to implement paging  sorting? Has 
  it changed at all in 1.2? I spent a lot of time w/ ASP.NET (which wicket feels quite similar to) and there's a 
  DataGrid component that has properties to set paging  sorting w/o any 
  extra work. Something like that would be really convenient. 
  
  

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataView (extentions)

2006-07-12 Thread Martijn Dashorst
Why don't you create a wiki article on this subject?

Martijn


On 7/12/06, Frank Silbermann [EMAIL PROTECTED] wrote:


 Several months ago I mentioned that I was developing classes based on
 WicketExtensions' DataTable and SortableDataProvider to display arbitrary
 SQL SELECT result sets, with arbitrary sorting capability built-in.

 My approach is only appropriate for small result sets or for prototyping, as
 the ResultSet's data is kept in the data provider between page renderings:


 The developer overrides the method that generates the SQL query string.  If
 the generated text varies from one postback to the next (or if an event sets
 a special flag), the data is replaced by a new query to the database.

 A general routine handles sorting events (column-header clicks) by
 delegating to column type's default comparator and the built-in ArrayList
 sorting capability.

 A hook is provided where the developer can specify massaging of the
 data between download and presentation, e.g. to compute and add a summary
 row, to insert additional computed columns, or to replace date or number
 objects by formatted strings (to bypass DataTable's default rendering of
 these objects).
 (Perhaps someone can adapt some of my ideas to a more general solution that
 doesn't keep result-set data in the DataProvider between postbacks.)

 My implementation consists of just a few hundred lines of code in four
 classes, two of which are trivial javabeans.  A few readers of this group
 expressed interest; what would be the easiest way of sharing?  I suppose I
 could build a tiny jar file and attach it to an e-mail, but it might be
 easier to discuss the implementation if I send a few e-mails, each directly
 containing the source code for one or two classes.  Would that be an
 appropriate use of this mailing list?

  
  From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf
 Of Vincent Jenks
 Sent: Wednesday, March 15, 2006 9:29 AM

 To: wicket-user@lists.sourceforge.net
 Subject: Re: [Wicket-user] DataView (extentions)


 I'd love to see this (along w/ an example or two on usage) ;)



 On 3/15/06, Frank Silbermann [EMAIL PROTECTED]  wrote:
 
 
 
 
 
  I have come up with my own subclass of DataTable and implementation of
 IDataProvider to display any arbitrary database java.sql.ResultSet.  The
 basic idea is that my IDataProvider implementation contains a List of rows,
 each row consisting of a List of Object.  Also in the implementation is an
 array of descriptors, one per column, each of which contains the column name
 and an indicator as to whether I want to be able to sort on that column.
 (The column name comes from the ResultSetMetadata; a method is provided to
 set the sortability flag.)  My implementation of the abstract method to
 deliver a sequence of rows will delegate to the List.sublist() command from
 the Java Collections API, and each time the DataTable delivers a sort
 criteria I apply the Collections.sort() method to my list of rows, passing
 it a Comparator that delegates to the Comparator of the Object at the
 relevant column index.  My implementation of IDataProvider can also look at
 my array of column descriptors and generate a list of IColumn objects
 (needed to construct the DataTable).
 
 
  It's actually a bit more complicated than that, because  sometimes the
 user needs to add one or more summary rows or add computed columns.
 
 
  The code is actually quite compact; when I'm finished I'll post it to the
 list if there is any interest.
 
 
 
 
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf
 Of Igor Vaynberg
  Sent: Tuesday, March 14, 2006 5:21 PM
  To: wicket-user@lists.sourceforge.net
  Subject: Re: [Wicket-user] DataView (extentions)
 
 
 
  there is also a DataTable component which wraps DataView+paging+sorting.
 
  -Igor
 
 
 
 
  On 3/14/06, Vincent Jenks  [EMAIL PROTECTED] wrote:
 
  I'm using 1.1.1  Are there any plans to whittle down the amount of code it
 takes to implement paging  sorting?  Has it changed at all in 1.2?  I spent
 a lot of time w/ ASP.NET (which wicket feels quite similar to) and there's a
 DataGrid component that has properties to set paging  sorting w/o any extra
 work.  Something like that would be really convenient.
 
 


 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job
 easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642


 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user





-- 
Download Wicket 1.2 now! Write Ajax applications without touching JavaScript!
-- http://wicketframework.org

Re: [Wicket-user] DataView (extentions)

2006-07-12 Thread Frank Silbermann
I suppose it could go into: 

Wicket Wiki
// Reference Library 
 How To Do Things in Wicket
// Database Interaction 

-- though it would be much longer than any of the other articles (aside
from those which are external links).  Also, how would I create the new
page into which I could enter my text?  (Would I have to submit my words
and code as HTML?  Embarassing to say, but I don't have much experience
with this, or with Wikis ...)


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martijn
Dashorst
Sent: Wednesday, July 12, 2006 11:20 AM
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] DataView (extentions)

Why don't you create a wiki article on this subject?

Martijn


On 7/12/06, Frank Silbermann [EMAIL PROTECTED] wrote:


 Several months ago I mentioned that I was developing classes based on 
 WicketExtensions' DataTable and SortableDataProvider to display 
 arbitrary SQL SELECT result sets, with arbitrary sorting capability
built-in.

 My approach is only appropriate for small result sets or for 
 prototyping, as the ResultSet's data is kept in the data provider
between page renderings:


 The developer overrides the method that generates the SQL query 
 string.  If the generated text varies from one postback to the next 
 (or if an event sets a special flag), the data is replaced by a new
query to the database.

 A general routine handles sorting events (column-header clicks) by 
 delegating to column type's default comparator and the built-in 
 ArrayList sorting capability.

 A hook is provided where the developer can specify massaging of the 
 data between download and presentation, e.g. to compute and add a 
 summary row, to insert additional computed columns, or to replace date

 or number objects by formatted strings (to bypass DataTable's default 
 rendering of these objects).
 (Perhaps someone can adapt some of my ideas to a more general solution

 that doesn't keep result-set data in the DataProvider between 
 postbacks.)

 My implementation consists of just a few hundred lines of code in four

 classes, two of which are trivial javabeans.  A few readers of this 
 group expressed interest; what would be the easiest way of sharing?  I

 suppose I could build a tiny jar file and attach it to an e-mail, but 
 it might be easier to discuss the implementation if I send a few 
 e-mails, each directly containing the source code for one or two 
 classes.  Would that be an appropriate use of this mailing list?

  
  From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Vincent 
 Jenks
 Sent: Wednesday, March 15, 2006 9:29 AM

 To: wicket-user@lists.sourceforge.net
 Subject: Re: [Wicket-user] DataView (extentions)


 I'd love to see this (along w/ an example or two on usage) ;)



 On 3/15/06, Frank Silbermann [EMAIL PROTECTED]  wrote:
 
 
 
 
 
  I have come up with my own subclass of DataTable and implementation 
  of
 IDataProvider to display any arbitrary database java.sql.ResultSet.  
 The basic idea is that my IDataProvider implementation contains a List

 of rows, each row consisting of a List of Object.  Also in the 
 implementation is an array of descriptors, one per column, each of 
 which contains the column name and an indicator as to whether I want
to be able to sort on that column.
 (The column name comes from the ResultSetMetadata; a method is 
 provided to set the sortability flag.)  My implementation of the 
 abstract method to deliver a sequence of rows will delegate to the 
 List.sublist() command from the Java Collections API, and each time 
 the DataTable delivers a sort criteria I apply the Collections.sort() 
 method to my list of rows, passing it a Comparator that delegates to 
 the Comparator of the Object at the relevant column index.  My 
 implementation of IDataProvider can also look at my array of column 
 descriptors and generate a list of IColumn objects (needed to
construct the DataTable).
 
 
  It's actually a bit more complicated than that, because  sometimes 
  the
 user needs to add one or more summary rows or add computed columns.
 
 
  The code is actually quite compact; when I'm finished I'll post it 
  to the
 list if there is any interest.
 
 
 
 
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Igor 
 Vaynberg
  Sent: Tuesday, March 14, 2006 5:21 PM
  To: wicket-user@lists.sourceforge.net
  Subject: Re: [Wicket-user] DataView (extentions)
 
 
 
  there is also a DataTable component which wraps
DataView+paging+sorting.
 
  -Igor
 
 
 
 
  On 3/14/06, Vincent Jenks  [EMAIL PROTECTED] wrote:
 
  I'm using 1.1.1  Are there any plans to whittle down the amount of 
  code it
 takes to implement paging  sorting?  Has it changed at all in 1.2?  I

 spent a lot of time w/ ASP.NET (which wicket feels quite similar to) 
 and there's a DataGrid component that has properties to set paging  
 sorting w/o any extra

Re: [Wicket-user] DataView (extentions)

2006-07-12 Thread Michael Welter
Hello Frank,

I have just begun developing an application using paged tables and 
IDataProvider.  My environment is hibernate with thousands of items to 
display, so hopefully the laze instantiation will keep memory 
utilization low.

Anyhow, I would like to take a peek at your code.   If you don't mind, 
just tar the directory and attach to a personal email.

Thanks,
Mike

Frank Silbermann wrote:
 Several months ago I mentioned that I was developing classes based on 
 WicketExtensions' DataTable and SortableDataProvider to display 
 arbitrary SQL SELECT result sets, with arbitrary sorting capability 
 built-in.  
  
 My approach is only appropriate for small result sets or for 
 prototyping, as the ResultSet's data is kept in the data provider 
 between page renderings:
 
 *
   The developer overrides the method that generates the SQL query
   string.  If the generated text varies from one postback to the
   next (or if an event sets a special flag), the data is replaced by
   a new query to the database. 
 *
   A general routine handles sorting events (column-header clicks) by
   delegating to column type's default comparator and the built-in
   ArrayList sorting capability. 
 *
   A hook is provided where the developer can specify massaging of
   the data between download and presentation, e.g. to compute and
   add a summary row, to insert additional computed columns, or
   to replace date or number objects by formatted strings (to bypass
   DataTable's default rendering of these objects). 
 
 (Perhaps someone can adapt some of my ideas to a more general solution 
 that doesn't keep result-set data in the DataProvider between postbacks.) 
  
 My implementation consists of just a few hundred lines of code in four 
 classes, two of which are trivial javabeans.  A few readers of this 
 group expressed interest; what would be the easiest way of sharing?  I 
 suppose I could build a tiny jar file and attach it to an e-mail, but it 
 might be easier to discuss the implementation if I send a few e-mails, 
 each directly containing the source code for one or two classes.  Would 
 that be an appropriate use of this mailing list?
  



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataView (extentions)

2006-07-12 Thread Gwyn Evans
On 12/07/06, Frank Silbermann [EMAIL PROTECTED] wrote:
 I suppose it could go into:

 Wicket Wiki
 // Reference Library
  How To Do Things in Wicket
 // Database Interaction

 -- though it would be much longer than any of the other articles (aside
 from those which are external links).  Also, how would I create the new
 page into which I could enter my text?  (Would I have to submit my words
 and code as HTML?  Embarassing to say, but I don't have much experience
 with this, or with Wikis ...)

Not a problem!  You'll need to create yourself an account on the wiki
if you've not done so already (top right of any wiki page), then use
either the Edit link at the top of the page or the [Edit] link at
the top-right of the section to go to edit mode, e.g. the Database
Interaction section of the Reference Library page.  Create a link
by adding a line such as

  * [[Reading from a Database|How to read from a database]]

which is a bulleted item (the   *) which links to the Reading from
a Database page (although the link text itself is How to read from a
database).  Names such as
  * [[DataView Notes]]
are fine, though.

One you save the page, you'll have a link while will take you to an
edit page to create your new page.  See
http://www.wicket-wiki.org.uk/wiki/index.php/Help:Editing for help on
editing, but don't worry about how long it is - you can always go back
and split it into multiple pages later on if you want.

A very short guide is:

== Header One ==
=== Header Two ===
 Header Three 
* Bullet list
** Bullet sub-list
# Numbered list
## Numbered sub-list
[[wikilink|linklabel]]
[externallink linklabel]
''Emphasize'', '''strongly'''. (italic  bold)
tttypewriter/tt
Use pre and /pre to surround code blocks - leading   s will do
it but then the block stops at the first empty line, so don't indent
normal text...

/Gwyn


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


RE: [Wicket-user] DataView (extentions)

2006-03-15 Thread Frank Silbermann








The DataTable in Wicket Extensions 1.1
handles paging and sorting, but you must build a custom IDataProvider that accumulates
the sorting instructions from the DataTable and provides sorted subsets of the
data when requested by the DataTable (which handles the actual paging display).



DataTable and supporting classes have been
greatly refactored in Wicket Extensions 1.2 to give the user much more
flexibility in the set of features desired. The API changes will break Wicket 1.1
programs, so if you need to subclass anything to modify its behavior, I would
suggest going to Wicket 1.2 now. Otherwise, you can upgrade fairly easily
at any time by replacing Wicket 1.1 DataTable with Wicket 1.2
DefaultDataTable. Wicket 1.2
DataTable is more flexible but less complete; DefaultDataTable subclasses it to
provide defaults which make it behave like the Wicket 1.1 DataTable.



I have come up with my own subclass of
DataTable and implementation of IDataProvider to display any arbitrary database
java.sql.ResultSet. The basic idea
is that my IDataProvider implementation contains a List of rows, each row
consisting of a List of Object.
Also in the implementation is an array of descriptors, one per column, each
of which contains the column name and an indicator as to whether I want to be
able to sort on that column. (The
column name comes from the ResultSetMetadata; a method is provided to set the
sortability flag.) My implementation
of the abstract method to deliver a sequence of rows will delegate to the List.sublist()
command from the Java Collections API, and each time the DataTable delivers a
sort criteria I apply the Collections.sort() method to my list of rows, passing
it a Comparator that delegates to the Comparator of the Object at the relevant
column index. My implementation of
IDataProvider can also look at my array of column descriptors and generate a
list of IColumn objects (needed to construct the DataTable).



Its actually a bit more complicated
than that (and a work in progress), because I have complicated the above
mechanisms to deal with the possibility of a summary row at the end, and when
rows are requested, the query string will be recalculated based on form data --
and if it has changed since the last request then the data will be refreshed
from the database and the current page set back to 1.



The code is actually quite compact; when Im
finished Ill post it to the list if there is any interest.





-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Igor Vaynberg
Sent: Tuesday, March 14, 2006 5:21 PM
To:
wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user]
DataView (extentions)



there is also a DataTable component which wraps
DataView+paging+sorting.

-Igor





On 3/14/06, Vincent Jenks  [EMAIL PROTECTED] wrote:

I'm using 1.1.1 Are there any plans to whittle
down the amount of code it takes to implement paging  sorting? Has
it changed at all in 1.2? I spent a lot of time w/ ASP.NET (which
wicket feels quite similar to) and there's a DataGrid component that has
properties to set paging  sorting w/o any extra work. Something like
that would be really convenient. 







On 3/14/06, Igor Vaynberg  [EMAIL PROTECTED]
wrote:

are you using 1.1 ? or 1.2 ?
there used to be a constructor that took model in 1.1 i think. the model object
must be of type IDataProvider.





-Igor





On 3/14/06, Vincent Jenks [EMAIL PROTECTED]
wrote:

Sorry, I didn't mention that the List is wrapped in a
detached modelso it's an IModel, not List in the constructor.







On 3/14/06, Igor Vaynberg  [EMAIL PROTECTED]
wrote:

yes DataView works with IDataProvider instead of list.
not sure why you didnt get a compile error since there is no (String,List)
constructor.


there are examples of dataview and datatable under wicket-examples/repeaters 

-Igor







On 3/14/06, Vincent Jenks 
[EMAIL PROTECTED] wrote: 

So, I'm trying to use a DataView so I can page a
collection of objects
from a session bean. 

I create the List collection (loadingModel) and pass it into the DataView:

DataView productsDataView = new DataView(productsDataView,
loadingModel) 

...but I'm getting an exception at runtime:

Caused by: java.lang.ClassCastException: java.util.ArrayList

I assume then, it's not like the ListView in that it will not take a
List directly? Or, have I done something wrong? 

Thanks! 








































Re: [Wicket-user] DataView (extentions)

2006-03-15 Thread Vincent Jenks
I'd love to see this (along w/ an example or two on usage) ;)On 3/15/06, Frank Silbermann [EMAIL PROTECTED]
 wrote:


















The DataTable in Wicket Extensions 1.1
handles paging and sorting, but you must build a custom IDataProvider that accumulates
the sorting instructions from the DataTable and provides sorted subsets of the
data when requested by the DataTable (which handles the actual paging display).



DataTable and supporting classes have been
greatly refactored in Wicket Extensions 1.2 to give the user much more
flexibility in the set of features desired. The API changes will break Wicket 1.1
programs, so if you need to subclass anything to modify its behavior, I would
suggest going to Wicket 1.2 now. Otherwise, you can upgrade fairly easily
at any time by replacing Wicket 1.1 DataTable with Wicket 1.2
DefaultDataTable. Wicket 1.2
DataTable is more flexible but less complete; DefaultDataTable subclasses it to
provide defaults which make it behave like the Wicket 1.1 DataTable.



I have come up with my own subclass of
DataTable and implementation of IDataProvider to display any arbitrary database
java.sql.ResultSet. The basic idea
is that my IDataProvider implementation contains a List of rows, each row
consisting of a List of Object.
Also in the implementation is an array of descriptors, one per column, each
of which contains the column name and an indicator as to whether I want to be
able to sort on that column. (The
column name comes from the ResultSetMetadata; a method is provided to set the
sortability flag.) My implementation
of the abstract method to deliver a sequence of rows will delegate to the List.sublist()
command from the Java Collections API, and each time the DataTable delivers a
sort criteria I apply the Collections.sort() method to my list of rows, passing
it a Comparator that delegates to the Comparator of the Object at the relevant
column index. My implementation of
IDataProvider can also look at my array of column descriptors and generate a
list of IColumn objects (needed to construct the DataTable).



It's actually a bit more complicated
than that (and a work in progress), because I have complicated the above
mechanisms to deal with the possibility of a summary row at the end, and when
rows are requested, the query string will be recalculated based on form data --
and if it has changed since the last request then the data will be refreshed
from the database and the current page set back to 1.



The code is actually quite compact; when I'm
finished I'll post it to the list if there is any interest.





-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of 
Igor Vaynberg
Sent: Tuesday, March 14, 2006
 5:21 PM
To:
wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user]
DataView (extentions)



there is also a DataTable component which wraps
DataView+paging+sorting.

-Igor





On 3/14/06, Vincent Jenks 
 [EMAIL PROTECTED] wrote:

I'm using 1.1.1 Are there any plans to whittle
down the amount of code it takes to implement paging  sorting? Has
it changed at all in 1.2? I spent a lot of time w/ ASP.NET (which
wicket feels quite similar to) and there's a DataGrid component that has
properties to set paging  sorting w/o any extra work. Something like
that would be really convenient. 







On 3/14/06, Igor Vaynberg 
 [EMAIL PROTECTED]
wrote:

are you using 1.1 ? or 1.2 ?
there used to be a constructor that took model in 1.1 i think. the model object
must be of type IDataProvider.





-Igor





On 3/14/06, Vincent Jenks 
[EMAIL PROTECTED]
wrote:

Sorry, I didn't mention that the List is wrapped in a
detached modelso it's an IModel, not List in the constructor.







On 3/14/06, Igor Vaynberg 
 [EMAIL PROTECTED]
wrote:

yes DataView works with IDataProvider instead of list.
not sure why you didnt get a compile error since there is no (String,List)
constructor.


there are examples of dataview and datatable under wicket-examples/repeaters 

-Igor







On 3/14/06, Vincent Jenks 

[EMAIL PROTECTED] wrote: 

So, I'm trying to use a DataView so I can page a
collection of objects
from a session bean. 

I create the List collection (loadingModel) and pass it into the DataView:

DataView productsDataView = new DataView(productsDataView,
loadingModel) 

...but I'm getting an exception at runtime:

Caused by: java.lang.ClassCastException: java.util.ArrayList

I assume then, it's not like the ListView in that it will not take a
List directly? Or, have I done something wrong? 

Thanks! 









































Re: [Wicket-user] DataView (extentions)

2006-03-15 Thread Igor Vaynberg
I cant speak for Frank's implementation, but when the IDataProvider is implemented correctly you only retrieve the window of data that will be rendered for this request and hold none of it in session. so the performance of the datatable component itself should be great.
-IgorOn 3/15/06, Mats Norén [EMAIL PROTECTED] wrote:
That would be great!btw, how is the performance with large resultsets?On 3/15/06, Frank Silbermann [EMAIL PROTECTED] wrote:
 The DataTable in Wicket Extensions 1.1 handles paging and sorting, but you must build a custom IDataProvider that accumulates the sorting instructions from the DataTable and provides sorted subsets of the data when requested by
 the DataTable (which handles the actual paging display). DataTable and supporting classes have been greatly refactored in Wicket Extensions 1.2 to give the user much more flexibility in the set of features
 desired.The API changes will break Wicket 1.1 programs, so if you need to subclass anything to modify its behavior, I would suggest going to Wicket 1.2 now.Otherwise, you can upgrade fairly easily at any time by replacing
 Wicket 1.1 DataTable with Wicket 1.2 DefaultDataTable.Wicket 1.2 DataTable is more flexible but less complete; DefaultDataTable subclasses it to provide defaults which make it behave like the Wicket 
1.1 DataTable. I have come up with my own subclass of DataTable and implementation of IDataProvider to display any arbitrary database java.sql.ResultSet.The basic idea is that my IDataProvider implementation contains a List of rows,
 each row consisting of a List of Object.Also in the implementation is an array of descriptors, one per column, each of which contains the column name and an indicator as to whether I want to be able to sort on that column.
 (The column name comes from the ResultSetMetadata; a method is provided to set the sortability flag.)My implementation of the abstract method to deliver a sequence of rows will delegate to the List.sublist
() command from the Java Collections API, and each time the DataTable delivers a sort criteria I apply the Collections.sort() method to my list of rows, passing it a Comparator that delegates to the Comparator of the Object at the
 relevant column index.My implementation of IDataProvider can also look at my array of column descriptors and generate a list of IColumn objects (needed to construct the DataTable).
 It's actually a bit more complicated than that (and a work in progress), because I have complicated the above mechanisms to deal with the possibility of a summary row at the end, and when rows are requested, the query string
 will be recalculated based on form data -- and if it has changed since the last request then the data will be refreshed from the database and the current page set back to 1.
 The code is actually quite compact; when I'm finished I'll post it to the list if there is any interest. -Original Message-From: 
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Igor VaynbergSent: Tuesday, March 14, 2006 5:21 PM
To: wicket-user@lists.sourceforge.netSubject: Re: [Wicket-user] DataView (extentions) there is also a DataTable component which wraps DataView+paging+sorting.
-Igor On 3/14/06, Vincent Jenks  [EMAIL PROTECTED] wrote: I'm using 1.1.1Are there any plans to whittle down the amount of code it
 takes to implement paging  sorting?Has it changed at all in 1.2?I spent a lot of time w/ ASP.NET (which wicket feels quite similar to) and there's a DataGrid component that has properties to set paging  sorting w/o any extra
 work.Something like that would be really convenient. On 3/14/06, Igor Vaynberg  [EMAIL PROTECTED] wrote:
 are you using 1.1 ? or 1.2 ?there used to be a constructor that took model in 1.1 i think. the model object must be of type IDataProvider.-Igor
 On 3/14/06, Vincent Jenks [EMAIL PROTECTED] wrote: Sorry, I didn't mention that the List is wrapped in a detached modelso
 it's an IModel, not List in the constructor. On 3/14/06, Igor Vaynberg  [EMAIL PROTECTED] wrote:
 yes DataView works with IDataProvider instead of list. not sure why you didnt get a compile error since there is no (String,List) constructor.there are examples of dataview and datatable under
 wicket-examples/repeaters-Igor On 3/14/06, Vincent Jenks  [EMAIL PROTECTED] wrote:
 So, I'm trying to use a DataView so I can page a collection of objectsfrom a session bean.I create the List collection (loadingModel) and pass it into the DataView:DataView productsDataView = new DataView(productsDataView, loadingModel)
...but I'm getting an exception at runtime:Caused by: java.lang.ClassCastException: java.util.ArrayListI assume then, it's not like the ListView in that it will not take a
List directly?Or, have I done something wrong?Thanks!---
This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime

Re: [Wicket-user] DataView (extentions)

2006-03-14 Thread Igor Vaynberg
yes DataView works with IDataProvider instead of list. not sure why you didnt get a compile error since there is no (String,List) constructor.there are examples of dataview and datatable under wicket-examples/repeaters
-IgorOn 3/14/06, VGJ [EMAIL PROTECTED] wrote:
So, I'm trying to use a DataView so I can page a collection of objectsfrom a session bean.I create the List collection (loadingModel) and pass it into the DataView:DataView productsDataView = new DataView(productsDataView, loadingModel)
...but I'm getting an exception at runtime:Caused by: java.lang.ClassCastException: java.util.ArrayListI assume then, it's not like the ListView in that it will not take aList directly?Or, have I done something wrong?
Thanks!---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642
___Wicket-user mailing listWicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] DataView (extentions)

2006-03-14 Thread Igor Vaynberg
yes DataView works with IDataProvider instead of list. not sure why you
didnt get a compile error since there is no (String,List) constructor.there are examples of dataview and datatable under wicket-examples/repeaters
-IgorOn 3/14/06, Vincent Jenks [EMAIL PROTECTED] wrote:
So, I'm trying to use a DataView so I can page a collection of objectsfrom a session bean.
I create the List collection (loadingModel) and pass it into the DataView:DataView productsDataView = new DataView(productsDataView, loadingModel)
...but I'm getting an exception at runtime:Caused by: java.lang.ClassCastException: java.util.ArrayListI assume then, it's not like the ListView in that it will not take aList directly? Or, have I done something wrong?
Thanks!




Re: [Wicket-user] DataView (extentions)

2006-03-14 Thread Vincent Jenks
Sorry, I didn't mention that the List is wrapped in a detached modelso it's an IModel, not List in the constructor.On 3/14/06, Igor Vaynberg 
[EMAIL PROTECTED] wrote:yes DataView works with IDataProvider instead of list. not sure why you
didnt get a compile error since there is no (String,List) constructor.there are examples of dataview and datatable under wicket-examples/repeaters
-IgorOn 3/14/06, Vincent Jenks 
[EMAIL PROTECTED] wrote:
So, I'm trying to use a DataView so I can page a collection of objectsfrom a session bean.
I create the List collection (loadingModel) and pass it into the DataView:DataView productsDataView = new DataView(productsDataView, loadingModel)
...but I'm getting an exception at runtime:Caused by: java.lang.ClassCastException: java.util.ArrayListI assume then, it's not like the ListView in that it will not take aList directly? Or, have I done something wrong?
Thanks!






Re: [Wicket-user] DataView (extentions)

2006-03-14 Thread Igor Vaynberg
are you using 1.1 ? or 1.2 ?there used to be a constructor that took model in 1.1 i think. the model object must be of type IDataProvider.-IgorOn 3/14/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:
Sorry, I didn't mention that the List is wrapped in a detached modelso it's an IModel, not List in the constructor.On 3/14/06, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:yes DataView works with IDataProvider instead of list. not sure why you
didnt get a compile error since there is no (String,List) constructor.there are examples of dataview and datatable under wicket-examples/repeaters
-IgorOn 3/14/06, Vincent Jenks 

[EMAIL PROTECTED] wrote:
So, I'm trying to use a DataView so I can page a collection of objectsfrom a session bean.
I create the List collection (loadingModel) and pass it into the DataView:DataView productsDataView = new DataView(productsDataView, loadingModel)
...but I'm getting an exception at runtime:Caused by: java.lang.ClassCastException: java.util.ArrayListI assume then, it's not like the ListView in that it will not take aList directly? Or, have I done something wrong?
Thanks!








Re: [Wicket-user] DataView (extentions)

2006-03-14 Thread Vincent Jenks
I'm using 1.1.1 Are there any plans to whittle down the amount of code it takes to implement paging  sorting? Has it changed at all in 1.2? I spent a lot of time w/ ASP.NET (which wicket feels quite similar to) and there's a DataGrid component that has properties to set paging  sorting w/o any extra work. Something like that would be really convenient.
On 3/14/06, Igor Vaynberg [EMAIL PROTECTED] wrote:
are you using 1.1 ? or 1.2 ?there used to be a constructor that took model in 1.1 i think. the model object must be of type IDataProvider.-Igor
On 3/14/06, 
Vincent Jenks [EMAIL PROTECTED] wrote:

Sorry, I didn't mention that the List is wrapped in a detached modelso it's an IModel, not List in the constructor.On 3/14/06, 
Igor Vaynberg 
[EMAIL PROTECTED] wrote:yes DataView works with IDataProvider instead of list. not sure why you
didnt get a compile error since there is no (String,List) constructor.there are examples of dataview and datatable under wicket-examples/repeaters
-IgorOn 3/14/06, Vincent Jenks 


[EMAIL PROTECTED] wrote:
So, I'm trying to use a DataView so I can page a collection of objectsfrom a session bean.
I create the List collection (loadingModel) and pass it into the DataView:DataView productsDataView = new DataView(productsDataView, loadingModel)
...but I'm getting an exception at runtime:Caused by: java.lang.ClassCastException: java.util.ArrayListI assume then, it's not like the ListView in that it will not take aList directly? Or, have I done something wrong?
Thanks!