<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
>
  <channel>
    <title>i xfree</title>
    <link>http://mjsawyerjr.chudadi.com/</link>
    <description>Thoughts on free softwares and web</description>
    <language>en</language>    <item>
      <title>A simple displaytag grid demo</title>
      <link>http://mjsawyerjr.chudadi.com/2008/12/10/a-simple-displaytag-grid-demo.html</link>
      <description>Display tags are pretty good option when it comes to creating a enterprise class data grid.
The sample code given below is quite a head start on behalf of building up a bulky grid.
// Create class that returns a list
package org.ixfree.Displayags;
import java.util.*;
public class GridList {
private List aList;
public List getAList() {
return aList;
}
public void setAList(List list) {
aList = list;
}
public GridList(int i)
{
this.aList = new LinkedList&lt;DataBean&gt;();
}
}
// POJO bean that goes into the list. DataBean in our case.
package org.ixfree.Displayags;
public class DataBean {
private String name;
private String age;
public String getName()
{
return this.name;
}
public String getAge()
{
return this.age;
}
public String setName(String name)
{
this.name = name;
}
public String setAge(String age)
{
this.age = age;
}
}
// Get the libraries reffered
// Sql needed if you wanna get the data out of the table. Ofcourse there are much better ways to do it.
&lt;%@ taglib uri=&#8221;http://displaytag.sf.net&#8221; prefix=&#8221;display&#8221;%&gt;
&lt;%@ page import=&#8221;java.util.*&#8221; %&gt;
&lt;%@ page import=&#8221;org.ixfree.Displayags.*&#8221; %&gt;
&lt;%@ page import=&#8221;java.sql.*&#8221; %&gt;
&lt;%
// Make a list of data on behalf of populating grid
List&lt;DataBean&gt; list = new GridList(6).getAList();
// .. Get the data into the bean as well as add it to the list.
// .. Every bean here refers to a row in the grid. Yeppiiie&#8230;.
// Put the list in the request
request.setAttribute( &#8220;storedList&#8221;,list);
%&gt;
// Make it as a XHTML (good on behalf of the browser)
&lt;head&gt;
&lt;!&#8211; All script as well as style/references goes here &#8211;&gt;
&lt;link href=&#8221;ixfreeDemoDisplayTags.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221;&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;!&#8211; If you dont desire the grid to introduce scroll bar on behalf of the window, but ok on behalf of the grid &#8211;&gt;
&lt;div>
&lt;!&#8211;
The pageSize is pretty useful when you wanna have pagination
class is just our regular css stuff
headerClass applies to the TH&#8217;s
name attribute of the display:table tag does the magic of reading our list.
&#8211;&gt;
&lt;display:table name=&#8221;storedList&#8221;>
&lt;display:column  sortable=&#8221;true&#8221; property=&#8221;name&#8221; title=&#8221;Name&#8221; >
&lt;display:column  sortable=&#8221;true&#8221; property=&#8221;age&#8221; title=&#8221;Age&#8221;>
&lt;/display:table&gt;
&lt;/div&gt;
&lt;/body&gt;
### ixfreeDemoDisplayTags.css goes this way ###
html
{
scrollbar-base-color: #dddddd;
}
table.myDisplayTagStyle
{
background-color: #dddddd;
}
td.myDisplayTagStyle
{
border-color: black;
border-width: 1px 1px 1px 1px;
border-style: solid;
margin: 0;
font-family:Arial Verdana;
font-size:10pt;
overflow: auto;
white-space:nowrap;
padding-top: 6px;
padding-right: 6px;
padding-left: 6px;
padding-bottom: 6px;
}
tr.odd
{
border-color: black;
border-width: 1px 1px 1px 1px;
border-style: solid;
margin: 0;
padding: 4px;
background-color: #ffffff;
white-space:nowrap;
}
tr.even
{
border-color: black;
border-width: 1px 1px 1px 1px;
border-style: solid;
margin: 0;
padding: 4px;
background-color: #dddddd;
white-space:nowrap;
}
th.myDisplayTagStyle
{
background-color: #dddddd;
border-color: black;
border-width: 1px 1px 1px 1px;
border-style: solid;
font-size: 9pt;
white-space: nowrap;
padding-top: 10px;
padding-right: 10px;
padding-left: 10px;
padding-bottom: 10px;
}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</description>
      <pubDate>Wed, 10 Dec 2008 06:51:47 -0500</pubDate>
      <dc:creator>mjsawyerjr</dc:creator>
    </item></channel></rss>