View | Details | Raw Unified | Return to bug 31353
Collapse All | Expand All

(-)build.xml (-57 / +109 lines)
Lines 1-57 Link Here
1
<?xml version="1.0"?>
1
<?xml version="1.0"?>
2
<!-- Define and use the common.xml ant build file for building
2
3
     your taglib -->
3
4
4
5
<!DOCTYPE project [
5
<!-- Define and use the common.xml ant build file for building
6
    <!ENTITY common SYSTEM "file:../common.xml">
6
7
]>
7
     your taglib -->
8
8
9
<!-- Your main ant build declaration -->
9
10
10
11
<project name="datagrid" default="main">
11
<!DOCTYPE project [
12
12
13
  <property file="../build.properties"/>
13
    <!ENTITY common SYSTEM "file:../common.xml">
14
  <property file="${user.home}/build.properties"/>
14
15
  <property name="library.pre" value="library.pre"/>
15
]>
16
  <property name="examples.pre" value="examples.pre"/>
16
17
  <property name="checkRequirements.pre" value="checkRequirements.pre"/>
17
18
  <property name="classpath" value="${servlet.jar}:${standard.jar}:${jstl.jar}:${commons-math.jar}"/>
18
19
  <property name="jsp12.present" value="false"/>
19
<!-- Your main ant build declaration -->
20
  <target name="examples.pre">
20
21
    <copy todir="${build.examples}/WEB-INF/lib" file="${standard.jar}"/>
21
22
    <copy todir="${build.examples}/WEB-INF/lib" file="${jstl.jar}"/>
22
23
    <copy todir="${build.examples}/WEB-INF/lib" file="${commons-math.jar}"/>    
23
<project name="datagrid" default="main">
24
  </target>
24
25
25
26
  <target name="library.pre">
26
27
    <copy todir="${build.library}/META-INF">
27
  <property file="../build.properties"/>
28
      <fileset dir="conf" includes="datagrid.properties"/>
28
29
    </copy>
29
  <property file="${user.home}/build.properties"/>
30
  </target>
30
31
31
32
  <target name="checkRequirements.pre">
32
33
    <antcall target="checkRequiredFile">
33
  <property name="library.pre" value="library.pre"/>
34
       <param name="file" value="${standard.jar}"/>
34
35
       <param name="fail.message" value="A jar file containing the Jakarta Standard Taglib 1.0 classes is required to compile the datagrid taglib. Please define the property standard.jar in your jakarta.properties file and ensure that the file exists"/>
35
  <property name="examples.pre" value="examples.pre"/>
36
    </antcall>
36
37
37
  <property name="checkRequirements.pre" value="checkRequirements.pre"/>
38
    <antcall target="checkRequiredFile">
38
39
       <param name="file" value="${jstl.jar}"/>
39
  
40
       <param name="fail.message" value="A jar file containing the Jakarta Standard Taglib 1.0 classes is required to compile the datagrid taglib. Please define the property jstl.jar in your jakarta.properties file and ensure that the file exists"/>
40
41
    </antcall>
41
  <property name="classpath" value="${servlet.jar}:${standard.jar}:${jstl.jar}:${commons-math.jar}"/>
42
42
43
    <antcall target="checkRequiredFile">
43
  
44
       <param name="file" value="${commons-math.jar}"/>
44
45
       <param name="fail.message" value="A jar file containing the Common Math 1.0 library is required to compile the datagrid taglib. Please define the property common-math.jar in your jakarta.properties file and ensure that the file exists"/>
45
  <property name="jsp12.present" value="false"/>
46
    </antcall>
46
47
47
48
  </target>
48
49
49
  <target name="examples.pre">
50
  <!-- Include the common.xml ant build declarations -->
50
51
51
    <copy todir="${build.examples}/WEB-INF/lib" file="${standard.jar}"/>
52
  &common;
52
53
53
    <copy todir="${build.examples}/WEB-INF/lib" file="${jstl.jar}"/>
54
</project>
54
55
55
    <copy todir="${build.examples}/WEB-INF/lib" file="${commons-math.jar}"/>    
56
56
57
57
  </target>
58
59
  
60
61
  <target name="library.pre">
62
63
    <copy todir="${build.library}/META-INF">
64
65
      <fileset dir="conf" includes="datagrid.properties"/>
66
67
    </copy>
68
69
  </target>
70
71
  
72
73
  <target name="checkRequirements.pre">
74
75
    <antcall target="checkRequiredFile">
76
77
       <param name="file" value="${standard.jar}"/>
78
79
       <param name="fail.message" value="A jar file containing the Jakarta Standard Taglib 1.0 classes is required to compile the datagrid taglib. Please define the property standard.jar in your jakarta.properties file and ensure that the file exists"/>
80
81
    </antcall>
82
83
    <antcall target="checkRequiredFile">
84
85
       <param name="file" value="${jstl.jar}"/>
86
87
       <param name="fail.message" value="A jar file containing the Jakarta Standard Taglib 1.0 classes is required to compile the datagrid taglib. Please define the property jstl.jar in your jakarta.properties file and ensure that the file exists"/>
88
89
    </antcall>
90
91
    <antcall target="checkRequiredFile">
92
93
       <param name="file" value="${commons-math.jar}"/>
94
95
       <param name="fail.message" value="A jar file containing the Common Math 1.0 library is required to compile the datagrid taglib. Please define the property common-math.jar in your jakarta.properties file and ensure that the file exists"/>
96
97
    </antcall>
98
99
  </target>
100
101
102
103
  <!-- Include the common.xml ant build declarations -->
104
105
  &common;
106
107
108
109
</project>
(-)conf/datagrid.properties (+20 lines)
Lines 1-3 Link Here
1
<<<<<<< datagrid.properties
2
datagrid.aggregate.function.sum          = org.apache.taglibs.datagrid.aggregate.SumAggregateFunction
3
4
datagrid.aggregate.function.sumoflogs    = org.apache.taglibs.datagrid.aggregate.SumOfLogsAggregateFunction
5
6
datagrid.aggregate.function.sumofsquares = org.apache.taglibs.datagrid.aggregate.SumOfSquaresAggregateFunction
7
8
datagrid.aggregate.function.avg          = org.apache.taglibs.datagrid.aggregate.AvgAggregateFunction
9
10
datagrid.aggregate.function.count        = org.apache.taglibs.datagrid.aggregate.CountAggregateFunction
11
12
datagrid.aggregate.function.stddev       = org.apache.taglibs.datagrid.aggregate.StdDevAggregateFunction
13
14
datagrid.aggregate.function.max          = org.apache.taglibs.datagrid.aggregate.MaxAggregateFunction
15
16
datagrid.aggregate.function.min          = org.apache.taglibs.datagrid.aggregate.MinAggregateFunction
17
18
datagrid.aggregate.function.product      = org.apache.taglibs.datagrid.aggregate.ProductAggregateFunction
19
=======
1
datagrid.aggregate.function.sum          = org.apache.taglibs.datagrid.aggregate.SumAggregateFunction
20
datagrid.aggregate.function.sum          = org.apache.taglibs.datagrid.aggregate.SumAggregateFunction
2
21
3
datagrid.aggregate.function.sumoflogs    = org.apache.taglibs.datagrid.aggregate.SumOfLogsAggregateFunction
22
datagrid.aggregate.function.sumoflogs    = org.apache.taglibs.datagrid.aggregate.SumOfLogsAggregateFunction
Lines 15-17 Link Here
15
datagrid.aggregate.function.min          = org.apache.taglibs.datagrid.aggregate.MinAggregateFunction
34
datagrid.aggregate.function.min          = org.apache.taglibs.datagrid.aggregate.MinAggregateFunction
16
35
17
datagrid.aggregate.function.product      = org.apache.taglibs.datagrid.aggregate.ProductAggregateFunction
36
datagrid.aggregate.function.product      = org.apache.taglibs.datagrid.aggregate.ProductAggregateFunction
37
>>>>>>> 1.2
(-)doc/conf/web.xml (+50 lines)
Lines 1-3 Link Here
1
<<<<<<< web.xml
2
<?xml version="1.0" encoding="ISO-8859-1"?>
3
4
<!DOCTYPE web-app
5
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
6
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
7
8
<web-app>
9
10
  <display-name>Data Grid Documentation</display-name>
11
12
  <description>
13
    Documentation for the Data Grid custom tag library, from the Jakarta Taglibs project.
14
  </description>
15
16
  <mime-mapping>
17
    <extension>txt</extension>
18
    <mime-type>text/plain</mime-type>
19
  </mime-mapping>
20
 
21
  <mime-mapping>
22
    <extension>html</extension>
23
    <mime-type>text/html</mime-type>
24
  </mime-mapping>
25
26
  <mime-mapping>
27
    <extension>htm</extension>
28
    <mime-type>text/html</mime-type>
29
  </mime-mapping>
30
31
  <welcome-file-list>
32
    <welcome-file>index.html</welcome-file>
33
  </welcome-file-list>
34
35
  <taglib>
36
    <taglib-uri>http://jakarta.apache.org/taglibs/datagrid-1.0</taglib-uri>
37
    <taglib-location>/WEB-INF/taglibs-datagrid.tld</taglib-location>
38
  </taglib>
39
  <taglib>
40
    <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
41
    <taglib-location>/WEB-INF/c.tld</taglib-location>
42
  </taglib>
43
  <taglib>
44
    <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
45
    <taglib-location>/WEB-INF/fmt.tld</taglib-location>
46
  </taglib>  
47
48
</web-app>
49
=======
1
<?xml version="1.0" encoding="ISO-8859-1"?>
50
<?xml version="1.0" encoding="ISO-8859-1"?>
2
51
3
<!DOCTYPE web-app
52
<!DOCTYPE web-app
Lines 32-34 Link Here
32
  </welcome-file-list>
81
  </welcome-file-list>
33
82
34
</web-app>
83
</web-app>
84
>>>>>>> 1.3
(-)examples/conf/web.xml (+48 lines)
Lines 1-3 Link Here
1
<<<<<<< web.xml
2
<?xml version="1.0" encoding="ISO-8859-1"?>
3
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
4
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
5
<web-app>
6
7
  <display-name>Data Grid Examples</display-name>
8
9
  <description>
10
    Examples for the Data Grid custom tag library, from the Jakarta Taglibs project.
11
  </description>
12
13
  <mime-mapping>
14
    <extension>txt</extension>
15
    <mime-type>text/plain</mime-type>
16
  </mime-mapping>
17
18
  <mime-mapping>
19
    <extension>html</extension>
20
    <mime-type>text/html</mime-type>
21
  </mime-mapping>
22
23
  <mime-mapping>
24
    <extension>htm</extension>
25
    <mime-type>text/html</mime-type>
26
  </mime-mapping>
27
28
  <welcome-file-list>
29
    <welcome-file>index.jsp</welcome-file>
30
    <welcome-file>index.html</welcome-file>
31
  </welcome-file-list>
32
33
  <taglib>
34
    <taglib-uri>http://jakarta.apache.org/taglibs/datagrid-1.0</taglib-uri>
35
    <taglib-location>/WEB-INF/taglibs-datagrid.tld</taglib-location>
36
  </taglib>
37
  <taglib>
38
    <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
39
    <taglib-location>/WEB-INF/c.tld</taglib-location>
40
  </taglib>
41
  <taglib>
42
    <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
43
    <taglib-location>/WEB-INF/fmt.tld</taglib-location>
44
  </taglib>  
45
46
</web-app>
47
=======
1
<?xml version="1.0" encoding="ISO-8859-1"?>
48
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
49
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
3
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
50
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
Lines 30-32 Link Here
30
  </welcome-file-list>
77
  </welcome-file-list>
31
78
32
</web-app>
79
</web-app>
80
>>>>>>> 1.3
(-)examples/web/example1.jsp (-370 / +369 lines)
Lines 1-370 Link Here
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
2
3
<html>
3
<html>
4
4
5
<head>
5
<head>
6
6
7
   <title>Jakarta Data Grid Taglib Example</title>
7
   <title>Jakarta Data Grid Taglib Example</title>
8
8
9
</head>
9
</head>
10
   
10
   
11
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
11
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
12
12
13
<%@ page contentType="text/html"%>
13
<%@ page contentType="text/html"%>
14
14
15
<%@ page import="java.util.ArrayList" %>
15
<%@ page import="java.util.ArrayList" %>
16
16
17
17
18
18
19
<%! public static class Employee
19
<%! public static class Employee
20
20
21
    {
21
    {
22
22
23
      protected String firstName;
23
      protected String firstName;
24
24
25
      protected String lastName;
25
      protected String lastName;
26
26
27
      protected double salary;
27
      protected double salary;
28
28
29
      protected double bonus;
29
      protected double bonus;
30
30
31
31
32
32
33
      public String getFirstName ()
33
      public String getFirstName ()
34
34
35
      {
35
      {
36
36
37
        return (firstName);
37
        return (firstName);
38
38
39
      }
39
      }
40
40
41
41
42
42
43
      public String getLastName ()
43
      public String getLastName ()
44
44
45
      {
45
      {
46
46
47
        return (lastName);
47
        return (lastName);
48
48
49
      }      
49
      }      
50
50
51
51
52
52
53
      public double getSalary ()
53
      public double getSalary ()
54
54
55
      {
55
      {
56
56
57
        return (salary);
57
        return (salary);
58
58
59
      }            
59
      }            
60
60
61
61
62
62
63
      public double getBonus ()
63
      public double getBonus ()
64
64
65
      {
65
      {
66
66
67
        return (bonus);
67
        return (bonus);
68
68
69
      }                  
69
      }                  
70
70
71
71
72
72
73
      public void setFirstName (String newFirstName)
73
      public void setFirstName (String newFirstName)
74
74
75
      {
75
      {
76
76
77
        firstName = newFirstName;
77
        firstName = newFirstName;
78
78
79
      }
79
      }
80
80
81
81
82
82
83
      public void setLastName (String newLastName)
83
      public void setLastName (String newLastName)
84
84
85
      {
85
      {
86
86
87
        lastName = newLastName;
87
        lastName = newLastName;
88
88
89
      }
89
      }
90
90
91
91
92
92
93
      public void setSalary (double newSalary)
93
      public void setSalary (double newSalary)
94
94
95
      {
95
      {
96
96
97
        salary = newSalary;
97
        salary = newSalary;
98
98
99
      }
99
      }
100
100
101
101
102
102
103
      public void setBonus (double newBonus)
103
      public void setBonus (double newBonus)
104
104
105
      {
105
      {
106
106
107
        bonus = newBonus;
107
        bonus = newBonus;
108
108
109
      }      
109
      }      
110
110
111
    }
111
    }
112
112
113
%>
113
%>
114
114
115
<% ArrayList employees;
115
<% ArrayList employees;
116
116
117
   Employee  employee;
117
   Employee  employee;
118
118
119
119
120
120
121
   employees = new ArrayList ();
121
   employees = new ArrayList ();
122
122
123
   
123
   
124
124
125
   employee = new Employee ();
125
   employee = new Employee ();
126
126
127
   employee.setFirstName ("Peter");
127
   employee.setFirstName ("Peter");
128
128
129
   employee.setLastName  ("Jackson");   
129
   employee.setLastName  ("Jackson");   
130
130
131
   employee.setSalary    (120000);
131
   employee.setSalary    (120000);
132
132
133
   employee.setBonus     (20000);
133
   employee.setBonus     (20000);
134
134
135
   employees.add (employee);
135
   employees.add (employee);
136
136
137
137
138
138
139
   employee = new Employee ();
139
   employee = new Employee ();
140
140
141
   employee.setFirstName ("John");
141
   employee.setFirstName ("John");
142
142
143
   employee.setLastName  ("Woo");   
143
   employee.setLastName  ("Woo");   
144
144
145
   employee.setSalary    (100000);
145
   employee.setSalary    (100000);
146
146
147
   employee.setBonus     (17000);
147
   employee.setBonus     (17000);
148
148
149
   employees.add (employee);
149
   employees.add (employee);
150
150
151
151
152
152
153
   employee = new Employee ();
153
   employee = new Employee ();
154
154
155
   employee.setFirstName ("George");
155
   employee.setFirstName ("George");
156
156
157
   employee.setLastName  ("Lucas");   
157
   employee.setLastName  ("Lucas");   
158
158
159
   employee.setSalary    (150000);
159
   employee.setSalary    (150000);
160
160
161
   employee.setBonus     (23000);
161
   employee.setBonus     (23000);
162
162
163
   employees.add (employee);
163
   employees.add (employee);
164
164
165
165
166
166
167
   employee = new Employee ();
167
   employee = new Employee ();
168
168
169
   employee.setFirstName ("Michael");
169
   employee.setFirstName ("Michael");
170
170
171
   employee.setLastName  ("Kain");   
171
   employee.setLastName  ("Kain");   
172
172
173
   employee.setSalary    (100000);
173
   employee.setSalary    (100000);
174
174
175
   employee.setBonus     (10000);
175
   employee.setBonus     (10000);
176
176
177
   employees.add (employee);
177
   employees.add (employee);
