001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: *
017: * $Header:$
018: */
019: package org.apache.beehive.netui.tags.databinding.repeater;
020:
021: /**
022: * <p>
023: * Renders the footer of a {@link Repeater} tag. This header may contain any HTML markup that can
024: * be rendered to a page. In the case of closing a table, ordered list, or unordered list, the elements
025: * </table>, </ol>, and </ul> could respectively be rendered inside the body of
026: * the <netui-data:repeaterFooter> tag.
027: * </p>
028: * <p>
029: * There is no data item present at the time that the <netui-data:repeaterFooter> renders
030: * (because the iteration of the <netui-data:repeater> tag has ended), so tags in the body can not
031: * reference the <code>${container...}</code> JSP EL implicit object to access the current item in
032: * the data set, though other databinding contexts are available.
033: * </p>
034: * <p>
035: * The header tag is rendered exactly once at the end of repeater rendering.
036: * </p>
037: * <p>
038: * For example, the following sample renders the data set as an HTML table. The table has two columns,
039: * "index" and "name", and each iteration over the data set is rendered a row of the table. The
040: * <netui-data:repeaterFooter> tag renders once, after the iteration is complete. It renders a
041: * closing HTML table tag.
042: * <br/>
043: * <pre>
044: * <netui-data:repeater dataSource="pageFlow.myDataSet">
045: * <netui-data:repeaterHeader>
046: * <table border="1">
047: * <tr>
048: * <td><b>index</b></td>
049: * <td><b>name</b></td>
050: * </tr>
051: * </netui-data:repeaterHeader>
052: * <netui-data:repeaterItem>
053: * <tr>
054: * <td>
055: * <netui:span value="${container.index}" />
056: * </td>
057: * <td>
058: * <netui:span value="${container.item}" />
059: * </td>
060: * </tr>
061: * </netui-data:repeaterItem>
062: * <b><netui-data:repeaterFooter></b>
063: * </table>
064: * <b></netui-data:repeaterFooter></b>
065: * </netui-data:repeater>
066: * </pre>
067: * </p>
068: *
069: * @jsptagref.tagdescription
070: * <p>
071: * Renders the footer of a {@link Repeater} tag. This header may contain any HTML markup that can
072: * be rendered to a page. In the case of closing a table, ordered list, or unordered list, the elements
073: * </table>, </ol>, and </ul> could respectively be rendered inside the body of
074: * the <netui-data:repeaterFooter> tag.
075: * </p>
076: * <p>
077: * There is no data item present at the time that the <netui-data:repeaterFooter> renders
078: * (because the iteration of the <netui-data:repeater> tag has ended), so tags in the body can not
079: * reference the <code>${container...}</code> JSP EL implicit object to access the current item in
080: * the data set, though other databinding contexts are available.
081: * </p>
082: * <p>
083: * The header tag is rendered exactly once at the end of repeater rendering.
084: * </p>
085: * @example
086: * <p>
087: * For example, the following sample renders the data set as an HTML table. The table has two columns,
088: * "index" and "name", and each iteration over the data set is rendered a row of the table. The
089: * <netui-data:repeaterFooter> tag renders once, after the iteration is complete. It renders a
090: * closing HTML table tag.
091: * <br/>
092: * <pre>
093: * <netui-data:repeater dataSource="pageFlow.myDataSet">
094: * <netui-data:repeaterHeader>
095: * <table border="1">
096: * <tr>
097: * <td><b>index</b></td>
098: * <td><b>name</b></td>
099: * </tr>
100: * </netui-data:repeaterHeader>
101: * <netui-data:repeaterItem>
102: * <tr>
103: * <td>
104: * <netui:span value="${container.index}" />
105: * </td>
106: * <td>
107: * <netui:span value="${container.item}" />
108: * </td>
109: * </tr>
110: * </netui-data:repeaterItem>
111: * <b><netui-data:repeaterFooter></b>
112: * </table>
113: * <b></netui-data:repeaterFooter></b>
114: * </netui-data:repeater>
115: * </pre>
116: * </p>
117: *
118: * @netui:tag name="repeaterFooter" description="Render the footer of a repeater tag."
119: */
120: public class RepeaterFooter 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 getTagName() {
129: return "RepeaterFooter";
130: }
131:
132: public boolean shouldRender() {
133: return getRepeater().getRenderState() == Repeater.FOOTER;
134: }
135: }
|