Grid Control - Javabean Example

This is another example where a Collection of Javabeans can be used as the source of data for the grid. We get the list of messages from a custom MessageManager class. The messages are retrieved and placed into an ArrayList. From there, the ArrayList is passed to the grid via the datasrc attribute.

The columns of the grid can be bound to the properties of the Javabean. This is done using the datafield attribute on the various column tags. The value of the datafield attribute must correspond with a getter method for the underlying Javabean.
e.g.     <dotj:datacolumn datafield="userid" ... />    ---->    Message.getUserid()
Retrieving data took 31 ms.
Note: Click on a column header to sort the grid!
Messages
 
Id Even Subject User Date Modified Date Modified2
 
22 true Welcome! 1 2001/07/31 10:27:50 2003/03/11 12:00:00
  23 false Welcome! 1 2001/08/01 12:07:11 2003/03/11 12:00:00
  24 true Welcome! 1 2001/08/01 12:10:02 2003/03/11 12:00:00
  25 false Welcome! 1 2001/08/01 12:11:07 2003/03/11 12:00:00
  26 true Welcome! 1 2001/08/01 12:11:28 2003/03/11 12:00:00
  27 false Welcome! 1 2001/08/01 12:11:46 2003/03/11 12:00:00
  28 true Welcome! 1 2001/08/01 12:13:03 2003/03/11 12:00:00
  29 false Welcome! 1 2001/08/01 12:13:30 2003/03/11 12:00:00
  30 true Welcome! 1 2001/08/01 12:14:15 2003/03/11 12:00:00
  31 false How to set database ? 3 2001/09/18 09:38:54 2003/03/11 12:00:00
  32 true Re: How to set database ? 1 2001/09/18 07:22:56 2003/03/11 12:00:00
  33 false About the download formatted file 6 2001/12/04 10:30:43 2003/03/11 12:00:00
  34 true Re: About the download formatted file 1 2001/12/05 12:40:32 2003/03/11 12:00:00
  35 false Formatting Excel Reports from JSP 10 2001/12/19 02:50:19 2003/03/11 12:00:00
  36 true Using dotJ Tags with other tags 12 2001/12/21 05:32:34 2003/03/11 12:00:00
  37 false Re: Formatting Excel Reports from JSP 1 2001/12/21 08:27:06 2003/03/11 12:00:00
  38 true Re: Using dotJ Tags with other tags 1 2001/12/21 08:33:03 2003/03/11 12:00:00
  39 false java.io.IOException: Illegal to flush within a custom tag 7 2002/01/08 04:30:11 2003/03/11 12:00:00
  40 true Re: java.io.IOException: Illegal to flush within a custom tag 1 2002/01/09 09:07:16 2003/03/11 12:00:00
  41 false How to use Grid bean tag for a collection class 15 2002/01/14 04:57:53 2003/03/11 12:00:00
Grid took 30 ms to render.

The above grid contains 20 records.

  Download Formatted Data
 MessageManager.java     Message.java



          Back to Samples page


home : products : pricing : company : contact us : samples : download : forums : customers

Copyright © 2000-2004 dotJ Software Inc. All rights reserved.