178
178
179
179
180
180
181
   employee = new Employee ();
181
   employee = new Employee ();
182
182
183
   employee.setFirstName ("John");
183
   employee.setFirstName ("John");
184
184
185
   employee.setLastName  ("Doe");   
185
   employee.setLastName  ("Doe");   
186
186
187
   employee.setSalary    (110000);
187
   employee.setSalary    (110000);
188
188
189
   employee.setBonus     (11000);
189
   employee.setBonus     (11000);
190
190
191
   employees.add (employee);
191
   employees.add (employee);
192
192
193
193
194
194
195
   employee = new Employee ();
195
   employee = new Employee ();
196
196
197
   employee.setFirstName ("Jim");
197
   employee.setFirstName ("Jim");
198
198
199
   employee.setLastName  ("Carrey");   
199
   employee.setLastName  ("Carrey");   
200
200
201
   employee.setSalary    (110000);
201
   employee.setSalary    (110000);
202
202
203
   employee.setBonus     (11000);
203
   employee.setBonus     (11000);
204
204
205
   employees.add (employee);
205
   employees.add (employee);
206
206
207
207
208
208
209
   employee = new Employee ();
209
   employee = new Employee ();
210
210
211
   employee.setFirstName ("Sean");
211
   employee.setFirstName ("Sean");
212
212
213
   employee.setLastName  ("Penn");   
213
   employee.setLastName  ("Penn");   
214
214
215
   employee.setSalary    (150000);
215
   employee.setSalary    (150000);
216
216
217
   employee.setBonus     (13000);
217
   employee.setBonus     (13000);
218
218
219
   employees.add (employee);
219
   employees.add (employee);
220
220
221
221
222
222
223
   employee = new Employee ();
223
   employee = new Employee ();
224
224
225
   employee.setFirstName ("Charlize");
225
   employee.setFirstName ("Charlize");
226
226
227
   employee.setLastName  ("Theron");   
227
   employee.setLastName  ("Theron");   
228
228
229
   employee.setSalary    (200000);
229
   employee.setSalary    (200000);
230
230
231
   employee.setBonus     (11000);
231
   employee.setBonus     (11000);
232
232
233
   employees.add (employee);
233
   employees.add (employee);
234
234
235
235
236
236
237
   employee = new Employee ();
237
   employee = new Employee ();
238
238
239
   employee.setFirstName ("Tom");
239
   employee.setFirstName ("Tom");
240
240
241
   employee.setLastName  ("Hanks");   
241
   employee.setLastName  ("Hanks");   
242
242
243
   employee.setSalary    (190000);
243
   employee.setSalary    (190000);
244
244
245
   employee.setBonus     (10000);
245
   employee.setBonus     (10000);
246
246
247
   employees.add (employee);
247
   employees.add (employee);
248
248
249
249
250
250
251
   employee = new Employee ();
251
   employee = new Employee ();
252
252
253
   employee.setFirstName ("Edward");
253
   employee.setFirstName ("Edward");
254
254
255
   employee.setLastName  ("Norton");   
255
   employee.setLastName  ("Norton");   
256
256
257
   employee.setSalary    (180000);
257
   employee.setSalary    (180000);
258
258
259
   employee.setBonus     (13000);
259
   employee.setBonus     (13000);
260
260
261
   employees.add (employee);
261
   employees.add (employee);
262
262
263
263
264
264
265
   employee = new Employee ();
265
   employee = new Employee ();
266
266
267
   employee.setFirstName ("Gary");
267
   employee.setFirstName ("Gary");
268
268
269
   employee.setLastName  ("Oldman");   
269
   employee.setLastName  ("Oldman");   
270
270
271
   employee.setSalary    (180000);
271
   employee.setSalary    (180000);
272
272
273
   employee.setBonus     (13000);
273
   employee.setBonus     (13000);
274
274
275
   employees.add (employee);
275
   employees.add (employee);
276
276
277
277
278
278
279
   request.setAttribute ("employees", employees);
279
   request.setAttribute ("employees", employees);
280
280
281
%>
281
%>
282
282
283
<html>
283
<html>
284
284
285
<head>
285
<head>
286
286
287
   <title>Jakarta Data Grid Taglib Example 1</title>
287
   <title>Jakarta Data Grid Taglib Example 1</title>
288
   
288
   
289
   <style>
289
   <style>
