Since I've already created the .jar file for Michael, I might as well
offer it to everyone.

I haven't included any examples for actually creating a subclass of my
dataprovider (common.rdbms.QueryResult).  At a minimum, you can simply
override:

     protected String generateQueryString() { return "select * from
table"; }  

After you have created the QueryResult object (myQueryResult), but
before you create an instance of common.rdbms.QueryResultDataTable with
it, you may call 
        
     public void setColumnSortable(int column)

on the QueryResult object to indicate that the data should be sortable
on this column (my indexes are zero-based, for a five-column table you
may call this with values of 0 through 4).  If you do that, then when
you create the QueryResultDataTable it will know to make that column
header a sort link. 

Look at components.QueryDataPanel for a reusable panel that creates a
QueryResultDataTable for a QueryResult and displays it in a wicket
Panel.  It also does a bunch of other stuff that you won't be interested
in, e.g. providing a label which is optionally a pop-up link, and adds a
button that lets the user download the table as a MS Excel file).  But
removing features is easier than adding them!

Please let me know what you think, or any questions about the more
sophisticated options. 

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

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=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Attachment: showingResultSets.jar
Description: showingResultSets.jar

-------------------------------------------------------------------------
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=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to