"Quickening the Pace of JSP Development" Friday, September 10, 2010
Home Products Pricing Company Contact Us Samples Download Forums Javadoc Customers
    « Form Tags »
    « I/O Tags »
    « Format Tags »
    « Utility Tags »
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 customers from a custom CustomerManager class. The customers 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="lastName" ... />    ---->    Customer.getLastName()
Note: Click on a column header to sort the grid!
Customers
 
Icon Id Last Name First Name gender zipCode
 
My Icon 2 adas asdasdad F 34561
  My Icon 15 Chan Liam M 47387
  My Icon 10 Danns Allan M 04105
  My Icon 3 das dsad F 22151
  My Icon 13 Fellows Bill M 04105
  My Icon 19 Gatezngan Jeff M 10234
  My Icon 4 Gbv matt M 90210
  My Icon 8 gcg prova M 66778
  My Icon 7 Hogan jeff M 04105
  My Icon 5 Jackson xxx11111 F 1234
  My Icon 9 Leno Jay M 04105
  My Icon 14 Lu Lucy F 42844
  My Icon 16 McCartney Paul M 78378
  My Icon 6 Obama barack F 04101
  My Icon 18 Obama Barrack Jr. F 32419
  My Icon 11 ppp Paula F 04106
  My Icon 20 Ruthi Vijay M 4354
  My Icon 12 Test Data M 78723
  My Icon 1 test Ryan M 112312313

The above grid contains 19 records.

  Download Formatted Data
CustomerManager.java CustomerManager.java    Customer.java Customer.java



          Back to Samples page


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

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