290
290
291
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
291
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
292
292
293
     .hiliterows    { background-color: #CDBD4F }
293
     .hiliterows    { background-color: #CDBD4F }
294
294
295
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
295
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
296
296
297
     .header        { background-color: #998B3B }
297
     .header        { background-color: #998B3B }
298
298
299
     .footer        { background-color: #998B3B }
299
     .footer        { background-color: #998B3B }
300
300
301
     .datagrid      { border: 1px solid #000000 }
301
     .datagrid      { border: 1px solid #000000 }
302
302
303
   </style>
303
   </style>
304
304
305
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
305
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
306
306
307
</head>
307
</head>
308
308
309
<body>
309
<body>
310
310
311
<h3>Example 1</h3>
311
<h3>Example 1</h3>
312
312
313
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0">
313
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0">
314
314
315
  <columns>
315
  <columns>
316
316
317
    <column width="100" order="true">
317
    <column width="100" order="true">
318
318
319
      <header value="Name" hAlign="center"/>
319
      <header value="Name" hAlign="center"/>
320
320
321
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left"/>
321
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left"/>
322
322
323
      <aggregate function="count" var="total"/>
323
      <aggregate function="count" var="total"/>
324
324
325
      <footer value="Total ${total}" hAlign="left"/>      
325
      <footer value="Total ${total}" hAlign="left"/>      
326
326
327
    </column>
327
    </column>
328
328
329
    <column width="200" order="true">
329
    <column width="200" order="true">
330
330
331
      <header value="Salary" hAlign="center"/>
331
      <header value="Salary" hAlign="center"/>
332
332
333
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
333
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
334
334
335
      <aggregate function="avg" pattern="#,##0.00" var="total"/>
335
      <aggregate function="avg" pattern="#,##0.00" var="total"/>
336
336
337
      <footer value="Average ${total}" hAlign="right"/>
337
      <footer value="Average ${total}" hAlign="right"/>
338
338
339
    </column>
339
    </column>
340
340
341
    <column width="200" order="true">
341
    <column width="200" order="true">
342
342
343
      <header value="Bonus" hAlign="center"/>
343
      <header value="Bonus" hAlign="center"/>
344
344
345
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
345
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
346
346
347
      <aggregate function="avg" pattern="#,##0.00" var="total"/>
347
      <aggregate function="avg" pattern="#,##0.00" var="total"/>
348
      
348
      
349
      <footer value="Average ${total}" hAlign="right"/>
349
      <footer value="Average ${total}" hAlign="right"/>
350
350
351
    </column>
351
    </column>
352
352
353
  </columns>
353
  </columns>
354
354
355
  <header        styleClass="header" show="true"/>
355
  <header        styleClass="header" show="true"/>
356
356
357
  <footer        styleClass="footer" show="true"/>
357
  <footer        styleClass="footer" show="true"/>
358
358
359
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
359
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
360
360
361
  <alternateRows styleClass="alternaterows"/>
361
  <alternateRows styleClass="alternaterows"/>
362
362
363
</ui:dataGrid>
363
</ui:dataGrid>
364
364
365
<p><a href="index.jsp">Back to index</a></p>
365
<p><a href="index.jsp">Back to index</a></p>
366
366
367
</body>
367
</body>
368
368
369
</html>
369
</html>
370
(-)examples/web/example2.jsp (-368 / +367 lines)
Lines 1-368 Link Here
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
2
3
<html>
3
<html>
4
4
5
<head>
5
<head>
6
6
7
   <title>Jakarta Data Grid Taglib Example 2</title>
7
   <title>Jakarta Data Grid Taglib Example 2</title>
8
8
9
</head>
9
</head>
10
10
11
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
11
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
12
12
13
<%@ page contentType="text/html"%>
13
<%@ page contentType="text/html"%>
14
14
15
<%@ page import="java.util.ArrayList" %>
15
<%@ page import="java.util.ArrayList" %>
16
16
17
<%! public static class Employee
17
<%! public static class Employee
18
18
19
    {
19
    {
20
20
21
      protected String firstName;
21
      protected String firstName;
22
22
23
      protected String lastName;
23
      protected String lastName;
24
24
25
      protected double salary;
25
      protected double salary;
26
26
27
      protected double bonus;
27
      protected double bonus;
28
28
29
29
30
30
31
      public String getFirstName ()
31
      public String getFirstName ()
32
32
33
      {
33
      {
34
34
35
        return (firstName);
35
        return (firstName);
36
36
37
      }
37
      }
38
38
39
39
40
40
41
      public String getLastName ()
41
      public String getLastName ()
42
42
43
      {
43
      {
44
44
45
        return (lastName);
45
        return (lastName);
46
46
47
      }      
47
      }      
48
48
49
49
50
50
51
      public double getSalary ()
51
      public double getSalary ()
52
52
53
      {
53
      {
54
54
55
        return (salary);
55
        return (salary);
56
56
57
      }            
57
      }            
58
58
59
59
60
60
61
      public double getBonus ()
61
      public double getBonus ()
62
62
63
      {
63
      {
64
64
65
        return (bonus);
65
        return (bonus);
66
66
67
      }                  
67
      }                  
68
68
69
69
70
70
71
      public void setFirstName (String newFirstName)
71
      public void setFirstName (String newFirstName)
72
72
73
      {
73
      {
74
74
75
        firstName = newFirstName;
75
        firstName = newFirstName;
76
76
77
      }
77
      }
78
78
79
79
80
80
81
      public void setLastName (String newLastName)
81
      public void setLastName (String newLastName)
82
82
83
      {
83
      {
84
84
85
        lastName = newLastName;
85
        lastName = newLastName;
86
86
87
      }
87
      }
88
88
89
89
90
90
91
      public void setSalary (double newSalary)
91
      public void setSalary (double newSalary)
92
92
93
      {
93
      {
94
94
95
        salary = newSalary;
95
        salary = newSalary;
96
96
97
      }
97
      }
98
98
99
99
100
100
101
      public void setBonus (double newBonus)
101
      public void setBonus (double newBonus)
102
102
103
      {
103
      {
104
104
105
        bonus = newBonus;
105
        bonus = newBonus;
106
106
107
      }      
107
      }      
108
108
109
    }
109
    }
110
110
111
%>
111
%>
112
112
113
<% ArrayList employees;
113
<% ArrayList employees;
114
114
115
   Employee  employee;
115
   Employee  employee;
116
116
117
117
118
118
119
   employees = new ArrayList ();
119
   employees = new ArrayList ();
120
120
121
   
121
   
122
122
123
   employee = new Employee ();
123
   employee = new Employee ();
124
124
125
   employee.setFirstName ("Peter");
125
   employee.setFirstName ("Peter");
126
126
127
   employee.setLastName  ("Jackson");   
127
   employee.setLastName  ("Jackson");   
128
128
129
   employee.setSalary    (120000);
129
   employee.setSalary    (120000);
130
130
131
   employee.setBonus     (20000);
131
   employee.setBonus     (20000);
132
132
133
   employees.add (employee);
133
   employees.add (employee);
134
134
135
135
136
136
137
   employee = new Employee ();
137
   employee = new Employee ();
138
138
139
   employee.setFirstName ("John");
139
   employee.setFirstName ("John");
140
140
141
   employee.setLastName  ("Woo");   
141
   employee.setLastName  ("Woo");   
142
142
143
   employee.setSalary    (100000);
143
   employee.setSalary    (100000);
144
144
145
   employee.setBonus     (17000);
145
   employee.setBonus     (17000);
146
146
147
   employees.add (employee);
147
   employees.add (employee);
148
148
149
149
150
150
151
   employee = new Employee ();
151
   employee = new Employee ();
152
152
153
   employee.setFirstName ("George");
153
   employee.setFirstName ("George");
154
154
155
   employee.setLastName  ("Lucas");   
155
   employee.setLastName  ("Lucas");   
156
156
157
   employee.setSalary    (150000);
157
   employee.setSalary    (150000);
158
158
159
   employee.setBonus     (23000);
159
   employee.setBonus     (23000);
160
160
161
   employees.add (employee);
161
   employees.add (employee);
162
162
163
163
164
164
165
   employee = new Employee ();
165
   employee = new Employee ();
166
166
167
   employee.setFirstName ("Michael");
167
   employee.setFirstName ("Michael");
168
168
169
   employee.setLastName  ("Kain");   
169
   employee.setLastName  ("Kain");   
170
170
171
   employee.setSalary    (100000);
171
   employee.setSalary    (100000);
172
172
173
   employee.setBonus     (10000);
173
   employee.setBonus     (10000);
174
174
175
   employees.add (employee);
175
   employees.add (employee);
176
176
177
177
178
178
179
   employee = new Employee ();
179
   employee = new Employee ();
180
180
181
   employee.setFirstName ("John");
181
   employee.setFirstName ("John");
182
182
183
   employee.setLastName  ("Doe");   
183
   employee.setLastName  ("Doe");   
184
184
185
   employee.setSalary    (110000);
185
   employee.setSalary    (110000);
186
186
187
   employee.setBonus     (11000);
187
   employee.setBonus     (11000);
188
188
189
   employees.add (employee);
189
   employees.add (employee);
190
190
191
191
192
192
193
   employee = new Employee ();
193
   employee = new Employee ();
194
194
195
   employee.setFirstName ("Jim");
195
   employee.setFirstName ("Jim");
196
196
197
   employee.setLastName  ("Carrey");   
197
   employee.setLastName  ("Carrey");   
198
198
199
   employee.setSalary    (110000);
199
   employee.setSalary    (110000);
200
200
201
   employee.setBonus     (11000);
201
   employee.setBonus     (11000);
202
202
203
   employees.add (employee);
203
   employees.add (employee);
204
204
205
205
206
206
207
   employee = new Employee ();
207
   employee = new Employee ();
208
208
209
   employee.setFirstName ("Sean");
209
   employee.setFirstName ("Sean");
210
210
211
   employee.setLastName  ("Penn");   
211
   employee.setLastName  ("Penn");   
212
212
213
   employee.setSalary    (150000);
213
   employee.setSalary    (150000);
214
214
215
   employee.setBonus     (13000);
215
   employee.setBonus     (13000);
216
216
217
   employees.add (employee);
217
   employees.add (employee);
218
218
219
219
220
220
221
   employee = new Employee ();
221
   employee = new Employee ();
222
222
223
   employee.setFirstName ("Charlize");
223
   employee.setFirstName ("Charlize");
224
224
225
   employee.setLastName  ("Theron");   
225
   employee.setLastName  ("Theron");   
226
226
227
   employee.setSalary    (200000);
227
   employee.setSalary    (200000);
228
228
229
   employee.setBonus     (11000);
229
   employee.setBonus     (11000);
230
230
231
   employees.add (employee);
231
   employees.add (employee);
232
232
233
233
234
234
235
   employee = new Employee ();
235
   employee = new Employee ();
236
236
237
   employee.setFirstName ("Tom");
237
   employee.setFirstName ("Tom");
238
238
239
   employee.setLastName  ("Hanks");   
239
   employee.setLastName  ("Hanks");   
240
240
241
   employee.setSalary    (190000);
241
   employee.setSalary    (190000);
242
242
243
   employee.setBonus     (10000);
243
   employee.setBonus     (10000);
244
244
245
   employees.add (employee);
245
   employees.add (employee);
246
246
247
247
248
248
249
   employee = new Employee ();
249
   employee = new Employee ();
250
250
251
   employee.setFirstName ("Edward");
251
   employee.setFirstName ("Edward");
252
252
253
   employee.setLastName  ("Norton");   
253
   employee.setLastName  ("Norton");   
254
254
255
   employee.setSalary    (180000);
255
   employee.setSalary    (180000);
256
256
257
   employee.setBonus     (13000);
257
   employee.setBonus     (13000);
258
258
259
   employees.add (employee);
259
   employees.add (employee);
260
260
261
261
262
262
263
   employee = new Employee ();
263
   employee = new Employee ();
264
264
265
   employee.setFirstName ("Gary");
265
   employee.setFirstName ("Gary");
266
266
267
   employee.setLastName  ("Oldman");   
267
   employee.setLastName  ("Oldman");   
268
268
269
   employee.setSalary    (180000);
269
   employee.setSalary    (180000);
270
270
271
   employee.setBonus     (13000);
271
   employee.setBonus     (13000);
272
272
273
   employees.add (employee);
273
   employees.add (employee);
274
274
275
275
276
276
277
   request.setAttribute ("employees", employees);
277
   request.setAttribute ("employees", employees);
278
278
279
%>
279
%>
280
280
281
<html>
281
<html>
282
282
283
<head>
283
<head>
284
284
285
   <title>Jakarta Data Grid Taglib Example</title>
285
   <title>Jakarta Data Grid Taglib Example</title>
286
   
286
   
287
   <style>
287
   <style>
288
288
289
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
289
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
290
290
291
     .hiliterows    { background-color: #CDBD4F }
291
     .hiliterows    { background-color: #CDBD4F }
292
292
293
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
293
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
294
294
295
     .header        { background-color: #998B3B }
295
     .header        { background-color: #998B3B }
296
296
297
     .footer        { background-color: #998B3B }
297
     .footer        { background-color: #998B3B }
298
298
299
     .datagrid      { border: 1px solid #000000 }
299
     .datagrid      { border: 1px solid #000000 }
300
300
301
   </style>
301
   </style>
302
302
303
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
303
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
304
304
305
</head>
305
</head>
306
306
307
<body>
307
<body>
308
308
309
<h3>Example 2</h3>
309
<h3>Example 2</h3>
310
310
311
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0" scroll="true" width="500" height="100">
311
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0" scroll="true" width="500" height="100">
312
312
313
  <columns>
313
  <columns>
314
314
315
    <column width="100" order="true">
315
    <column width="100" order="true">
316
316
317
      <header value="Name" hAlign="center"/>
317
      <header value="Name" hAlign="center"/>
318
318
319
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left"/>
319
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left"/>
320
320
321
      <aggregate function="count" var="total"/>      
321
      <aggregate function="count" var="total"/>      
322
322
323
      <footer value="Total ${total}" hAlign="left"/>      
323
      <footer value="Total ${total}" hAlign="left"/>      
324
324
325
    </column>
325
    </column>
326
326
327
    <column width="200" order="true">
327
    <column width="200" order="true">
328
328
329
      <header value="Salary" hAlign="center"/>
329
      <header value="Salary" hAlign="center"/>
330
330
331
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
331
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
332
332
333
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
333
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
334
334
335
      <footer value="Average ${total}" hAlign="right"/>
335
      <footer value="Average ${total}" hAlign="right"/>
336
336
337
    </column>
337
    </column>
338
338
339
    <column width="200" order="true">
339
    <column width="200" order="true">
340
340
341
      <header value="Bonus" hAlign="center"/>
341
      <header value="Bonus" hAlign="center"/>
342
342
343
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
343
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
344
344
345
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
345
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
346
346
347
      <footer value="Average ${total}" hAlign="right"/>
347
      <footer value="Average ${total}" hAlign="right"/>
348
348
349
    </column>
349
    </column>
350
350
351
  </columns>
351
  </columns>
352
352
353
  <header        styleClass="header" show="true"/>
353
  <header        styleClass="header" show="true"/>
354
354
355
  <footer        styleClass="footer" show="true"/>
355
  <footer        styleClass="footer" show="true"/>
356
356
357
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
357
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
358
358
359
  <alternateRows styleClass="alternaterows"/>
359
  <alternateRows styleClass="alternaterows"/>
360
360
361
</ui:dataGrid>
361
</ui:dataGrid>
362
362
363
<p><a href="index.jsp">Back to index</a></p>
363
<p><a href="index.jsp">Back to index</a></p>
364
364
365
</body>
365
</body>
366
366
367
</html>
367
</html>
368
(-)examples/web/example3.jsp (-384 / +384 lines)
Lines 1-384 Link Here
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
2
3
<html>
3
<html>
4
4
5
<head>
5
<head>
6
6
7
   <title>Jakarta Data Grid Taglib Example 3</title>
7
   <title>Jakarta Data Grid Taglib Example 3</title>
8
8
9
</head>
9
</head>
10
10
11
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
11
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
12
12
13
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
13
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
14
14
15
<%@ page contentType="text/html"%>
15
<%@ page contentType="text/html"%>
16
16
17
<%@ page import="java.util.ArrayList" %>
17
<%@ page import="java.util.ArrayList" %>
18
18
19
<%! public static class Employee
19
<%! public static class Employee
20
20
21
    {
21
    {
22
22
23
      protected String firstName;
23
      protected String firstName;
24
24
25
      protected String lastName;
25
      protected String lastName;
26
26
27
      protected double salary;
27
      protected double salary;
28
28
29
      protected double bonus;
29
      protected double bonus;
30
30
31
31
32
32
33
      public String getFirstName ()
33
      public String getFirstName ()
34
34
35
      {
35
      {
36
36
37
        return (firstName);
37
        return (firstName);
38
38
39
      }
39
      }
40
40
41
41
42
42
43
      public String getLastName ()
43
      public String getLastName ()
44
44
45
      {
45
      {
46
46
47
        return (lastName);
47
        return (lastName);
48
48
49
      }      
49
      }      
50
50
51
51
52
52
53
      public double getSalary ()
53
      public double getSalary ()
54
54
55
      {
55
      {
56
56
57
        return (salary);
57
        return (salary);
58
58
59
      }            
59
      }            
60
60
61
61
62
62
63
      public double getBonus ()
63
      public double getBonus ()
64
64
65
      {
65
      {
66
66
67
        return (bonus);
67
        return (bonus);
68
68
69
      }                  
69
      }                  
70
70
71
71
72
72
73
      public void setFirstName (String newFirstName)
73
      public void setFirstName (String newFirstName)
74
74
75
      {
75
      {
76
76
77
        firstName = newFirstName;
77
        firstName = newFirstName;
78
78
79
      }
79
      }
80
80
81
81
82
82
83
      public void setLastName (String newLastName)
83
      public void setLastName (String newLastName)
84
84
85
      {
85
      {
86
86
87
        lastName = newLastName;
87
        lastName = newLastName;
88
88
89
      }
89
      }
90
90
91
91
92
92
93
      public void setSalary (double newSalary)
93
      public void setSalary (double newSalary)
94
94
95
      {
95
      {
96
96
97
        salary = newSalary;
97
        salary = newSalary;
98
98
99
      }
99
      }
100
100
101
101
102
102
103
      public void setBonus (double newBonus)
103
      public void setBonus (double newBonus)
104
104
105
      {
105
      {
106
106
107
        bonus = newBonus;
107
        bonus = newBonus;
108
108
109
      }      
109
      }      
110
110
111
    }
111
    }
112
112
113
%>
113
%>
114
114
115
<% ArrayList employees;
115
<% ArrayList employees;
116
116
117
   Employee  employee;
117
   Employee  employee;
118
118
119
119
120
120
121
   employees = new ArrayList ();
121
   employees = new ArrayList ();
122
122
123
   
123
   
124
124
125
   employee = new Employee ();
125
   employee = new Employee ();
126
126
127
   employee.setFirstName ("Peter");
127
   employee.setFirstName ("Peter");
128
128
129
   employee.setLastName  ("Jackson");   
129
   employee.setLastName  ("Jackson");   
130
130
131
   employee.setSalary    (120000);
131
   employee.setSalary    (120000);
132
132
133
   employee.setBonus     (20000);
133
   employee.setBonus     (20000);
134
134
135
   employees.add (employee);
135
   employees.add (employee);
136
136
137
137
138
138
139
   employee = new Employee ();
139
   employee = new Employee ();
140
140
141
   employee.setFirstName ("John");
141
   employee.setFirstName ("John");
142
142
143
   employee.setLastName  ("Woo");   
143
   employee.setLastName  ("Woo");   
144
144
145
   employee.setSalary    (100000);
145
   employee.setSalary    (100000);
146
146
147
   employee.setBonus     (17000);
147
   employee.setBonus     (17000);
148
148
149
   employees.add (employee);
149
   employees.add (employee);
150
150
151
151
152
152
153
   employee = new Employee ();
153
   employee = new Employee ();
154
154
155
   employee.setFirstName ("George");
155
   employee.setFirstName ("George");
156
156
157
   employee.setLastName  ("Lucas");   
157
   employee.setLastName  ("Lucas");   
158
158
159
   employee.setSalary    (150000);
159
   employee.setSalary    (150000);
160
160
161
   employee.setBonus     (23000);
161
   employee.setBonus     (23000);
162
162
163
   employees.add (employee);
163
   employees.add (employee);
164
164
165
165
166
166
167
   employee = new Employee ();
167
   employee = new Employee ();
168
168
169
   employee.setFirstName ("Michael");
169
   employee.setFirstName ("Michael");
170
170
171
   employee.setLastName  ("Kain");   
171
   employee.setLastName  ("Kain");   
172
172
173
   employee.setSalary    (100000);
173
   employee.setSalary    (100000);
174
174
175
   employee.setBonus     (10000);
175
   employee.setBonus     (10000);
176
176
177
   employees.add (employee);
177
   employees.add (employee);
178
178
179
179
180
180
181
   employee = new Employee ();
181
   employee = new Employee ();
182
182
183
   employee.setFirstName ("John");
183
   employee.setFirstName ("John");
184
184
185
   employee.setLastName  ("Doe");   
185
   employee.setLastName  ("Doe");   
186
186
187
   employee.setSalary    (110000);
187
   employee.setSalary    (110000);
188
188
189
   employee.setBonus     (11000);
189
   employee.setBonus     (11000);
190
190
191
   employees.add (employee);
191
   employees.add (employee);
192
192
193
193
194
194
195
   employee = new Employee ();
195
   employee = new Employee ();
196
196
197
   employee.setFirstName ("Jim");
197
   employee.setFirstName ("Jim");
198
198
199
   employee.setLastName  ("Carrey");   
199
   employee.setLastName  ("Carrey");   
200
200
201
   employee.setSalary    (110000);
201
   employee.setSalary    (110000);
202
202
203
   employee.setBonus     (11000);
203
   employee.setBonus     (11000);
204
204
205
   employees.add (employee);
205
   employees.add (employee);
206
206
207
207
208
208
209
   employee = new Employee ();
209
   employee = new Employee ();
210
210
211
   employee.setFirstName ("Sean");
211
   employee.setFirstName ("Sean");
212
212
213
   employee.setLastName  ("Penn");   
213
   employee.setLastName  ("Penn");   
214
214
215
   employee.setSalary    (150000);
215
   employee.setSalary    (150000);
216
216
217
   employee.setBonus     (13000);
217
   employee.setBonus     (13000);
218
218
219
   employees.add (employee);
219
   employees.add (employee);
220
220
221
221
222
222
223
   employee = new Employee ();
223
   employee = new Employee ();
224
224
225
   employee.setFirstName ("Charlize");
225
   employee.setFirstName ("Charlize");
226
226
227
   employee.setLastName  ("Theron");   
227
   employee.setLastName  ("Theron");   
228
228
229
   employee.setSalary    (200000);
229
   employee.setSalary    (200000);
230
230
231
   employee.setBonus     (11000);
231
   employee.setBonus     (11000);
232
232
233
   employees.add (employee);
233
   employees.add (employee);
234
234
235
235
236
236
237
   employee = new Employee ();
237
   employee = new Employee ();
238
238
239
   employee.setFirstName ("Tom");
239
   employee.setFirstName ("Tom");
240
240
241
   employee.setLastName  ("Hanks");   
241
   employee.setLastName  ("Hanks");   
242
242
243
   employee.setSalary    (190000);
243
   employee.setSalary    (190000);
244
244
245
   employee.setBonus     (10000);
245
   employee.setBonus     (10000);
246
246
247
   employees.add (employee);
247
   employees.add (employee);
248
248
249
249
250
250
251
   employee = new Employee ();
251
   employee = new Employee ();
252
252
253
   employee.setFirstName ("Edward");
253
   employee.setFirstName ("Edward");
254
254
255
   employee.setLastName  ("Norton");   
255
   employee.setLastName  ("Norton");   
256
256
257
   employee.setSalary    (180000);
257
   employee.setSalary    (180000);
258
258
259
   employee.setBonus     (13000);
259
   employee.setBonus     (13000);
260
260
261
   employees.add (employee);
261
   employees.add (employee);
262
262
263
263
264
264
265
   employee = new Employee ();
265
   employee = new Employee ();
266
266
267
   employee.setFirstName ("Gary");
267
   employee.setFirstName ("Gary");
268
268
269
   employee.setLastName  ("Oldman");   
269
   employee.setLastName  ("Oldman");   
270
270
271
   employee.setSalary    (180000);
271
   employee.setSalary    (180000);
272
272
273
   employee.setBonus     (13000);
273
   employee.setBonus     (13000);
274
274
275
   employees.add (employee);
275
   employees.add (employee);
276
276
277
277
278
278
279
   request.setAttribute ("employees", employees);
279
   request.setAttribute ("employees", employees);
280
280
281
%>
281
%>
282
282
283
<html>
283
<html>
284
284
285
<head>
285
<head>
286
286
287
   <title>Jakarta Data Grid Taglib Example</title>
287
   <title>Jakarta Data Grid Taglib Example</title>
288
   
288
   
289
   <style>
289
   <style>
290
290
291
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
291
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
292
292
293
     .hiliterows    { background-color: #CDBD4F }
293
     .hiliterows    { background-color: #CDBD4F }
294
294
295
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
295
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
296
296
297
     .header        { background-color: #998B3B }
297
     .header        { background-color: #998B3B }
298
298
299
     .footer        { background-color: #998B3B }
299
     .footer        { background-color: #998B3B }
300
300
301
     .datagrid      { border: 1px solid #000000 }
301
     .datagrid      { border: 1px solid #000000 }
302
302
303
   </style>
303
   </style>
304
304
305
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
305
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
306
306
307
</head>
307
</head>
308
308
309
<body>
309
<body>
310
310
311
<h3>Example 3</h3>
311
<h3>Example 3</h3>
312
312
313
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0">
313
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0">
314
314
315
  <columns>
315
  <columns>
316
316
317
    <column width="100" order="true">
317
    <column width="100" order="true">
318
318
319
      <header value="Name" hAlign="center"/>
319
      <header value="Name" hAlign="center"/>
320
320
321
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left"/>      
321
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left"/>      
322
322
323
      <aggregate function="count" var="total"/>      
323
      <aggregate function="count" var="total"/>      
324
324
325
      <footer value="Total ${total}" hAlign="left"/>      
325
      <footer value="Total ${total}" hAlign="left"/>      
326
326
327
    </column>
327
    </column>
328
328
329
    <column width="200" order="true">
329
    <column width="200" order="true">
330
330
331
      <header value="Salary" hAlign="center"/>
331
      <header value="Salary" hAlign="center"/>
332
332
333
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
333
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
334
334
335
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
335
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
336
336
337
      <footer value="Average ${total}" hAlign="right"/>
337
      <footer value="Average ${total}" hAlign="right"/>
338
338
339
    </column>
339
    </column>
340
340
341
    <column width="200" order="true">
341
    <column width="200" order="true">
342
342
343
      <header value="Bonus" hAlign="center"/>
343
      <header value="Bonus" hAlign="center"/>
344
344
345
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
345
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
346
346
347
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
347
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
348
348
349
      <footer value="Average ${total}" hAlign="right"/>
349
      <footer value="Average ${total}" hAlign="right"/>
350
350
351
    </column>
351
    </column>
352
352
353
  </columns>
353
  </columns>
354
354
355
  <header        styleClass="header" show="true"/>
355
  <header        styleClass="header" show="true"/>
356
356
357
  <footer        styleClass="footer" show="true"/>
357
  <footer        styleClass="footer" show="true"/>
358
358
359
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
359
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
360
360
361
  <alternateRows styleClass="alternaterows"/>
361
  <alternateRows styleClass="alternaterows"/>
362
362
363
  <paging        size="4" nextUrlVar="next" previousUrlVar="previous"/>
363
  <paging        size="4" nextUrlVar="next" previousUrlVar="previous"/>
364
364
365
</ui:dataGrid>
365
</ui:dataGrid>
366
366
367
<c:if test="${previous != null}">
367
<c:if test="${previous != null}">
368
368
369
<a href="<c:out value="${previous}"/>">Previous</a>
369
<a href="<c:out value="${previous}"/>">Previous</a>
370
370
371
</c:if>
371
</c:if>
372
372
373
<c:if test="${next != null}">
373
<c:if test="${next != null}">
374
374
375
<a href="<c:out value="${next}"/>">Next</a>
375
<a href="<c:out value="${next}"/>">Next</a>
376
376
377
</c:if>
377
</c:if>
378
378
379
<p><a href="index.jsp">Back to index</a></p>
379
<p><a href="index.jsp">Back to index</a></p>
380
380
381
</body>
381
</body>
382
382
383
</html>
383
</html>
384
384
(-)examples/web/example4.jsp (-378 / +378 lines)
Lines 1-378 Link Here
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
2
3
<html>
3
<html>
4
4
5
<head>
5
<head>
6
6
7
   <title>Jakarta Data Grid Taglib Example</title>
7
   <title>Jakarta Data Grid Taglib Example</title>
8
8
9
</head>
9
</head>
10
10
11
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
11
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
12
12
13
<%@ page contentType="text/html"%>
13
<%@ page contentType="text/html"%>
14
14
15
<%@ page import="java.util.ArrayList" %>
15
<%@ page import="java.util.ArrayList" %>
16
16
17
17
18
18
19
<%! public static class Employee
19
<%! public static class Employee
20
20
21
    {
21
    {
22
22
23
      protected String firstName;
23
      protected String firstName;
24
24
25
      protected String lastName;
25
      protected String lastName;
26
26
27
      protected double salary;
27
      protected double salary;
28
28
29
      protected double bonus;
29
      protected double bonus;
30
30
31
31
32
32
33
      public String getFirstName ()
33
      public String getFirstName ()
34
34
35
      {
35
      {
36
36
37
        return (firstName);
37
        return (firstName);
38
38
39
      }
39
      }
40
40
41
41
42
42
43
      public String getLastName ()
43
      public String getLastName ()
44
44
45
      {
45
      {
46
46
47
        return (lastName);
47
        return (lastName);
48
48
49
      }      
49
      }      
50
50
51
51
52
52
53
      public double getSalary ()
53
      public double getSalary ()
54
54
55
      {
55
      {
56
56
57
        return (salary);
57
        return (salary);
58
58
59
      }            
59
      }            
60
60
61
61
62
62
63
      public double getBonus ()
63
      public double getBonus ()
64
64
65
      {
65
      {
66
66
67
        return (bonus);
67
        return (bonus);
68
68
69
      }                  
69
      }                  
70
70
71
71
72
72
73
      public void setFirstName (String newFirstName)
73
      public void setFirstName (String newFirstName)
74
74
75
      {
75
      {
76
76
77
        firstName = newFirstName;
77
        firstName = newFirstName;
78
78
79
      }
79
      }
80
80
81
81
82
82
83
      public void setLastName (String newLastName)
83
      public void setLastName (String newLastName)
84
84
85
      {
85
      {
86
86
87
        lastName = newLastName;
87
        lastName = newLastName;
88
88
89
      }
89
      }
90
90
91
91
92
92
93
      public void setSalary (double newSalary)
93
      public void setSalary (double newSalary)
94
94
95
      {
95
      {
96
96
97
        salary = newSalary;
97
        salary = newSalary;
98
98
99
      }
99
      }
100
100
101
101
102
102
103
      public void setBonus (double newBonus)
103
      public void setBonus (double newBonus)
104
104
105
      {
105
      {
106
106
107
        bonus = newBonus;
107
        bonus = newBonus;
108
108
109
      }      
109
      }      
110
110
111
    }
111
    }
112
112
113
%>
113
%>
114
114
115
<% ArrayList employees;
115
<% ArrayList employees;
116
116
117
   Employee  employee;
117
   Employee  employee;
118
118
119
119
120
120
121
   employees = new ArrayList ();
121
   employees = new ArrayList ();
122
122
123
   
123
   
124
124
125
   employee = new Employee ();
125
   employee = new Employee ();
126
126
127
   employee.setFirstName ("Peter");
127
   employee.setFirstName ("Peter");
128
128
129
   employee.setLastName  ("Jackson");   
129
   employee.setLastName  ("Jackson");   
130
130
131
   employee.setSalary    (120000);
131
   employee.setSalary    (120000);
132
132
133
   employee.setBonus     (20000);
133
   employee.setBonus     (20000);
134
134
135
   employees.add (employee);
135
   employees.add (employee);
136
136
137
137
138
138
139
   employee = new Employee ();
139
   employee = new Employee ();
140
140
141
   employee.setFirstName ("John");
141
   employee.setFirstName ("John");
142
142
143
   employee.setLastName  ("Woo");   
143
   employee.setLastName  ("Woo");   
144
144
145
   employee.setSalary    (100000);
145
   employee.setSalary    (100000);
146
146
147
   employee.setBonus     (17000);
147
   employee.setBonus     (17000);
148
148
149
   employees.add (employee);
149
   employees.add (employee);
150
150
151
151
152
152
153
   employee = new Employee ();
153
   employee = new Employee ();
154
154
155
   employee.setFirstName ("George");
155
   employee.setFirstName ("George");
156
156
157
   employee.setLastName  ("Lucas");   
157
   employee.setLastName  ("Lucas");   
158
158
159
   employee.setSalary    (150000);
159
   employee.setSalary    (150000);
160
160
161
   employee.setBonus     (23000);
161
   employee.setBonus     (23000);
162
162
163
   employees.add (employee);
163
   employees.add (employee);
164
164
165
165
166
166
167
   employee = new Employee ();
167
   employee = new Employee ();
168
168
169
   employee.setFirstName ("Michael");
169
   employee.setFirstName ("Michael");
170
170
171
   employee.setLastName  ("Kain");   
171
   employee.setLastName  ("Kain");   
172
172
173
   employee.setSalary    (100000);
173
   employee.setSalary    (100000);
174
174
175
   employee.setBonus     (10000);
175
   employee.setBonus     (10000);
176
176
177
   employees.add (employee);
177
   employees.add (employee);
178
178
179
179
180
180
181
   employee = new Employee ();
181
   employee = new Employee ();
182
182
183
   employee.setFirstName ("John");
183
   employee.setFirstName ("John");
184
184
185
   employee.setLastName  ("Doe");   
185
   employee.setLastName  ("Doe");   
186
186
187
   employee.setSalary    (110000);
187
   employee.setSalary    (110000);
188
188
189
   employee.setBonus     (11000);
189
   employee.setBonus     (11000);
190
190
191
   employees.add (employee);
191
   employees.add (employee);
192
192
193
193
194
194
195
   employee = new Employee ();
195
   employee = new Employee ();
196
196
197
   employee.setFirstName ("Jim");
197
   employee.setFirstName ("Jim");
198
198
199
   employee.setLastName  ("Carrey");   
199
   employee.setLastName  ("Carrey");   
200
200
201
   employee.setSalary    (110000);
201
   employee.setSalary    (110000);
202
202
203
   employee.setBonus     (11000);
203
   employee.setBonus     (11000);
204
204
205
   employees.add (employee);
205
   employees.add (employee);
206
206
207
207
208
208
209
   employee = new Employee ();
209
   employee = new Employee ();
210
210
211
   employee.setFirstName ("Sean");
211
   employee.setFirstName ("Sean");
212
212
213
   employee.setLastName  ("Penn");   
213
   employee.setLastName  ("Penn");   
214
214
215
   employee.setSalary    (150000);
215
   employee.setSalary    (150000);
216
216
217
   employee.setBonus     (13000);
217
   employee.setBonus     (13000);
218
218
219
   employees.add (employee);
219
   employees.add (employee);
220
220
221
221
222
222
223
   employee = new Employee ();
223
   employee = new Employee ();
224
224
225
   employee.setFirstName ("Charlize");
225
   employee.setFirstName ("Charlize");
226
226
227
   employee.setLastName  ("Theron");   
227
   employee.setLastName  ("Theron");   
228
228
229
   employee.setSalary    (200000);
229
   employee.setSalary    (200000);
230
230
231
   employee.setBonus     (11000);
231
   employee.setBonus     (11000);
232
232
233
   employees.add (employee);
233
   employees.add (employee);
234
234
235
235
236
236
237
   employee = new Employee ();
237
   employee = new Employee ();
238
238
239
   employee.setFirstName ("Tom");
239
   employee.setFirstName ("Tom");
240
240
241
   employee.setLastName  ("Hanks");   
241
   employee.setLastName  ("Hanks");   
242
242
243
   employee.setSalary    (190000);
243
   employee.setSalary    (190000);
244
244
245
   employee.setBonus     (10000);
245
   employee.setBonus     (10000);
246
246
247
   employees.add (employee);
247
   employees.add (employee);
248
248
249
249
250
250
251
   employee = new Employee ();
251
   employee = new Employee ();
252
252
253
   employee.setFirstName ("Edward");
253
   employee.setFirstName ("Edward");
254
254
255
   employee.setLastName  ("Norton");   
255
   employee.setLastName  ("Norton");   
256
256
257
   employee.setSalary    (180000);
257
   employee.setSalary    (180000);
258
258
259
   employee.setBonus     (13000);
259
   employee.setBonus     (13000);
260
260
261
   employees.add (employee);
261
   employees.add (employee);
262
262
263
263
264
264
265
   employee = new Employee ();
265
   employee = new Employee ();
266
266
267
   employee.setFirstName ("Gary");
267
   employee.setFirstName ("Gary");
268
268
269
   employee.setLastName  ("Oldman");   
269
   employee.setLastName  ("Oldman");   
270
270
271
   employee.setSalary    (180000);
271
   employee.setSalary    (180000);
272
272
273
   employee.setBonus     (13000);
273
   employee.setBonus     (13000);
274
274
275
   employees.add (employee);
275
   employees.add (employee);
276
276
277
277
278
278
279
   request.setAttribute ("employees", employees);
279
   request.setAttribute ("employees", employees);
280
280
281
%>
281
%>
282
282
283
<html>
283
<html>
284
284
285
<head>
285
<head>
286
286
287
   <title>Jakarta Data Grid Taglib Example 4</title>
287
   <title>Jakarta Data Grid Taglib Example 4</title>
288
   
288
   
289
   <style>
289
   <style>
290
290
291
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
291
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
292
292
293
     .hiliterows    { background-color: #CDBD4F }
293
     .hiliterows    { background-color: #CDBD4F }
294
294
295
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
295
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
296
296
297
     .header        { background-color: #998B3B }
297
     .header        { background-color: #998B3B }
298
298
299
     .footer        { background-color: #998B3B }
299
     .footer        { background-color: #998B3B }
300
300
301
     .datagrid      { border: 1px solid #000000 }
301
     .datagrid      { border: 1px solid #000000 }
302
302
303
   </style>
303
   </style>
304
304
305
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
305
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
306
306
307
</head>
307
</head>
308
308
309
<body>
309
<body>
310
310
311
<h3>Example 4</h3>
311
<h3>Example 4</h3>
312
312
313
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0" scroll="true" width="600" height="100">
313
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0" scroll="true" width="600" height="100">
314
314
315
  <columns>
315
  <columns>
316
316
317
    <column width="100">
317
    <column width="100">
318
    
318
    
319
      <header value="Select" hAlign="center"/>
319
      <header value="Select" hAlign="center"/>
320
      
320
      
321
      <item   value="&lt;input type=&quot;radio&quot; name=&quot;employee&quot; value=&quot;${employee.firstName} ${employee.lastName}&quot;/&gt;" hAlign="center"/>
321
      <item   value="&lt;input type=&quot;radio&quot; name=&quot;employee&quot; value=&quot;${employee.firstName} ${employee.lastName}&quot;/&gt;" hAlign="center"/>
322
      
322
      
323
    </column>
323
    </column>
324
324
325
    <column width="100" order="true">
325
    <column width="100" order="true">
326
326
327
      <header value="Name" hAlign="center"/>
327
      <header value="Name" hAlign="center"/>
328
328
329
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left"/>
329
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left"/>
330
330
331
      <aggregate function="count" var="total"/>      
331
      <aggregate function="count" var="total"/>      
332
332
333
      <footer value="Total ${total}" hAlign="left"/>      
333
      <footer value="Total ${total}" hAlign="left"/>      
334
334
335
    </column>
335
    </column>
336
336
337
    <column width="200" order="true">
337
    <column width="200" order="true">
338
338
339
      <header value="Salary" hAlign="center"/>
339
      <header value="Salary" hAlign="center"/>
340
340
341
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
341
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
342
342
343
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
343
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
344
344
345
      <footer value="Average ${total}" hAlign="right"/>
345
      <footer value="Average ${total}" hAlign="right"/>
346
346
347
    </column>
347
    </column>
348
348
349
    <column width="200" order="true">
349
    <column width="200" order="true">
350
350
351
      <header value="Bonus" hAlign="center"/>
351
      <header value="Bonus" hAlign="center"/>
352
352
353
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
353
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
354
354
355
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
355
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
356
356
357
      <footer value="Average ${total}" hAlign="right"/>
357
      <footer value="Average ${total}" hAlign="right"/>
358
358
359
    </column>
359
    </column>
360
360
361
  </columns>
361
  </columns>
362
362
363
  <header        styleClass="header" show="true"/>
363
  <header        styleClass="header" show="true"/>
364
364
365
  <footer        styleClass="footer" show="true"/>
365
  <footer        styleClass="footer" show="true"/>
366
366
367
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
367
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
368
368
369
  <alternateRows styleClass="alternaterows"/>
369
  <alternateRows styleClass="alternaterows"/>
370
370
371
</ui:dataGrid>
371
</ui:dataGrid>
372
372
373
<p><a href="index.jsp">Back to index</a></p>
373
<p><a href="index.jsp">Back to index</a></p>
374
374
375
</body>
375
</body>
376
376
377
</html>
377
</html>
378
378
(-)examples/web/example5.jsp (-378 / +377 lines)
Lines 1-378 Link Here
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
2
3
<html>
3
<html>
4
4
5
<head>
5
<head>
6
6
7
   <title>Jakarta Data Grid Taglib Example</title>
7
   <title>Jakarta Data Grid Taglib Example</title>
8
8
9
</head>
9
</head>
10
10
11
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
11
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
12
12
13
<%@ page contentType="text/html"%>
13
<%@ page contentType="text/html"%>
14
14
15
<%@ page import="java.util.ArrayList" %>
15
<%@ page import="java.util.ArrayList" %>
16
16
17
17
18
18
19
<%! public static class Employee
19
<%! public static class Employee
20
20
21
    {
21
    {
22
22
23
      protected String firstName;
23
      protected String firstName;
24
24
25
      protected String lastName;
25
      protected String lastName;
26
26
27
      protected double salary;
27
      protected double salary;
28
28
29
      protected double bonus;
29
      protected double bonus;
30
30
31
31
32
32
33
      public String getFirstName ()
33
      public String getFirstName ()
34
34
35
      {
35
      {
36
36
37
        return (firstName);
37
        return (firstName);
38
38
39
      }
39
      }
40
40
41
41
42
42
43
      public String getLastName ()
43
      public String getLastName ()
44
44
45
      {
45
      {
46
46
47
        return (lastName);
47
        return (lastName);
48
48
49
      }      
49
      }      
50
50
51
51
52
52
53
      public double getSalary ()
53
      public double getSalary ()
54
54
55
      {
55
      {
56
56
57
        return (salary);
57
        return (salary);
58
58
59
      }            
59
      }            
60
60
61
61
62
62
63
      public double getBonus ()
63
      public double getBonus ()
64
64
65
      {
65
      {
66
66
67
        return (bonus);
67
        return (bonus);
68
68
69
      }                  
69
      }                  
70
70
71
71
72
72
73
      public void setFirstName (String newFirstName)
73
      public void setFirstName (String newFirstName)
74
74
75
      {
75
      {
76
76
77
        firstName = newFirstName;
77
        firstName = newFirstName;
78
78
79
      }
79
      }
80
80
81
81
82
82
83
      public void setLastName (String newLastName)
83
      public void setLastName (String newLastName)
84
84
85
      {
85
      {
86
86
87
        lastName = newLastName;
87
        lastName = newLastName;
88
88
89
      }
89
      }
90
90
91
91
92
92
93
      public void setSalary (double newSalary)
93
      public void setSalary (double newSalary)
94
94
95
      {
95
      {
96
96
97
        salary = newSalary;
97
        salary = newSalary;
98
98
99
      }
99
      }
100
100
101
101
102
102
103
      public void setBonus (double newBonus)
103
      public void setBonus (double newBonus)
104
104
105
      {
105
      {
106
106
107
        bonus = newBonus;
107
        bonus = newBonus;
108
108
109
      }      
109
      }      
110
110
111
    }
111
    }
112
112
113
%>
113
%>
114
114
115
<% ArrayList employees;
115
<% ArrayList employees;
116
116
117
   Employee  employee;
117
   Employee  employee;
118
118
119
119
120
120
121
   employees = new ArrayList ();
121
   employees = new ArrayList ();
122
122
123
   
123
   
124
124
125
   employee = new Employee ();
125
   employee = new Employee ();
126
126
127
   employee.setFirstName ("Peter");
127
   employee.setFirstName ("Peter");
128
128
129
   employee.setLastName  ("Jackson");   
129
   employee.setLastName  ("Jackson");   
130
130
131
   employee.setSalary    (120000);
131
   employee.setSalary    (120000);
132
132
133
   employee.setBonus     (20000);
133
   employee.setBonus     (20000);
134
134
135
   employees.add (employee);
135
   employees.add (employee);
136
136
137
137
138
138
139
   employee = new Employee ();
139
   employee = new Employee ();
140
140
141
   employee.setFirstName ("John");
141
   employee.setFirstName ("John");
142
142
143
   employee.setLastName  ("Woo");   
143
   employee.setLastName  ("Woo");   
144
144
145
   employee.setSalary    (100000);
145
   employee.setSalary    (100000);
146
146
147
   employee.setBonus     (17000);
147
   employee.setBonus     (17000);
148
148
149
   employees.add (employee);
149
   employees.add (employee);
150
150
151
151
152
152
153
   employee = new Employee ();
153
   employee = new Employee ();
154
154
155
   employee.setFirstName ("George");
155
   employee.setFirstName ("George");
156
156
157
   employee.setLastName  ("Lucas");   
157
   employee.setLastName  ("Lucas");   
158
158
159
   employee.setSalary    (150000);
159
   employee.setSalary    (150000);
160
160
161
   employee.setBonus     (23000);
161
   employee.setBonus     (23000);
162
162
163
   employees.add (employee);
163
   employees.add (employee);
164
164
165
165
166
166
167
   employee = new Employee ();
167
   employee = new Employee ();
168
168
169
   employee.setFirstName ("Michael");
169
   employee.setFirstName ("Michael");
170
170
171
   employee.setLastName  ("Kain");   
171
   employee.setLastName  ("Kain");   
172
172
173
   employee.setSalary    (100000);
173
   employee.setSalary    (100000);
174
174
175
   employee.setBonus     (10000);
175
   employee.setBonus     (10000);
176
176
177
   employees.add (employee);
177
   employees.add (employee);
178
178
179
179
180
180
181
   employee = new Employee ();
181
   employee = new Employee ();
182
182
183
   employee.setFirstName ("John");
183
   employee.setFirstName ("John");
184
184
185
   employee.setLastName  ("Doe");   
185
   employee.setLastName  ("Doe");   
186
186
187
   employee.setSalary    (110000);
187
   employee.setSalary    (110000);
188
188
189
   employee.setBonus     (11000);
189
   employee.setBonus     (11000);
190
190
191
   employees.add (employee);
191
   employees.add (employee);
192
192
193
193
194
194
195
   employee = new Employee ();
195
   employee = new Employee ();
196
196
197
   employee.setFirstName ("Jim");
197
   employee.setFirstName ("Jim");
198
198
199
   employee.setLastName  ("Carrey");   
199
   employee.setLastName  ("Carrey");   
200
200
201
   employee.setSalary    (110000);
201
   employee.setSalary    (110000);
202
202
203
   employee.setBonus     (11000);
203
   employee.setBonus     (11000);
204
204
205
   employees.add (employee);
205
   employees.add (employee);
206
206
207
207
208
208
209
   employee = new Employee ();
209
   employee = new Employee ();
210
210
211
   employee.setFirstName ("Sean");
211
   employee.setFirstName ("Sean");
212
212
213
   employee.setLastName  ("Penn");   
213
   employee.setLastName  ("Penn");   
214
214
215
   employee.setSalary    (150000);
215
   employee.setSalary    (150000);
216
216
217
   employee.setBonus     (13000);
217
   employee.setBonus     (13000);
218
218
219
   employees.add (employee);
219
   employees.add (employee);
220
220
221
221
222
222
223
   employee = new Employee ();
223
   employee = new Employee ();
224
224
225
   employee.setFirstName ("Charlize");
225
   employee.setFirstName ("Charlize");
226
226
227
   employee.setLastName  ("Theron");   
227
   employee.setLastName  ("Theron");   
228
228
229
   employee.setSalary    (200000);
229
   employee.setSalary    (200000);
230
230
231
   employee.setBonus     (11000);
231
   employee.setBonus     (11000);
232
232
233
   employees.add (employee);
233
   employees.add (employee);
234
234
235
235
236
236
237
   employee = new Employee ();
237
   employee = new Employee ();
238
238
239
   employee.setFirstName ("Tom");
239
   employee.setFirstName ("Tom");
240
240
241
   employee.setLastName  ("Hanks");   
241
   employee.setLastName  ("Hanks");   
242
242
243
   employee.setSalary    (190000);
243
   employee.setSalary    (190000);
244
244
245
   employee.setBonus     (10000);
245
   employee.setBonus     (10000);
246
246
247
   employees.add (employee);
247
   employees.add (employee);
248
248
249
249
250
250
251
   employee = new Employee ();
251
   employee = new Employee ();
252
252
253
   employee.setFirstName ("Edward");
253
   employee.setFirstName ("Edward");
254
254
255
   employee.setLastName  ("Norton");   
255
   employee.setLastName  ("Norton");   
256
256
257
   employee.setSalary    (180000);
257
   employee.setSalary    (180000);
258
258
259
   employee.setBonus     (13000);
259
   employee.setBonus     (13000);
260
260
261
   employees.add (employee);
261
   employees.add (employee);
262
262
263
263
264
264
265
   employee = new Employee ();
265
   employee = new Employee ();
266
266
267
   employee.setFirstName ("Gary");
267
   employee.setFirstName ("Gary");
268
268
269
   employee.setLastName  ("Oldman");   
269
   employee.setLastName  ("Oldman");   
270
270
271
   employee.setSalary    (180000);
271
   employee.setSalary    (180000);
272
272
273
   employee.setBonus     (13000);
273
   employee.setBonus     (13000);
274
274
275
   employees.add (employee);
275
   employees.add (employee);
276
276
277
277
278
278
279
   request.setAttribute ("employees", employees);
279
   request.setAttribute ("employees", employees);
280
280
281
%>
281
%>
282
282
283
<html>
283
<html>
284
284
285
<head>
285
<head>
286
286
287
   <title>Jakarta Data Grid Taglib Example 5</title>
287
   <title>Jakarta Data Grid Taglib Example 5</title>
288
   
288
   
289
   <style>
289
   <style>
290
290
291
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
291
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
292
292
293
     .hiliterows    { background-color: #CDBD4F }
293
     .hiliterows    { background-color: #CDBD4F }
294
294
295
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
295
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
296
296
297
     .header        { background-color: #998B3B }
297
     .header        { background-color: #998B3B }
298
298
299
     .footer        { background-color: #998B3B }
299
     .footer        { background-color: #998B3B }
300
300
301
     .datagrid      { border: 1px solid #000000 }
301
     .datagrid      { border: 1px solid #000000 }
302
302
303
   </style>
303
   </style>
304
304
305
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
305
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
306
306
307
</head>
307
</head>
308
308
309
<body>
309
<body>
310
310
311
<h3>Example 5</h3>
311
<h3>Example 5</h3>
312
312
313
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0" scroll="true" width="600" height="100">
313
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0" scroll="true" width="600" height="100">
314
314
315
  <columns>
315
  <columns>
316
316
317
    <column width="100">
317
    <column width="100">
318
318
319
      <header value="Select" hAlign="center"/>
319
      <header value="Select" hAlign="center"/>
320
320
321
      <item   value="&lt;input type=&quot;checkbox&quot; name=&quot;employee&quot; value=&quot;${employee.firstName} ${employee.lastName}&quot;/&gt;" hAlign="center"/>
321
      <item   value="&lt;input type=&quot;checkbox&quot; name=&quot;employee&quot; value=&quot;${employee.firstName} ${employee.lastName}&quot;/&gt;" hAlign="center"/>
322
322
323
    </column>  
323
    </column>  
324
324
325
    <column width="100" order="true">
325
    <column width="100" order="true">
326
326
327
      <header value="Name" hAlign="center"/>
327
      <header value="Name" hAlign="center"/>
328
328
329
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left"/>
329
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left"/>
330
330
331
      <aggregate function="count" var="total"/>      
331
      <aggregate function="count" var="total"/>      
332
332
333
      <footer value="Total ${total}" hAlign="left"/>      
333
      <footer value="Total ${total}" hAlign="left"/>      
334
334
335
    </column>
335
    </column>
336
336
337
    <column width="200" order="true">
337
    <column width="200" order="true">
338
338
339
      <header value="Salary" hAlign="center"/>
339
      <header value="Salary" hAlign="center"/>
340
340
341
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
341
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
342
342
343
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
343
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
344
344
345
      <footer value="Average ${total}" hAlign="right"/>
345
      <footer value="Average ${total}" hAlign="right"/>
346
346
347
    </column>
347
    </column>
348
348
349
    <column width="200" order="true">
349
    <column width="200" order="true">
350
350
351
      <header value="Bonus" hAlign="center"/>
351
      <header value="Bonus" hAlign="center"/>
352
352
353
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
353
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
354
354
355
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
355
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
356
356
357
      <footer value="Average ${total}" hAlign="right"/>
357
      <footer value="Average ${total}" hAlign="right"/>
358
358
359
    </column>
359
    </column>
360
360
361
  </columns>
361
  </columns>
362
362
363
  <header        styleClass="header" show="true"/>
363
  <header        styleClass="header" show="true"/>
364
364
365
  <footer        styleClass="footer" show="true"/>
365
  <footer        styleClass="footer" show="true"/>
366
366
367
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
367
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
368
368
369
  <alternateRows styleClass="alternaterows"/>
369
  <alternateRows styleClass="alternaterows"/>
370
370
371
</ui:dataGrid>
371
</ui:dataGrid>
372
372
373
<p><a href="index.jsp">Back to index</a></p>
373
<p><a href="index.jsp">Back to index</a></p>
374
374
375
</body>
375
</body>
376
376
377
</html>
377
</html>
378
(-)examples/web/example6.jsp (-386 / +385 lines)
Lines 1-386 Link Here
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
2
3
<html>
3
<html>
4
4
5
<head>
5
<head>
6
6
7
   <title>Jakarta Data Grid Taglib Example</title>
7
   <title>Jakarta Data Grid Taglib Example</title>
8
8
9
</head>
9
</head>
10
10
11
<%@ page contentType="text/html"%>
11
<%@ page contentType="text/html"%>
12
12
13
<%@ page import="java.util.ArrayList" %>
13
<%@ page import="java.util.ArrayList" %>
14
14
15
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
15
<%@ taglib uri="http://jakarta.apache.org/taglibs/datagrid-1.0" prefix="ui" %>
16
16
17
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
17
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
18
18
19
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
19
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
20
20
21
<%! public static class Employee
21
<%! public static class Employee
22
22
23
    {
23
    {
24
24
25
      protected String firstName;
25
      protected String firstName;
26
26
27
      protected String lastName;
27
      protected String lastName;
28
28
29
      protected double salary;
29
      protected double salary;
30
30
31
      protected double bonus;
31
      protected double bonus;
32
32
33
33
34
34
35
      public String getFirstName ()
35
      public String getFirstName ()
36
36
37
      {
37
      {
38
38
39
        return (firstName);
39
        return (firstName);
40
40
41
      }
41
      }
42
42
43
43
44
44
45
      public String getLastName ()
45
      public String getLastName ()
46
46
47
      {
47
      {
48
48
49
        return (lastName);
49
        return (lastName);
50
50
51
      }      
51
      }      
52
52
53
53
54
54
55
      public double getSalary ()
55
      public double getSalary ()
56
56
57
      {
57
      {
58
58
59
        return (salary);
59
        return (salary);
60
60
61
      }            
61
      }            
62
62
63
63
64
64
65
      public double getBonus ()
65
      public double getBonus ()
66
66
67
      {
67
      {
68
68
69
        return (bonus);
69
        return (bonus);
70
70
71
      }                  
71
      }                  
72
72
73
73
74
74
75
      public void setFirstName (String newFirstName)
75
      public void setFirstName (String newFirstName)
76
76
77
      {
77
      {
78
78
79
        firstName = newFirstName;
79
        firstName = newFirstName;
80
80
81
      }
81
      }
82
82
83
83
84
84
85
      public void setLastName (String newLastName)
85
      public void setLastName (String newLastName)
86
86
87
      {
87
      {
88
88
89
        lastName = newLastName;
89
        lastName = newLastName;
90
90
91
      }
91
      }
92
92
93
93
94
94
95
      public void setSalary (double newSalary)
95
      public void setSalary (double newSalary)
96
96
97
      {
97
      {
98
98
99
        salary = newSalary;
99
        salary = newSalary;
100
100
101
      }
101
      }
102
102
103
103
104
104
105
      public void setBonus (double newBonus)
105
      public void setBonus (double newBonus)
106
106
107
      {
107
      {
108
108
109
        bonus = newBonus;
109
        bonus = newBonus;
110
110
111
      }      
111
      }      
112
112
113
    }
113
    }
114
114
115
%>
115
%>
116
116
117
<% ArrayList employees;
117
<% ArrayList employees;
118
118
119
   Employee  employee;
119
   Employee  employee;
120
120
121
121
122
122
123
   employees = new ArrayList ();
123
   employees = new ArrayList ();
124
124
125
   
125
   
126
126
127
   employee = new Employee ();
127
   employee = new Employee ();
128
128
129
   employee.setFirstName ("Peter");
129
   employee.setFirstName ("Peter");
130
130
131
   employee.setLastName  ("Jackson");   
131
   employee.setLastName  ("Jackson");   
132
132
133
   employee.setSalary    (120000);
133
   employee.setSalary    (120000);
134
134
135
   employee.setBonus     (20000);
135
   employee.setBonus     (20000);
136
136
137
   employees.add (employee);
137
   employees.add (employee);
138
138
139
139
140
140
141
   employee = new Employee ();
141
   employee = new Employee ();
142
142
143
   employee.setFirstName ("John");
143
   employee.setFirstName ("John");
144
144
145
   employee.setLastName  ("Woo");   
145
   employee.setLastName  ("Woo");   
146
146
147
   employee.setSalary    (100000);
147
   employee.setSalary    (100000);
148
148
149
   employee.setBonus     (17000);
149
   employee.setBonus     (17000);
150
150
151
   employees.add (employee);
151
   employees.add (employee);
152
152
153
153
154
154
155
   employee = new Employee ();
155
   employee = new Employee ();
156
156
157
   employee.setFirstName ("George");
157
   employee.setFirstName ("George");
158
158
159
   employee.setLastName  ("Lucas");   
159
   employee.setLastName  ("Lucas");   
160
160
161
   employee.setSalary    (150000);
161
   employee.setSalary    (150000);
162
162
163
   employee.setBonus     (23000);
163
   employee.setBonus     (23000);
164
164
165
   employees.add (employee);
165
   employees.add (employee);
166
166
167
167
168
168
169
   employee = new Employee ();
169
   employee = new Employee ();
170
170
171
   employee.setFirstName ("Michael");
171
   employee.setFirstName ("Michael");
172
172
173
   employee.setLastName  ("Kain");   
173
   employee.setLastName  ("Kain");   
174
174
175
   employee.setSalary    (100000);
175
   employee.setSalary    (100000);
176
176
177
   employee.setBonus     (10000);
177
   employee.setBonus     (10000);
178
178
179
   employees.add (employee);
179
   employees.add (employee);
180
180
181
181
182
182
183
   employee = new Employee ();
183
   employee = new Employee ();
184
184
185
   employee.setFirstName ("John");
185
   employee.setFirstName ("John");
186
186
187
   employee.setLastName  ("Doe");   
187
   employee.setLastName  ("Doe");   
188
188
189
   employee.setSalary    (110000);
189
   employee.setSalary    (110000);
190
190
191
   employee.setBonus     (11000);
191
   employee.setBonus     (11000);
192
192
193
   employees.add (employee);
193
   employees.add (employee);
194
194
195
195
196
196
197
   employee = new Employee ();
197
   employee = new Employee ();
198
198
199
   employee.setFirstName ("Jim");
199
   employee.setFirstName ("Jim");
200
200
201
   employee.setLastName  ("Carrey");   
201
   employee.setLastName  ("Carrey");   
202
202
203
   employee.setSalary    (110000);
203
   employee.setSalary    (110000);
204
204
205
   employee.setBonus     (11000);
205
   employee.setBonus     (11000);
206
206
207
   employees.add (employee);
207
   employees.add (employee);
208
208
209
209
210
210
211
   employee = new Employee ();
211
   employee = new Employee ();
212
212
213
   employee.setFirstName ("Sean");
213
   employee.setFirstName ("Sean");
214
214
215
   employee.setLastName  ("Penn");   
215
   employee.setLastName  ("Penn");   
216
216
217
   employee.setSalary    (150000);
217
   employee.setSalary    (150000);
218
218
219
   employee.setBonus     (13000);
219
   employee.setBonus     (13000);
220
220
221
   employees.add (employee);
221
   employees.add (employee);
222
222
223
223
224
224
225
   employee = new Employee ();
225
   employee = new Employee ();
226
226
227
   employee.setFirstName ("Charlize");
227
   employee.setFirstName ("Charlize");
228
228
229
   employee.setLastName  ("Theron");   
229
   employee.setLastName  ("Theron");   
230
230
231
   employee.setSalary    (200000);
231
   employee.setSalary    (200000);
232
232
233
   employee.setBonus     (11000);
233
   employee.setBonus     (11000);
234
234
235
   employees.add (employee);
235
   employees.add (employee);
236
236
237
237
238
238
239
   employee = new Employee ();
239
   employee = new Employee ();
240
240
241
   employee.setFirstName ("Tom");
241
   employee.setFirstName ("Tom");
242
242
243
   employee.setLastName  ("Hanks");   
243
   employee.setLastName  ("Hanks");   
244
244
245
   employee.setSalary    (190000);
245
   employee.setSalary    (190000);
246
246
247
   employee.setBonus     (10000);
247
   employee.setBonus     (10000);
248
248
249
   employees.add (employee);
249
   employees.add (employee);
250
250
251
251
252
252
253
   employee = new Employee ();
253
   employee = new Employee ();
254
254
255
   employee.setFirstName ("Edward");
255
   employee.setFirstName ("Edward");
256
256
257
   employee.setLastName  ("Norton");   
257
   employee.setLastName  ("Norton");   
258
258
259
   employee.setSalary    (180000);
259
   employee.setSalary    (180000);
260
260
261
   employee.setBonus     (13000);
261
   employee.setBonus     (13000);
262
262
263
   employees.add (employee);
263
   employees.add (employee);
264
264
265
265
266
266
267
   employee = new Employee ();
267
   employee = new Employee ();
268
268
269
   employee.setFirstName ("Gary");
269
   employee.setFirstName ("Gary");
270
270
271
   employee.setLastName  ("Oldman");   
271
   employee.setLastName  ("Oldman");   
272
272
273
   employee.setSalary    (180000);
273
   employee.setSalary    (180000);
274
274
275
   employee.setBonus     (13000);
275
   employee.setBonus     (13000);
276
276
277
   employees.add (employee);
277
   employees.add (employee);
278
278
279
279
280
280
281
   request.setAttribute ("employees", employees);
281
   request.setAttribute ("employees", employees);
282
282
283
%>
283
%>
284
284
285
<html>
285
<html>
286
286
287
<head>
287
<head>
288
288
289
   <title>Jakarta Data Grid Taglib Example 6</title>
289
   <title>Jakarta Data Grid Taglib Example 6</title>
290
   
290
   
291
   <style>
291
   <style>
292
292
293
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
293
     .rows          { background-color: #EDD98A; border: 1px solid #000000 }
294
294
295
     .hiliterows    { background-color: #CDBD4F }
295
     .hiliterows    { background-color: #CDBD4F }
296
296
297
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
297
     .alternaterows { background-color: #D3C971; border: 1px solid #000000 }
298
298
299
     .header        { background-color: #998B3B }
299
     .header        { background-color: #998B3B }
300
300
301
     .footer        { background-color: #998B3B }
301
     .footer        { background-color: #998B3B }
302
302
303
     .datagrid      { border: 1px solid #000000 }
303
     .datagrid      { border: 1px solid #000000 }
304
304
305
   </style>
305
   </style>
306
306
307
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
307
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
308
308
309
</head>
309
</head>
310
310
311
<body>
311
<body>
312
312
313
<h3>Example 6</h3>
313
<h3>Example 6</h3>
314
314
315
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0">
315
<ui:dataGrid items="${employees}" var="employee" name="datagrid1" cellPadding="0" cellSpacing="0">
316
316
317
  <columns>
317
  <columns>
318
318
319
    <column width="100" order="true">
319
    <column width="100" order="true">
320
    
320
    
321
      <header value="Name" hAlign="center"/>
321
      <header value="Name" hAlign="center"/>
322
      
322
      
323
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left" hyperLink="http://www.imdb.com/find?tt=on;nm=on;mx=20;q=${employee.firstName}%20${employee.lastName}" hyperLinkTarget="_blank"/>
323
      <item   value="${employee.firstName} ${employee.lastName}" hAlign="left" hyperLink="http://www.imdb.com/find?tt=on;nm=on;mx=20;q=${employee.firstName}%20${employee.lastName}" hyperLinkTarget="_blank"/>
324
324
325
      <aggregate function="count" var="total"/>
325
      <aggregate function="count" var="total"/>
326
      
326
      
327
      <footer value="Total ${total}" hAlign="left"/>      
327
      <footer value="Total ${total}" hAlign="left"/>      
328
      
328
      
329
    </column>
329
    </column>
330
330
331
    <column width="200" order="true">
331
    <column width="200" order="true">
332
332
333
      <header value="Salary" hAlign="center"/>
333
      <header value="Salary" hAlign="center"/>
334
334
335
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
335
      <item   value="${employee.salary}" hAlign="right" pattern="#,##0.00"/>
336
336
337
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
337
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
338
338
339
      <footer value="Average ${total}" hAlign="right"/>
339
      <footer value="Average ${total}" hAlign="right"/>
340
340
341
    </column>
341
    </column>
342
342
343
    <column width="200" order="true">
343
    <column width="200" order="true">
344
344
345
      <header value="Bonus" hAlign="center"/>
345
      <header value="Bonus" hAlign="center"/>
346
346
347
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
347
      <item   value="${employee.bonus}" hAlign="right" pattern="#,##0.00"/>
348
348
349
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
349
      <aggregate function="avg" pattern="#,##0.00" var="total"/>      
350
350
351
      <footer value="Average ${total}" hAlign="right"/>
351
      <footer value="Average ${total}" hAlign="right"/>
352
352
353
    </column>
353
    </column>
354
354
355
  </columns>
355
  </columns>
356
356
357
  <header        styleClass="header" show="true"/>
357
  <header        styleClass="header" show="true"/>
358
358
359
  <footer        styleClass="footer" show="true"/>
359
  <footer        styleClass="footer" show="true"/>
360
360
361
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
361
  <rows          styleClass="rows" hiliteStyleClass="hiliterows"/>
362
362
363
  <alternateRows styleClass="alternaterows"/>
363
  <alternateRows styleClass="alternaterows"/>
364
364
365
  <paging        size="4" nextUrlVar="next" previousUrlVar="previous"/>
365
  <paging        size="4" nextUrlVar="next" previousUrlVar="previous"/>
366
366
367
</ui:dataGrid>
367
</ui:dataGrid>
368
368
369
<c:if test="${previous != null}">
369
<c:if test="${previous != null}">
370
370
371
<a href="<c:out value="${previous}"/>">Previous</a>
371
<a href="<c:out value="${previous}"/>">Previous</a>
372
372
373
</c:if>
373
</c:if>
374
374
375
<c:if test="${next != null}">
375
<c:if test="${next != null}">
376
376
377
<a href="<c:out value="${next}"/>">Next</a>
377
<a href="<c:out value="${next}"/>">Next</a>
378
378
379
</c:if>
379
</c:if>
380
380
381
<p><a href="index.jsp">Back to index</a></p>
381
<p><a href="index.jsp">Back to index</a></p>
382
382
383
</body>
383
</body>
384
384
385
</html>
385
</html>
386
(-)src/org/apache/taglibs/datagrid/Column.java (-244 / +268 lines)
Lines 1-244 Link Here
1
/*
1
/*
2
 * Copyright 2004 The Apache Software Foundation.
2
 * Copyright 2004 The Apache Software Foundation.
3
 * 
3
 * 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
6
 * You may obtain a copy of the License at
7
 * 
7
 * 
8
 *      http://www.apache.org/licenses/LICENSE-2.0
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 * 
9
 * 
10
 * Unless required by applicable law or agreed to in writing, software
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
14
 * limitations under the License.
15
 */
15
 */
16
package org.apache.taglibs.datagrid;
16
package org.apache.taglibs.datagrid;
17
17
18
import java.util.ArrayList;
18
import java.util.ArrayList;
19
import java.util.List;
19
import java.util.List;
20
20
21
/**
21
/**
22
 * Class that stores a column definition of a data grid.
22
 * Class that stores a column definition of a data grid.
23
 *
23
 *
24
 * @see DataGridTag
24
 * @see DataGridTag
25
 */
25
 */
26
26
27
public class Column 
27
public class Column 
28
{
28
{
29
  protected ArrayList     aggregates = new ArrayList ();
29
  private ArrayList     aggregates = new ArrayList ();
30
  protected String        itemStyleClass;
30
  private String        itemStyleClass;
31
  protected String        headerStyleClass;
31
  private String        headerStyleClass;
32
  protected String        width;
32
  private String        width;
33
  protected String        itemValue;
33
  private String        itemValue;
34
  protected String        headerValue;
34
  private String        headerValue;
35
  protected String        footerStyleClass;
35
  private String        footerStyleClass;
36
  protected String        footerValue;
36
  private String        footerValue;
37
  protected String        itemHyperLinkValue;
37
  private String        itemHyperLinkValue;
38
  protected String        headerHorizontalAlign;
38
  private String        headerHorizontalAlign;
39
  protected String        headerVerticalAlign;
39
  private String        headerVerticalAlign;
40
  protected String        footerHorizontalAlign;
40
  private String        footerHorizontalAlign;
41
  protected String        footerVerticalAlign;
41
  private String        footerVerticalAlign;
42
  protected String        itemHorizontalAlign;
42
  private String        itemHorizontalAlign;
43
  protected String        itemVerticalAlign;
43
  private String        itemVerticalAlign;
44
  protected String []     itemHyperLinkValues;
44
  private String        itemPattern;
45
  protected String        itemPattern;
45
  private String        totalPattern;
46
  protected String        totalPattern;
46
  private String        itemHyperLinkTarget;
47
  protected String        itemHyperLinkTarget;
47
  private boolean       order;
48
  protected boolean       order;
48
  private String        footerStyle;
49
49
  private String        headerStyle;
50
  public Column()
50
  private String        itemStyle;
51
  {
51
52
  }
52
  public Column()
53
53
  {
54
  public String getItemStyleClass()
54
  }
55
  {
55
56
    return itemStyleClass;
56
  public String getItemStyleClass()
57
  }
57
  {
58
58
    return itemStyleClass;
59
  public void setItemStyleClass(String newItemStyleClass)
59
  }
60
  {
60
61
    itemStyleClass = newItemStyleClass;
61
  public void setItemStyleClass(String newItemStyleClass)
62
  }
62
  {
63
63
    itemStyleClass = newItemStyleClass;
64
  public String getHeaderStyleClass()
64
  }
65
  {
65
66
    return headerStyleClass;
66
  public String getHeaderStyleClass()
67
  }
67
  {
68
68
    return headerStyleClass;
69
  public void setHeaderStyleClass(String newHeaderStyleClass)
69
  }
70
  {
70
71
    headerStyleClass = newHeaderStyleClass;
71
  public void setHeaderStyleClass(String newHeaderStyleClass)
72
  }
72
  {
73
73
    headerStyleClass = newHeaderStyleClass;
74
  public String getWidth()
74
  }
75
  {
75
76
    return width;
76
  public String getWidth()
77
  }
77
  {
78
78
    return width;
79
  public void setWidth(String newWidth)
79
  }
80
  {
80
81
    width = newWidth;
81
  public void setWidth(String newWidth)
82
  }
82
  {
83
83
    width = newWidth;
84
  public String getItemValue()
84
  }
85
  {
85
86
    return itemValue;
86
  public String getItemValue()
87
  }
87
  {
88
88
    return itemValue;
89
  public void setItemValue(String newItemValue)
89
  }
90
  {
90
91
    itemValue = newItemValue;
91
  public void setItemValue(String newItemValue)
92
  }
92
  {
93
93
    itemValue = newItemValue;
94
94
  }
95
  public String getHeaderValue()
95
96
  {
96
97
    return headerValue;
97
  public String getHeaderValue()
98
  }
98
  {
99
99
    return headerValue;
100
  public void setHeaderValue(String newHeaderValue)
100
  }
101
  {
101
102
    headerValue = newHeaderValue;
102
  public void setHeaderValue(String newHeaderValue)
103
  }
103
  {
104
104
    headerValue = newHeaderValue;
105
  public String getFooterStyleClass()
105
  }
106
  {
106
107
    return footerStyleClass;
107
  public String getFooterStyleClass()
108
  }
108
  {
109
109
    return footerStyleClass;
110
  public void setFooterStyleClass(String newFooterStyleClass)
110
  }
111
  {
111
112
    footerStyleClass = newFooterStyleClass;
112
  public void setFooterStyleClass(String newFooterStyleClass)
113
  }
113
  {
114
114
    footerStyleClass = newFooterStyleClass;
115
  public String getFooterValue()
115
  }
116
  {
116
117
    return footerValue;
117
  public String getFooterValue()
118
  }
118
  {
119
119
    return footerValue;
120
  public void setFooterValue(String newFooterValue)
120
  }
121
  {
121
122
    footerValue = newFooterValue;
122
  public void setFooterValue(String newFooterValue)
123
  }
123
  {
124
124
    footerValue = newFooterValue;
125
  public String getItemHyperLinkValue()
125
  }
126
  {
126
127
    return itemHyperLinkValue;
127
  public String getItemHyperLinkValue()
128
  }
128
  {
129
129
    return itemHyperLinkValue;
130
  public void setItemHyperLinkValue(String newItemHyperLinkValue)
130
  }
131
  {
131
132
    itemHyperLinkValue = newItemHyperLinkValue;
132
  public void setItemHyperLinkValue(String newItemHyperLinkValue)
133
  }
133
  {
134
134
    itemHyperLinkValue = newItemHyperLinkValue;
135
  public String getHeaderHorizontalAlign()
135
  }
136
  {
136
137
    return headerHorizontalAlign;
137
  public String getHeaderHorizontalAlign()
138
  }
138
  {
139
139
    return headerHorizontalAlign;
140
  public void setHeaderHorizontalAlign(String newHeaderHorizontalAlign)
140
  }
141
  {
141
142
    headerHorizontalAlign = newHeaderHorizontalAlign;
142
  public void setHeaderHorizontalAlign(String newHeaderHorizontalAlign)
143
  }
143
  {
144
144
    headerHorizontalAlign = newHeaderHorizontalAlign;
145
  public String getHeaderVerticalAlign()
145
  }
146
  {
146
147
    return headerVerticalAlign;
147
  public String getHeaderVerticalAlign()
148
  }
148
  {
149
149
    return headerVerticalAlign;
150
  public void setHeaderVerticalAlign(String newHeaderVerticalAlign)
150
  }
151
  {
151
152
    headerVerticalAlign = newHeaderVerticalAlign;
152
  public void setHeaderVerticalAlign(String newHeaderVerticalAlign)
153
  }
153
  {
154
154
    headerVerticalAlign = newHeaderVerticalAlign;
155
  public String getFooterHorizontalAlign()
155
  }
156
  {
156
157
    return footerHorizontalAlign;
157
  public String getFooterHorizontalAlign()
158
  }
158
  {
159
159
    return footerHorizontalAlign;
160
  public void setFooterHorizontalAlign(String newFooterHorizontalAlign)
160
  }
161
  {
161
162
    footerHorizontalAlign = newFooterHorizontalAlign;
162
  public void setFooterHorizontalAlign(String newFooterHorizontalAlign)
163
  }
163
  {
164
164
    footerHorizontalAlign = newFooterHorizontalAlign;
165
  public String getFooterVerticalAlign()
165
  }
166
  {
166
167
    return footerVerticalAlign;
167
  public String getFooterVerticalAlign()
168
  }
168
  {
169
169
    return footerVerticalAlign;
170
  public void setFooterVerticalAlign(String newFooterVerticalAlign)
170
  }
171
  {
171
172
    footerVerticalAlign = newFooterVerticalAlign;
172
  public void setFooterVerticalAlign(String newFooterVerticalAlign)
173
  }
173
  {
174
174
    footerVerticalAlign = newFooterVerticalAlign;
175
  public String getItemHorizontalAlign()
175
  }
176
  {
176
177
    return itemHorizontalAlign;
177
  public String getItemHorizontalAlign()
178
  }
178
  {
179
179
    return itemHorizontalAlign;
180
  public void setItemHorizontalAlign(String newItemHorizontalAlign)
180
  }
181
  {
181
182
    itemHorizontalAlign = newItemHorizontalAlign;
182
  public void setItemHorizontalAlign(String newItemHorizontalAlign)
183
  }
183
  {
184
184
    itemHorizontalAlign = newItemHorizontalAlign;
185
  public String getItemVerticalAlign()
185
  }
186
  {
186
187
    return itemVerticalAlign;
187
  public String getItemVerticalAlign()
188
  }
188
  {
189
189
    return itemVerticalAlign;
190
  public void setItemVerticalAlign(String newItemVerticalAlign)
190
  }
191
  {
191
192
    itemVerticalAlign = newItemVerticalAlign;
192
  public void setItemVerticalAlign(String newItemVerticalAlign)
193
  }
193
  {
194
194
    itemVerticalAlign = newItemVerticalAlign;
195
  public String [] getItemHyperLinkValues()
195
  }
196
  {
196
197
    return itemHyperLinkValues;
197
198
  }
198
199
199
  public String getItemPattern()
200
  public void setItemHyperLinkValues (String [] newItemHyperLinkValues)
200
  {
201
  {
201
    return itemPattern;
202
    itemHyperLinkValues = newItemHyperLinkValues;
202
  }
203
  }
203
204
204
  public void setItemPattern(String newItemPattern)
205
  public String getItemPattern()
205
  {
206
  {
206
    itemPattern = newItemPattern;
207
    return itemPattern;
207
  }
208
  }
208
209
209
  public String getItemHyperLinkTarget()
210
  public void setItemPattern(String newItemPattern)
210
  {
211
  {
211
    return itemHyperLinkTarget;
212
    itemPattern = newItemPattern;
212
  }
213
  }
213
214
214
  public void setItemHyperLinkTarget(String newItemHyperLinkTarget)
215
  public String getItemHyperLinkTarget()
215
  {
216
  {
216
    itemHyperLinkTarget = newItemHyperLinkTarget;
217
    return itemHyperLinkTarget;
217
  }
218
  }
218
219
219
  public boolean isOrder()
220
  public void setItemHyperLinkTarget(String newItemHyperLinkTarget)
220
  {
221
  {
221
    return order;
222
    itemHyperLinkTarget = newItemHyperLinkTarget;
222
  }
223
  }
223
224
224
  public void setOrder(boolean newOrder)
225
  public boolean isOrder()
225
  {
226
  {
226
    order = newOrder;
227
    return order;
227
  }
228
  }
228
229
229
  public ArrayList getAggregates ()
230
  public void setOrder(boolean newOrder)
230
  {
231
  {
231
    return aggregates;
232
    order = newOrder;
232
  }
233
  }
233
234
234
  public void setAggregates (ArrayList newAggregates)
235
  public ArrayList getAggregates ()
235
  {
236
  {
236
    aggregates = newAggregates;
237
    return aggregates;
237
  }
238
  }
238
239
239
  public String getFooterStyle()
240
  public void setAggregates (ArrayList newAggregates)
240
  {
241
  {
241
    return footerStyle;
242
    aggregates = newAggregates;
242
  }
243
  }
243
244
}
244
  public void setFooterStyle(String newFooterStyle)
245
  {
246
    footerStyle = newFooterStyle;
247
  }
248
249
  public String getHeaderStyle()
250
  {
251
    return headerStyle;
252
  }
253
254
  public void setHeaderStyle(String newHeaderStyle)
255
  {
256
    headerStyle = newHeaderStyle;
257
  }
258
259
  public String getItemStyle()
260
  {
261
    return itemStyle;
262
  }
263
264
  public void setItemStyle(String newItemStyle)
265
  {
266
    itemStyle = newItemStyle;
267
  }
268
}
(-)src/org/apache/taglibs/datagrid/DataGridTag.java (-50 / +88 lines)
Lines 115-128 Link Here
115
  private boolean     scroll;
115
  private boolean     scroll;
116
  private Collection  items;
116
  private Collection  items;
117
  private int         sizeItems;
117
  private int         sizeItems;
118
  private Object [][] values;
118
  private Cell [][]   cells;
119
  private String      itemVar;
119
  private String      itemVar;
120
  private ArrayList   columns;
120
  private ArrayList   columns;
121
  private String      headerStyle;
121
  private String      headerStyleClass;
122
  private String      headerStyleClass;
123
  private String      footerStyle;
122
  private String      footerStyleClass;
124
  private String      footerStyleClass;
125
  private String      rowsStyle;
123
  private String      rowsStyleClass;
126
  private String      rowsStyleClass;
127
  private String      rowsHiliteStyle;
124
  private String      rowsHiliteStyleClass;
128
  private String      rowsHiliteStyleClass;
129
  private String      alternateRowsStyle;
125
  private String      alternateRowsStyleClass;
130
  private String      alternateRowsStyleClass;
131
  private String      alternateRowsHiliteStyle;  
126
  private String      alternateRowsHiliteStyleClass;  
132
  private String      alternateRowsHiliteStyleClass;  
127
  private String      height;
133
  private String      height;
128
  private String      width;
134
  private String      width;
Lines 130-135 Link Here
130
  private boolean     footerShow;
136
  private boolean     footerShow;
131
  private String      cellPadding;
137
  private String      cellPadding;
132
  private String      cellSpacing;
138
  private String      cellSpacing;
139
  private String      style;
133
  private String      styleClass;
140
  private String      styleClass;
134
  private String      name;
141
  private String      name;
135
  private String      parameterNameOrderIndex;
142
  private String      parameterNameOrderIndex;
Lines 234-255 Link Here
234
        
241
        
235
        if      (element.getNodeName ().equals ("header"))
242
        if      (element.getNodeName ().equals ("header"))
236
        {
243
        {
244
          if (element.hasAttribute ("style"))      headerStyle      = element.getAttribute ("style");
237
          if (element.hasAttribute ("styleClass")) headerStyleClass = element.getAttribute ("styleClass");
245
          if (element.hasAttribute ("styleClass")) headerStyleClass = element.getAttribute ("styleClass");
238
          if (element.hasAttribute ("show"))       headerShow       = element.getAttribute ("show").equals ("true");
246
          if (element.hasAttribute ("show"))       headerShow       = element.getAttribute ("show").equals ("true");
239
        }
247
        }
240
        else if (element.getNodeName ().equals ("footer"))
248
        else if (element.getNodeName ().equals ("footer"))
241
        {
249
        {
250
          if (element.hasAttribute ("style"))      footerStyle      = element.getAttribute ("style");
242
          if (element.hasAttribute ("styleClass")) footerStyleClass = element.getAttribute ("styleClass");
251
          if (element.hasAttribute ("styleClass")) footerStyleClass = element.getAttribute ("styleClass");
243
          if (element.hasAttribute ("show"))       footerShow       = element.getAttribute ("show").equals ("true");
252
          if (element.hasAttribute ("show"))       footerShow       = element.getAttribute ("show").equals ("true");
244
        }
253
        }
245
        else if (element.getNodeName ().equals ("rows"))
254
        else if (element.getNodeName ().equals ("rows"))
246
        {
255
        {
256
          if (element.hasAttribute ("style"))            rowsStyle            = element.getAttribute ("style");                
247
          if (element.hasAttribute ("styleClass"))       rowsStyleClass       = element.getAttribute ("styleClass");        
257
          if (element.hasAttribute ("styleClass"))       rowsStyleClass       = element.getAttribute ("styleClass");        
258
          if (element.hasAttribute ("hiliteStyle"))      rowsHiliteStyle      = element.getAttribute ("hiliteStyle");                  
248
          if (element.hasAttribute ("hiliteStyleClass")) rowsHiliteStyleClass = element.getAttribute ("hiliteStyleClass");                  
259
          if (element.hasAttribute ("hiliteStyleClass")) rowsHiliteStyleClass = element.getAttribute ("hiliteStyleClass");                  
249
        }
260
        }
250
        else if (element.getNodeName ().equals ("alternateRows"))
261
        else if (element.getNodeName ().equals ("alternateRows"))
251
        {
262
        {
263
          if (element.hasAttribute ("style"))            alternateRowsStyle            = element.getAttribute ("style");
252
          if (element.hasAttribute ("styleClass"))       alternateRowsStyleClass       = element.getAttribute ("styleClass");
264
          if (element.hasAttribute ("styleClass"))       alternateRowsStyleClass       = element.getAttribute ("styleClass");
265
          if (element.hasAttribute ("hiliteStyle"))      alternateRowsHiliteStyle      = element.getAttribute ("hiliteStyle");                            
253
          if (element.hasAttribute ("hiliteStyleClass")) alternateRowsHiliteStyleClass = element.getAttribute ("hiliteStyleClass");                            
266
          if (element.hasAttribute ("hiliteStyleClass")) alternateRowsHiliteStyleClass = element.getAttribute ("hiliteStyleClass");                            
254
        }
267
        }
255
        else if (element.getNodeName ().equals ("paging"))
268
        else if (element.getNodeName ().equals ("paging"))
Lines 283-288 Link Here
283
                
296
                
284
                if      (element.getNodeName ().equals ("header"))
297
                if      (element.getNodeName ().equals ("header"))
285
                {
298
                {
299
                  if (element.hasAttribute ("style"))      column.setHeaderStyleClass      (element.getAttribute ("style"));
286
                  if (element.hasAttribute ("styleClass")) column.setHeaderStyleClass      (element.getAttribute ("styleClass"));
300
                  if (element.hasAttribute ("styleClass")) column.setHeaderStyleClass      (element.getAttribute ("styleClass"));
287
                  if (element.hasAttribute ("value"))      column.setHeaderValue           (element.getAttribute ("value"));
301
                  if (element.hasAttribute ("value"))      column.setHeaderValue           (element.getAttribute ("value"));
288
                  if (element.hasAttribute ("hAlign"))     column.setHeaderHorizontalAlign (element.getAttribute ("hAlign"));
302
                  if (element.hasAttribute ("hAlign"))     column.setHeaderHorizontalAlign (element.getAttribute ("hAlign"));
Lines 290-309 Link Here
290
                }
304
                }
291
                else if (element.getNodeName ().equals ("item"))
305
                else if (element.getNodeName ().equals ("item"))
292
                {
306
                {
293
                  if (element.hasAttribute ("styleClass")) column.setItemStyleClass      (element.getAttribute ("styleClass"));
307
                  if (element.hasAttribute ("style"))           column.setItemStyleClass      (element.getAttribute ("style"));
294
                  if (element.hasAttribute ("value"))      column.setItemValue           (element.getAttribute ("value"));
308
                  if (element.hasAttribute ("styleClass"))      column.setItemStyleClass      (element.getAttribute ("styleClass"));
295
                  if (element.hasAttribute ("pattern"))    column.setItemPattern         (element.getAttribute ("pattern"));
309
                  if (element.hasAttribute ("value"))           column.setItemValue           (element.getAttribute ("value"));
296
                  if (element.hasAttribute ("hAlign"))     column.setItemHorizontalAlign (element.getAttribute ("hAlign"));
310
                  if (element.hasAttribute ("pattern"))         column.setItemPattern         (element.getAttribute ("pattern"));
297
                  if (element.hasAttribute ("vAlign"))     column.setItemVerticalAlign   (element.getAttribute ("vAlign"));
311
                  if (element.hasAttribute ("hAlign"))          column.setItemHorizontalAlign (element.getAttribute ("hAlign"));
298
                  if (element.hasAttribute ("hyperLink")) 
312
                  if (element.hasAttribute ("vAlign"))          column.setItemVerticalAlign   (element.getAttribute ("vAlign"));
299
                  {
313
                  if (element.hasAttribute ("hyperLink"))       column.setItemHyperLinkValue  (element.getAttribute ("hyperLink"));
300
                    column.setItemHyperLinkValue  (element.getAttribute ("hyperLink"));
301
                    column.setItemHyperLinkValues (new String [sizeItems]);
302
                  }
303
                  if (element.hasAttribute ("hyperLinkTarget")) column.setItemHyperLinkTarget (element.getAttribute ("hyperLinkTarget"));
314
                  if (element.hasAttribute ("hyperLinkTarget")) column.setItemHyperLinkTarget (element.getAttribute ("hyperLinkTarget"));
304
                }
315
                }
305
                else if (element.getNodeName ().equals ("footer"))
316
                else if (element.getNodeName ().equals ("footer"))
306
                {
317
                {
318
                  if (element.hasAttribute ("style"))      column.setFooterStyleClass      (element.getAttribute ("style"));
307
                  if (element.hasAttribute ("styleClass")) column.setFooterStyleClass      (element.getAttribute ("styleClass"));
319
                  if (element.hasAttribute ("styleClass")) column.setFooterStyleClass      (element.getAttribute ("styleClass"));
308
                  if (element.hasAttribute ("value"))      column.setFooterValue           (element.getAttribute ("value"));
320
                  if (element.hasAttribute ("value"))      column.setFooterValue           (element.getAttribute ("value"));
309
                  if (element.hasAttribute ("hAlign"))     column.setFooterHorizontalAlign (element.getAttribute ("hAlign"));
321
                  if (element.hasAttribute ("hAlign"))     column.setFooterHorizontalAlign (element.getAttribute ("hAlign"));
Lines 333-369 Link Here
333
  private void calculateValues () throws Exception
345
  private void calculateValues () throws Exception
334
  {
346
  {
335
    Iterator  iterator;
347
    Iterator  iterator;
336
    Object [] itemValues;
348
    Cell []   rowCells;
337
    Object    value;
338
    Column    column;
349
    Column    column;
350
    Cell      cell;
339
    Format    format = null;
351
    Format    format = null;
340
    int       indexColumns, indexValues, indexAggregates, lengthAggregates, sizeColumns;
352
    int       indexColumn, indexRow, indexAggregate, sizeAggregates, sizeColumns;
341
353
342
    if (items != null)
354
    if (items != null)
343
    {    
355
    {    
344
      sizeColumns = columns.size ();
356
      sizeColumns = columns.size ();
345
      values      = new Object [sizeItems][sizeColumns];
357
      cells       = new Cell [sizeItems][sizeColumns];
346
      indexValues = 0;    
358
      indexRow    = 0;
359
347
      iterator    = items.iterator ();
360
      iterator    = items.iterator ();
348
      while (iterator.hasNext ())
361
      while (iterator.hasNext ())
349
      {
362
      {
350
        pageContext.setAttribute (itemVar, iterator.next ());
363
        pageContext.setAttribute (itemVar, iterator.next ());
351
364
352
        itemValues = values [indexValues];
365
        rowCells = cells [indexRow];
353
        for (indexColumns = 0; indexColumns < sizeColumns; indexColumns++)
366
        for (indexColumn = 0; indexColumn < sizeColumns; indexColumn++)
354
        {
367
        {
355
          column                    = (Column)columns.get(indexColumns);
368
          column                    = (Column) columns.get (indexColumn);
356
          value                     = ExpressionLanguageHelper.evalObject ("value", column.getItemValue (), this, pageContext);
369
          cell                      = new Cell ();
357
          itemValues [indexColumns] = value;
370
          cell.setValue (ExpressionLanguageHelper.evalObject ("value", column.getItemValue (), this, pageContext));
358
          
371
          if (column.getItemHyperLinkValue () != null) 
359
          lengthAggregates = column.getAggregates ().size ();
372
            cell.setHyperLink (ExpressionLanguageHelper.evalString ("hyperLink", column.getItemHyperLinkValue (), this, pageContext));
360
          for (indexAggregates = 0; indexAggregates < lengthAggregates; indexAggregates++)
361
            ((Aggregate) column.getAggregates ().get (indexAggregates)).getFunction ().addValue (value);
362
373
363
          if (column.getItemHyperLinkValue () != null) column.getItemHyperLinkValues () [indexValues] = org.apache.taglibs.datagrid.helper.ExpressionLanguageHelper.evalString ("hyperLink", column.getItemHyperLinkValue (), this, pageContext);
374
          rowCells [indexColumn] = cell;
375
          
376
          sizeAggregates = column.getAggregates ().size ();
377
          for (indexAggregate = 0; indexAggregate < sizeAggregates; indexAggregate++)
378
            ((Aggregate) column.getAggregates ().get (indexAggregate)).getFunction ().addValue (cell.getValue ());
364
        }
379
        }
365
380
366
        indexValues++;
381
        indexRow++;
367
      }
382
      }
368
383
369
      pageContext.removeAttribute (itemVar);
384
      pageContext.removeAttribute (itemVar);
Lines 377-386 Link Here
377
  {
392
  {
378
    ValueComparator comparator;
393
    ValueComparator comparator;
379
394
380
    if ((values != null) && (orderIndex != 0))
395
    if ((cells != null) && (orderIndex != 0))
381
    {
396
    {
382
      comparator = new ValueComparator (orderIndex);
397
      comparator = new ValueComparator (orderIndex);
383
      Arrays.sort (values, comparator);
398
      Arrays.sort (cells, comparator);
384
    }
399
    }
385
  }
400
  }
386
  
401
  
Lines 447-452 Link Here
447
      tableStart.append (styleClass);
462
      tableStart.append (styleClass);
448
      tableStart.append ("\"");
463
      tableStart.append ("\"");
449
    }
464
    }
465
    if (style  != null) 
466
    {
467
      tableStart.append (" style=\"");
468
      tableStart.append (style);
469
      tableStart.append ("\"");
470
    }
450
    if (cellPadding != null) 
471
    if (cellPadding != null) 
451
    {
472
    {
452
      tableStart.append (" cellpadding=\"");
473
      tableStart.append (" cellpadding=\"");
Lines 477-511 Link Here
477
  {
498
  {
478
    Iterator  iterator;
499
    Iterator  iterator;
479
    Column    column;
500
    Column    column;
480
    Object [] itemValues;
501
    Cell []   rowCells;
481
    Object    value;
502
    Cell      cell;
482
    String    link;
503
    String    value, hyperLink;
483
    int       indexColumns, indexValues, sizeColumns, sizeValues;
504
    int       indexColumn, indexRow, sizeColumns, sizeRows;
484
    boolean   alternate = false;
505
    boolean   alternate = false;
485
506
486
    if (values != null)
507
    if (cells != null)
487
    {
508
    {
488
      if ((pageSize > 0) && (!customPaging))
509
      if ((pageSize > 0) && (!customPaging))
489
      {
510
      {
490
        indexValues = pageIndex;
511
        indexRow  = pageIndex;
491
        sizeValues  = pageIndex + pageSize;
512
        sizeRows  = pageIndex + pageSize;
492
        if (sizeValues > values.length) sizeValues = values.length;
513
        if (sizeRows > cells.length) sizeRows = cells.length;
493
      }
514
      }
494
      else
515
      else
495
      {
516
      {
496
        indexValues = 0;
517
        indexRow = 0;
497
        sizeValues  = values.length;
518
        sizeRows = cells.length;
498
      }
519
      }
499
520
500
      sizeColumns = columns.size ();
521
      sizeColumns = columns.size ();
501
      for (; indexValues < sizeValues; indexValues++)
522
      for (; indexRow < sizeRows; indexRow++)
502
      {
523
      {
503
        itemValues = values [indexValues];
524
        rowCells = cells [indexRow];
504
525
505
        out.print ("<tr");
526
        out.print ("<tr");
506
        if ((alternate = !alternate) || (alternateRowsStyleClass == null))
527
        if ((alternate = !alternate) || (alternateRowsStyleClass == null))
507
        {
528
        {
529
          if (rowsStyle            != null) out.print (" style=\"" + rowsStyle + "\"");
508
          if (rowsStyleClass       != null) out.print (" class=\"" + rowsStyleClass + "\"");
530
          if (rowsStyleClass       != null) out.print (" class=\"" + rowsStyleClass + "\"");
531
          if (rowsHiliteStyle      != null) out.print (" onMouseOver=\"this.style='" + rowsHiliteStyleClass + "'\" onMouseOut=\"this.style='" + rowsStyleClass + "'\"");
509
          if (rowsHiliteStyleClass != null) out.print (" onMouseOver=\"this.className='" + rowsHiliteStyleClass + "'\" onMouseOut=\"this.className='" + rowsStyleClass + "'\"");
532
          if (rowsHiliteStyleClass != null) out.print (" onMouseOver=\"this.className='" + rowsHiliteStyleClass + "'\" onMouseOut=\"this.className='" + rowsStyleClass + "'\"");
510
        }
533
        }
511
        else
534
        else
Lines 516-542 Link Here
516
        }
539
        }
517
        out.println (">");
540
        out.println (">");
518
        
541
        
519
        for (indexColumns = 0; indexColumns < sizeColumns; indexColumns++)
542
        for (indexColumn = 0; indexColumn < sizeColumns; indexColumn++)
520
        {
543
        {
521
          column = (Column)columns.get(indexColumns);
544
          column = (Column) columns.get (indexColumn);
522
545
523
          out.print ("<td");
546
          out.print ("<td");
524
          if (column.getWidth               () != null) out.print (" width=\""  + column.getWidth ()               + "\""); 
547
          if (column.getWidth               () != null) out.print (" width=\""  + column.getWidth ()               + "\""); 
525
          if (column.getItemHorizontalAlign () != null) out.print (" align=\""  + column.getItemHorizontalAlign () + "\"");          
548
          if (column.getItemHorizontalAlign () != null) out.print (" align=\""  + column.getItemHorizontalAlign () + "\"");          
526
          if (column.getItemVerticalAlign   () != null) out.print (" valign=\"" + column.getItemVerticalAlign ()   + "\"");          
549
          if (column.getItemVerticalAlign   () != null) out.print (" valign=\"" + column.getItemVerticalAlign ()   + "\"");          
527
          if (column.getItemStyleClass      () != null) out.print (" class=\""  + column.getItemStyleClass ()      + "\"");
550
          if (column.getItemStyleClass      () != null) out.print (" class=\""  + column.getItemStyleClass ()      + "\"");
551
          if (column.getItemStyle           () != null) out.print (" style=\""  + column.getItemStyle ()           + "\"");
528
          out.println (">");
552
          out.println (">");
529
553
530
          value = itemValues [indexColumns];
554
          cell = rowCells [indexColumn];
531
          if ((value != null) && (column.getItemPattern () != null))
555
          if (cell.getValue () != null)
532
            value = formatValue (value, column.getItemPattern ());
533
534
          if (value != null)
535
          {
556
          {
536
            if (column.getItemHyperLinkValues () != null) 
557
            if (column.getItemPattern () != null)
558
              value = formatValue (cell.getValue (), column.getItemPattern ());
559
            else
560
              value = cell.getValue ().toString ();
561
562
            if (cell.getHyperLink () != null) 
537
            {
563
            {
538
              out.print   ("<a href=\"");
564
              out.print   ("<a href=\"");
539
              out.print   (((HttpServletResponse) pageContext.getResponse ()).encodeURL (column.getItemHyperLinkValues () [indexValues]));
565
              out.print   (((HttpServletResponse) pageContext.getResponse ()).encodeURL (cell.getHyperLink ()));
540
              out.print   ("\"");
566
              out.print   ("\"");
541
              if (column.getItemHyperLinkTarget () != null) 
567
              if (column.getItemHyperLinkTarget () != null) 
542
              {
568
              {
Lines 583-588 Link Here
583
      if (column.getHeaderHorizontalAlign () != null) out.print (" align=\""  + column.getHeaderHorizontalAlign () + "\"");          
609
      if (column.getHeaderHorizontalAlign () != null) out.print (" align=\""  + column.getHeaderHorizontalAlign () + "\"");          
584
      if (column.getHeaderVerticalAlign   () != null) out.print (" valign=\"" + column.getHeaderVerticalAlign ()   + "\"");          
610
      if (column.getHeaderVerticalAlign   () != null) out.print (" valign=\"" + column.getHeaderVerticalAlign ()   + "\"");          
585
      if (column.getHeaderStyleClass      () != null) out.print (" class=\""  + column.getHeaderStyleClass ()      + "\"");
611
      if (column.getHeaderStyleClass      () != null) out.print (" class=\""  + column.getHeaderStyleClass ()      + "\"");
612
      if (column.getHeaderStyle           () != null) out.print (" style=\""  + column.getHeaderStyle ()           + "\"");
586
      out.println (">");
613
      out.println (">");
587
614
588
      value = ExpressionLanguageHelper.evalObject ("value", column.getHeaderValue (), this, pageContext);
615
      value = ExpressionLanguageHelper.evalObject ("value", column.getHeaderValue (), this, pageContext);
Lines 647-652 Link Here
647
      if (column.getFooterHorizontalAlign () != null) out.print (" align=\""  + column.getFooterHorizontalAlign () + "\"");          
674
      if (column.getFooterHorizontalAlign () != null) out.print (" align=\""  + column.getFooterHorizontalAlign () + "\"");          
648
      if (column.getFooterVerticalAlign   () != null) out.print (" valign=\"" + column.getFooterVerticalAlign ()   + "\"");          
675
      if (column.getFooterVerticalAlign   () != null) out.print (" valign=\"" + column.getFooterVerticalAlign ()   + "\"");          
649
      if (column.getFooterStyleClass      () != null) out.print (" class=\""  + column.getFooterStyleClass ()      + "\"");
676
      if (column.getFooterStyleClass      () != null) out.print (" class=\""  + column.getFooterStyleClass ()      + "\"");
677
      if (column.getFooterStyle           () != null) out.print (" style=\""  + column.getFooterStyle ()           + "\"");
650
      out.println (">");
678
      out.println (">");
651
679
652
      value = ExpressionLanguageHelper.evalObject ("value", column.getFooterValue (), this, pageContext);
680
      value = ExpressionLanguageHelper.evalObject ("value", column.getFooterValue (), this, pageContext);
Lines 771-776 Link Here
771
    cellSpacing = value;
799
    cellSpacing = value;
772
  }
800
  }
773
801
802
 /**
803
  * Set the attribute <b>style</b> that defines the CSS style to be used in the datagrid.
804
  *
805
  * @param String style defines the CSS style to be used in the datagrid.
806
  */
807
  public void setStyle (String value)
808
  {
809
    style = value;
810
  }
811
  
774
 /**
812
 /**
775
  * Set the attribute <b>styleClass</b> that defines the CSS class to be used in the datagrid.
813
  * Set the attribute <b>styleClass</b> that defines the CSS class to be used in the datagrid.
776
  *
814
  *
(-)src/org/apache/taglibs/datagrid/ValueComparator.java (-62 / +63 lines)
Lines 1-62 Link Here
1
/*
1
/*
2
 * Copyright 2004 The Apache Software Foundation.
2
 * Copyright 2004 The Apache Software Foundation.
3
 * 
3
 * 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
6
 * You may obtain a copy of the License at
7
 * 
7
 * 
8
 *      http://www.apache.org/licenses/LICENSE-2.0
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 * 
9
 * 
10
 * Unless required by applicable law or agreed to in writing, software
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
14
 * limitations under the License.
15
 */
15
 */
16
package org.apache.taglibs.datagrid;
16
package org.apache.taglibs.datagrid;
17
17
18
import java.util.Comparator;
18
import java.util.Comparator;
19
19
20
/**
20
/**
21
 * Comparator Class to order the values of a data grid.
21
 * Comparator Class to order the values of a data grid.
22
 *
22
 *
23
 * @see DataGridTag
23
 * @see DataGridTag
24
 */
24
 */
25
25
26
public class ValueComparator implements Comparator
26
public class ValueComparator implements Comparator
27
{
27
{
28
  private int     index;
28
  private int     index;
29
  private boolean inverse;
29
  private boolean inverse;
30
  
30
  
31
  public ValueComparator (int index)
31
  public ValueComparator (int index)
32
  {
32
  {
33
    if (index >= 0)
33
    if (index >= 0)
34
      this.index   = index - 1;
34
      this.index   = index - 1;
35
    else
35
    else
36
    {
36
    {
37
      this.inverse = true;
37
      this.inverse = true;
38
      this.index   = -index - 1;
38
      this.index   = -index - 1;
39
    }
39
    }
40
  }
40
  }
41
41
42
  public int compare (Object values1, Object values2)
42
  public int compare (Object values1, Object values2)
43
  {
43
  {
44
    Object obj1, obj2;
44
    Cell cell1, cell2;
45
    int    result;
45
    int  result;
46
46
47
    obj1 = ((Object []) values1) [index];
47
    cell1 = ((Cell []) values1) [index];
48
    obj2 = ((Object []) values2) [index];
48
    cell2 = ((Cell []) values2) [index];
49
    
49
    
50
    if      (obj1 == null)
50
    if      (cell1 == null)
51
      result = -1;
51
      result = -1;
52
    else if (obj2 == null)
52
    else if (cell2 == null)
53
      result = 1;
53
      result = 1;
54
    else if ((obj1 instanceof Comparable) && (obj2 instanceof Comparable))
54
    else if ((cell1.getValue () instanceof Comparable) && (cell2.getValue () instanceof Comparable))
55
      result = ((Comparable) obj1).compareTo (obj2);
55
      result = ((Comparable) cell1.getValue ()).compareTo (cell2.getValue ());
56
    else 
56
    else 
57
      result = obj1.toString ().compareTo (obj2.toString ());
57
      result = cell1.getValue ().toString ().compareTo (cell2.getValue ().toString ());
58
58
59
    if (inverse) result = -result;
59
    if (inverse) result = -result;
60
    return (result);
60
    
61
  }
61
    return (result);
62
}
62
  }
63
}
(-)src/org/apache/taglibs/datagrid/aggregate/StdDevAggregateFunction.java (-48 / +48 lines)
Lines 1-48 Link Here
1
/*
1
/*
2
 * Copyright 2004 The Apache Software Foundation.
2
 * Copyright 2004 The Apache Software Foundation.
3
 * 
3
 * 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
6
 * You may obtain a copy of the License at
7
 * 
7
 * 
8
 *      http://www.apache.org/licenses/LICENSE-2.0
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 * 
9
 * 
10
 * Unless required by applicable law or agreed to in writing, software
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
14
 * limitations under the License.
15
 */
15
 */
16
package org.apache.taglibs.datagrid.aggregate;
16
package org.apache.taglibs.datagrid.aggregate;
17
17
18
import java.util.Iterator;
18
import java.util.Iterator;
19
import java.util.ArrayList;
19
import java.util.ArrayList;
20
import java.math.BigDecimal;
20
import java.math.BigDecimal;
21
import org.apache.taglibs.datagrid.aggregate.AggregateFunction;
21
import org.apache.taglibs.datagrid.aggregate.AggregateFunction;
22
import org.apache.commons.math.stat.univariate.moment.StandardDeviation;
22
import org.apache.commons.math.stat.univariate.moment.StandardDeviation;
23
23
24
/**
24
/**
25
 * Class that implements a standard deviance aggregate function.
25
 * Class that implements a standard deviance aggregate function.
26
 *
26
 *
27
 * @see AggregateFunction
27
 * @see AggregateFunction
28
 */
28
 */
29
29
30
public class StdDevAggregateFunction implements AggregateFunction
30
public class StdDevAggregateFunction implements AggregateFunction
31
{
31
{
32
  private StandardDeviation stat;
32
  private StandardDeviation stat;
33
  
33
  
34
  public StdDevAggregateFunction()
34
  public StdDevAggregateFunction()
35
  {
35
  {
36
    stat = new StandardDeviation ();
36
    stat = new StandardDeviation ();
37
  }
37
  }
38
38
39
  public void addValue (Object obj)
39
  public void addValue (Object obj)
40
  {
40
  {
41
    if ((obj != null) && (obj instanceof Number)) stat.increment (((Number) obj).doubleValue ());
41
    if ((obj != null) && (obj instanceof Number)) stat.increment (((Number) obj).doubleValue ());
42
  }
42
  }
43
43
44
  public Object totalValue ()
44
  public Object totalValue ()
45
  {
45
  {
46
    return (new Double (stat.getResult ()));
46
    return (new Double (stat.getResult ()));
47
  }
47
  }
48
}
48
}
(-)src/org/apache/taglibs/datagrid/aggregate/SumAggregateFunction.java (-47 / +47 lines)
Lines 1-47 Link Here
1
/*
1
/*
2
 * Copyright 2004 The Apache Software Foundation.
2
 * Copyright 2004 The Apache Software Foundation.
3
 * 
3
 * 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
6
 * You may obtain a copy of the License at
7
 * 
7
 * 
8
 *      http://www.apache.org/licenses/LICENSE-2.0
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 * 
9
 * 
10
 * Unless required by applicable law or agreed to in writing, software
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
14
 * limitations under the License.
15
 */
15
 */
16
package org.apache.taglibs.datagrid.aggregate;
16
package org.apache.taglibs.datagrid.aggregate;
17
17
18
import java.math.BigDecimal;
18
import java.math.BigDecimal;
19
import org.apache.taglibs.datagrid.aggregate.AggregateFunction;
19
import org.apache.taglibs.datagrid.aggregate.AggregateFunction;
20
import org.apache.commons.math.stat.univariate.summary.Sum;
20
import org.apache.commons.math.stat.univariate.summary.Sum;
21
21
22
/**
22
/**
23
 * Class that implements a sum aggregate function.
23
 * Class that implements a sum aggregate function.
24
 *
24
 *
25
 * @see AggregateFunction
25
 * @see AggregateFunction
26
 */
26
 */
27
27
28
public class SumAggregateFunction implements AggregateFunction
28
public class SumAggregateFunction implements AggregateFunction
29
{
29
{
30
  private Sum stat;
30
  private Sum stat;
31
  
31
  
32
  public SumAggregateFunction()
32
  public SumAggregateFunction()
33
  {
33
  {
34
    stat = new Sum ();
34
    stat = new Sum ();
35
  }
35
  }
36
36
37
  public void addValue (Object obj)
37
  public void addValue (Object obj)
38
  {
38
  {
39
    if ((obj != null) && (obj instanceof Number)) 
39
    if ((obj != null) && (obj instanceof Number)) 
40
      stat.increment (((Number) obj).doubleValue ());
40
      stat.increment (((Number) obj).doubleValue ());
41
  }
41
  }
42
42
43
  public Object totalValue ()
43
  public Object totalValue ()
44
  {
44
  {
45
    return (new Double (stat.getResult ()));
45
    return (new Double (stat.getResult ()));
46
  }
46
  }
47
}
47
}
(-)xml/datagrid.xml (-1 / +19 lines)
Lines 249-263 Link Here
249
<!-- The following is used to generate the tag library revision history
249
<!-- The following is used to generate the tag library revision history
250
     changes.html file. There can be 0 .. N revisions.  Each revision
250
     changes.html file. There can be 0 .. N revisions.  Each revision
251
     can have 0 .. N sections, each section can have 0 .. N items. -->
251
     can have 0 .. N sections, each section can have 0 .. N items. -->
252
<revision release="Development" date="09/22/2004">
253
  <description>
254
    Bug fix.
255
  </description>
256
  <section name="Bugs Fixed">
257
    <item>
258
      Fixed problem with hyperlinks not beign ordered in a column.
259
    </item>
260
  </section>
261
</revision>
262
252
<revision release="Development" date="09/02/2004">
263
<revision release="Development" date="09/02/2004">
253
  <description>
264
  <description>
254
    The Data Grid tag library is in development, changes are fast and furious.
265
    Bug fix.
255
  </description>
266
  </description>
256
  <section name="Bugs Fixed">
267
  <section name="Bugs Fixed">
257
    <item>
268
    <item>
258
      Fixed a bug when using Arrays in the item attribute instead of Collections.
269
      Fixed a bug when using Arrays in the item attribute instead of Collections.
259
    </item>
270
    </item>
260
  </section>
271
  </section>
272
</revision>
273
274
<revision release="Development" date="06/06/2004">
275
  <description>
276
    The Data Grid tag library is in development,
277
    changes are fast and furious.
278
  </description>
261
</revision>
279
</revision>
262
280
263
</document>
281
</document>

Return to bug 31353