KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > tags > databinding > repeater > RepeaterFooter


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.tags.databinding.repeater;
19
20 /**
21  * <p>
22  * Renders the footer of a {@link Repeater} tag. This header may contain any HTML markup that can
23  * be rendered to a page. In the case of closing a table, ordered list, or unordered list, the elements
24  * &lt;/table&gt;, &lt;/ol&gt;, and &lt;/ul&gt; could respectively be rendered inside the body of
25  * the &lt;netui-data:repeaterFooter> tag.
26  * </p>
27  * <p>
28  * There is no data item present at the time that the &lt;netui-data:repeaterFooter> renders
29  * (because the iteration of the &lt;netui-data:repeater> tag has ended), so tags in the body can not
30  * reference the <code>${container...}</code> JSP EL implicit object to access the current item in
31  * the data set, though other databinding contexts are available.
32  * </p>
33  * <p>
34  * The header tag is rendered exactly once at the end of repeater rendering.
35  * </p>
36  * <p>
37  * For example, the following sample renders the data set as an HTML table. The table has two columns,
38  * "index" and "name", and each iteration over the data set is rendered a row of the table. The
39  * &lt;netui-data:repeaterFooter> tag renders once, after the iteration is complete. It renders a
40  * closing HTML table tag.
41  * <br/>
42  * <pre>
43  * &lt;netui-data:repeater dataSource="pageFlow.myDataSet">
44  * &lt;netui-data:repeaterHeader>
45  * &lt;table border="1">
46  * &lt;tr>
47  * &lt;td>&lt;b>index&lt;/b>&lt;/td>
48  * &lt;td>&lt;b>name&lt;/b>&lt;/td>
49  * &lt;/tr>
50  * &lt;/netui-data:repeaterHeader>
51  * &lt;netui-data:repeaterItem>
52  * &lt;tr>
53  * &lt;td>
54  * &lt;netui:span value="${container.index}" />
55  * &lt;/td>
56  * &lt;td>
57  * &lt;netui:span value="${container.item}" />
58  * &lt;/td>
59  * &lt;/tr>
60  * &lt;/netui-data:repeaterItem>
61  * <b>&lt;netui-data:repeaterFooter></b>
62  * &lt;/table>
63  * <b>&lt;/netui-data:repeaterFooter></b>
64  * &lt;/netui-data:repeater>
65  * </pre>
66  * </p>
67  *
68  * @jsptagref.tagdescription
69  * <p>
70  * Renders the footer of a {@link Repeater} tag. This header may contain any HTML markup that can
71  * be rendered to a page. In the case of closing a table, ordered list, or unordered list, the elements
72  * &lt;/table&gt;, &lt;/ol&gt;, and &lt;/ul&gt; could respectively be rendered inside the body of
73  * the &lt;netui-data:repeaterFooter> tag.
74  * </p>
75  * <p>
76  * There is no data item present at the time that the &lt;netui-data:repeaterFooter> renders
77  * (because the iteration of the &lt;netui-data:repeater> tag has ended), so tags in the body can not
78  * reference the <code>${container...}</code> JSP EL implicit object to access the current item in
79  * the data set, though other databinding contexts are available.
80  * </p>
81  * <p>
82  * The header tag is rendered exactly once at the end of repeater rendering.
83  * </p>
84  * @example
85  * <p>
86  * For example, the following sample renders the data set as an HTML table. The table has two columns,
87  * "index" and "name", and each iteration over the data set is rendered a row of the table. The
88  * &lt;netui-data:repeaterFooter> tag renders once, after the iteration is complete. It renders a
89  * closing HTML table tag.
90  * <br/>
91  * <pre>
92  * &lt;netui-data:repeater dataSource="pageFlow.myDataSet">
93  * &lt;netui-data:repeaterHeader>
94  * &lt;table border="1">
95  * &lt;tr>
96  * &lt;td>&lt;b>index&lt;/b>&lt;/td>
97  * &lt;td>&lt;b>name&lt;/b>&lt;/td>
98  * &lt;/tr>
99  * &lt;/netui-data:repeaterHeader>
100  * &lt;netui-data:repeaterItem>
101  * &lt;tr>
102  * &lt;td>
103  * &lt;netui:span value="${container.index}" />
104  * &lt;/td>
105  * &lt;td>
106  * &lt;netui:span value="${container.item}" />
107  * &lt;/td>
108  * &lt;/tr>
109  * &lt;/netui-data:repeaterItem>
110  * <b>&lt;netui-data:repeaterFooter></b>
111  * &lt;/table>
112  * <b>&lt;/netui-data:repeaterFooter></b>
113  * &lt;/netui-data:repeater>
114  * </pre>
115  * </p>
116  *
117  * @netui:tag name="repeaterFooter" description="Render the footer of a repeater tag."
118  */

119 public class RepeaterFooter
120         extends RepeaterComponent {
121
122     /**
123      * Get the name of this tag. This is used to identify the type of this tag
124      * for reporting tag errors.
125      *
126      * @return a constant String representing the name of this tag.
127      */

128     public String JavaDoc getTagName() {
129         return "RepeaterFooter";
130     }
131
132     public boolean shouldRender() {
133         return getRepeater().getRenderState() == Repeater.FOOTER;
134     }
135 }
136
Popular Tags