0001: /*
0002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0003: *
0004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
0005: *
0006: * The contents of this file are subject to the terms of either the GNU
0007: * General Public License Version 2 only ("GPL") or the Common
0008: * Development and Distribution License("CDDL") (collectively, the
0009: * "License"). You may not use this file except in compliance with the
0010: * License. You can obtain a copy of the License at
0011: * http://www.netbeans.org/cddl-gplv2.html
0012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
0013: * specific language governing permissions and limitations under the
0014: * License. When distributing the software, include this License Header
0015: * Notice in each file and include the License file at
0016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
0017: * particular file as subject to the "Classpath" exception as provided
0018: * by Sun in the GPL Version 2 section of the License file that
0019: * accompanied this code. If applicable, add the following below the
0020: * License Header, with the fields enclosed by brackets [] replaced by
0021: * your own identifying information:
0022: * "Portions Copyrighted [year] [name of copyright owner]"
0023: *
0024: * Contributor(s):
0025: *
0026: * The Original Software is NetBeans. The Initial Developer of the Original
0027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
0028: * Microsystems, Inc. All Rights Reserved.
0029: *
0030: * If you wish your version of this file to be governed by only the CDDL
0031: * or only the GPL Version 2, indicate your decision by adding
0032: * "[Contributor] elects to include this software in this distribution
0033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
0034: * single choice of license, a recipient has the option to distribute
0035: * your version of this file under either the CDDL, the GPL Version 2 or
0036: * to extend the choice of license to its licensees as provided above.
0037: * However, if you add GPL Version 2 code and therefore, elected the GPL
0038: * Version 2 license, then the option applies only if the new code is
0039: * made subject to such option by the copyright holder.
0040: */
0041: package com.sun.rave.web.ui.component;
0042:
0043: import java.io.IOException;
0044: import javax.faces.component.UIComponent;
0045: import javax.faces.context.FacesContext;
0046: import javax.faces.el.MethodBinding;
0047: import javax.faces.el.ValueBinding;
0048:
0049: /**
0050: * Use the <code>ui:table</code>
0051: * tag to create a table that can be configured to perform actions on
0052: * objects in the table, and to manipulate the rows and columns of the
0053: * table. The table component features behaviors that let the user sort,
0054: * filter, and paginate the table objects, and provides actions that can
0055: * be performed on selected objects. The component also allows you to
0056: * implement developer-defined custom actions. <br>
0057: * <p>Note that the <code>ui:table</code>
0058: * tag is not intended to be used to create HTML tables that are used
0059: * purely to handle page layout. The
0060: * table component renders a
0061: * table with
0062: * a well-defined structure, including a title, column headings, and
0063: * borders. You can use tags
0064: * such as <code><a href="propertySheet.html">ui:propertySheet</a></code>
0065: * and <code><a href="panelGroup.html">ui:panelGroup</a></code>
0066: * for page
0067: * layout if
0068: * possible.<br>
0069: * </p>
0070: * <p>The table component
0071: * implements Sun's user interface (UI) guidelines for web
0072: * applications. The guidelines describe in detail how the table should
0073: * appear and behave, including the placement of titles, group headers,
0074: * and actions. The table component's default behavior implements the UI
0075: * guidelines. The component is also extensible through JavaServer Faces
0076: * facets to
0077: * allow the component to be used for tables that do not need to adhere
0078: * strictly to the UI guidelines.<br>
0079: * </p>
0080: * <p>The <code>ui:table</code>
0081: * tag must be used with the <a href="tableRowGroup.html"><code>ui:tableRowGroup</code></a>
0082: * and <a href="tableColumn.html"><code>ui:tableColumn</code></a>
0083: * tags. The <code>ui:table</code>
0084: * tag is
0085: * used to define the structure and actions of the table, and is a
0086: * container for <code>ui:tableRowGroup</code>
0087: * tags. The <code>ui:tableRowGroup</code> tag is used to define
0088: * the rows of the table, and is a container for <code>ui:tableColumn</code>
0089: * tags. The <code>ui:tableColumn</code> tag is used to define the
0090: * columns of the table. <br>
0091: * </p>
0092: * <h3>HTML Elements and Layout</h3>
0093: * The table component renders
0094: * an XHTML <code><table></code> element. Depending upon the
0095: * attributes specified with the <code>ui:table</code> tag, the table
0096: * component can also render a title in a <code><caption></code>
0097: * element, and image hyperlinks for the various buttons for sorting and
0098: * pagination. The table component does not render table rows except
0099: * for
0100: * the rows that contain
0101: * the view-changing and pagination controls. <br>
0102: * <h3>Table Structure<code></code><br>
0103: * </h3>
0104: * <p>Tables are composed of several
0105: * discrete areas. You can use
0106: * <code>ui:table</code> tag attributes to cause the table component to
0107: * create the default layout for each
0108: * area. The default layout strictly adheres to UI guidelines. The
0109: * layout for
0110: * each area can also be customized by using facets. Some areas
0111: * require you to use facets to implement the content you want in those
0112: * areas. Descriptions of
0113: * the table areas are shown below, followed by a <a href="#diagram">diagram</a>
0114: * that shows the placement of the areas.<br>
0115: * </p>
0116: * <ul>
0117: * <li>
0118: * <p>Title - displays a title for the table,
0119: * which you can also use to include information about paginated rows and
0120: * applied
0121: * filters. Use the <code>title</code> attribute to specify the title
0122: * content. Use the <code>itemsText</code> attribute to specify the text
0123: * displayed for the table title for an unpaginated table. <span
0124: * style="font-weight: bold; color: rgb(255, 0, 0);"></span><span
0125: * style="color: rgb(255, 0, 0);"> </span>Use
0126: * the <code>filterText</code>
0127: * attribute to specify text to include in the title about the filter that
0128: * is applied. <span style="color: rgb(102, 102, 204);"></span>You
0129: * can override the default implementation of the
0130: * title bar
0131: * with a different component by using the <code>title</code>
0132: * facet. <br style="color: rgb(255, 153, 0);">
0133: * </p>
0134: * </li>
0135: * <li>
0136: * <p>Action Bar (top) - in the first row of the table, displays
0137: * controls that operate on the
0138: * table and its data. This area contains the following sub areas:</p>
0139: * </li>
0140: * <ul>
0141: * <li>
0142: * <p>Actions - displays local actions that apply to
0143: * the objects in the table. You must provide the components for each
0144: * action, by specifying them in the <code>actionsTop</code>
0145: * facet. You can specify the same actions for the Action Bar
0146: * (bottom) area in the <code>actionsBottom</code> facet.<br>
0147: * </p>
0148: * </li>
0149: * </ul>
0150: * <ul>
0151: * <li>
0152: * <p>View-Changing
0153: * Controls - displays controls for changing the view of the
0154: * table data, such as custom filtering and sorting. This area
0155: * contains the following sub areas: <br>
0156: * </p>
0157: * </li>
0158: * <ul>
0159: * <li>
0160: * <p> Filter - displays a drop down menu of filter options,
0161: * which allow users to select criteria to be used to determine the items
0162: * to display. The component provides a default implementation for adding
0163: * options when the Custom filter becomes active, to display the filter
0164: * panel, etc. However, you must implement your filters
0165: * through custom options. An example
0166: * filter is shown in <span style="color: rgb(255, 153, 0);"><a
0167: * href="table.html#Filter.java">Filter.java.</a></span></p>
0168: * </li>
0169: * <li>Clear Sort - displays a button that is used to remove
0170: * all sorting of the table. Use the <code>clearTableSortButton</code>
0171: * attribute to display the clear table sort button. </li>
0172: * <li>
0173: * <p><span
0174: * style="color: rgb(255, 0, 0); text-decoration: line-through;"></span>Sort
0175: * - displays a
0176: * toggle button for the sort panel. Clicking this button
0177: * opens and closes an embedded panel with custom sort
0178: * options. The panel
0179: * opens inside the table below the Action Bar (top). Use the <code>sortPanelToggleButton
0180: * </code>attribute
0181: * to display the default sort button with a default
0182: * layout of the sort panel. You can
0183: * provide custom content for the sort panel by using the <code>sortPanel</code>
0184: * facet. </p>
0185: * </li>
0186: * <li>
0187: * <p>Preferences
0188: * - displays a toggle button for setting the
0189: * user's preferences. Clicking this
0190: * button opens and closes an embedded
0191: * panel with view preferences. The preferences panel opens inside
0192: * the table below
0193: * the Action Bar (top). You must provide the content of
0194: * the preferences panel by using the <code>preferencesPanel</code>
0195: * facet. There is no
0196: * default implementation of the preferences panel content, and therefore
0197: * no attribute to specify that the button should be displayed. <br>
0198: * </p>
0199: * </li>
0200: * </ul>
0201: * <li>
0202: * <p>Vertical Pagination - The Vertical Pagination area displays a
0203: * paginate button, which allows users to switch between viewing the table
0204: * as multiple pages, or as a single scrolling page. You can specify
0205: * the <code>paginateButton</code> attributes to display the
0206: * default paginate button. Note that the Vertical
0207: * Pagination area is limited to this button. You cannot use extra
0208: * pagination controls in this area, as you can in the bottom Pagination
0209: * area. </p>
0210: * </li>
0211: * </ul>
0212: * <li>
0213: * <p>Action Bar (bottom)</p>
0214: * </li>
0215: * <ul>
0216: * <li>
0217: * <p>Actions - displays local actions that apply to
0218: * the objects in the table. You must provide the implementation for each
0219: * table action, by using the <code>actionsBottom</code> facet . The
0220: * same actions can exist for the Table both the "Action
0221: * Bar
0222: * (top)" and "Action Bar
0223: * (bottom)" sections</p>
0224: * </li>
0225: * <li>
0226: * <p>Pagination Controls
0227: * - displays controls for pagination, including the
0228: * paginate button, which allows users to switch between viewing the table
0229: * as multiple pages, or as a single scrolling page. The Pagination area
0230: * also includes buttons for turning the pages in sequence, jumping to a
0231: * specific page, and jumping to the first or last page. You can specify
0232: * the <code>paginateButton</code> and <code>paginateControls</code>
0233: * attributes to display the default layout of the Pagination area. <code></code></p>
0234: * </li>
0235: * </ul>
0236: * <li>
0237: * <p>Footer - displays a footer across all columns at the
0238: * bottom of the table. You can specify the <code>footerText</code>
0239: * attribute to display footer content with a default layout, or specify a
0240: * component for the footer by using the <code>footer</code> facet.</p>
0241: * </li>
0242: * </ul>
0243: * <a name="diagram"></a>The
0244: * following diagram shows
0245: * the relative location of the table areas and facets that can be used
0246: * for each area. The areas that are specified with the <code>ui:table</code>
0247: * tag attributes are highlighted<span
0248: * style="color: rgb(102, 102, 204);"> </span>in blue. The grayed
0249: * out area
0250: * is controlled with ui:<code>tableRowGroup</code> and <code>ui:tableColumn</code>
0251: * tags, but is shown here for context.<br>
0252: * <br>
0253: * <br>
0254: * <table style="text-align: left; width: 100%;" border="1" cellpadding="2"
0255: * cellspacing="2">
0256: * <tbody>
0257: * <tr>
0258: * <td
0259: * style="vertical-align: top; background-color: rgb(210, 224, 235);"
0260: * rowspan="1" colspan="1"><span style="color: rgb(0, 0, 0);">Title
0261: * Bar <code>title</code> <br>
0262: * </span></td>
0263: * </tr>
0264: * <tr style="color: rgb(0, 0, 0);">
0265: * <td
0266: * style="vertical-align: top; background-color: rgb(210, 224, 235);"
0267: * rowspan="1" colspan="1">Action
0268: * Bar (top)
0269: * <table style="text-align: left; width: 100%;" border="1"
0270: * cellpadding="2" cellspacing="2">
0271: * <tbody>
0272: * <tr>
0273: * <td style="vertical-align: top;">Actions <code>actionsTop </code></td>
0274: * <td style="vertical-align: top;">View-Changing Controls<br>
0275: * <table style="text-align: left; width: 100%;" border="1"
0276: * cellpadding="2" cellspacing="2">
0277: * <tbody>
0278: * <tr>
0279: * <td style="vertical-align: top;">Filter<br>
0280: * <code>filter</code></td>
0281: * <td style="vertical-align: top;">Sort<br>
0282: * <code></code></td>
0283: * <td style="vertical-align: top;">Clear Sort </td>
0284: * <td style="vertical-align: top;">Preferences</td>
0285: * </tr>
0286: * </tbody>
0287: * </table>
0288: * </td>
0289: * <td style="vertical-align: top;">Vertical
0290: * Pagination <code></code></td>
0291: * </tr>
0292: * <tr style="color: rgb(0, 0, 0);">
0293: * <td style="vertical-align: top;" rowspan="1" colspan="3">Embedded
0294: * Panels <code>filterPanel sortPanel preferencesPanel</code></td>
0295: * </tr>
0296: * </tbody>
0297: * </table>
0298: * <code></code> </td>
0299: * </tr>
0300: * <tr>
0301: * <td
0302: * style="vertical-align: top; background-color: rgb(210, 224, 235);">
0303: * <table style="text-align: left; height: 223px; width: 100%;"
0304: * border="1" cellpadding="2" cellspacing="2">
0305: * <tbody>
0306: * <tr>
0307: * <td
0308: * style="vertical-align: top; background-color: rgb(232, 232, 232); color: rgb(153, 153, 153);">Column
0309: * Header <br>
0310: * </td>
0311: * <td
0312: * style="vertical-align: top; background-color: rgb(232, 232, 232); color: rgb(153, 153, 153);">Column
0313: * Header<br>
0314: * </td>
0315: * </tr>
0316: * <tr style="color: rgb(153, 153, 153);">
0317: * <td
0318: * style="vertical-align: top; background-color: rgb(232, 232, 232);"
0319: * rowspan="1" colspan="2">Group
0320: * Header Bar </td>
0321: * </tr>
0322: * <tr>
0323: * <td
0324: * style="vertical-align: top; background-color: rgb(232, 232, 232); color: rgb(153, 153, 153);"><span
0325: * style="font-style: italic;">Table
0326: * data</span> <code></code><br>
0327: * <code> <br>
0328: * <br>
0329: * <br>
0330: * </code></td>
0331: * <td
0332: * style="vertical-align: top; background-color: rgb(232, 232, 232); color: rgb(153, 153, 153);"><span
0333: * style="font-style: italic;">Table
0334: * data </span><code></code><br>
0335: * </td>
0336: * </tr>
0337: * <tr>
0338: * <td
0339: * style="vertical-align: top; background-color: rgb(232, 232, 232); color: rgb(153, 153, 153);">Column
0340: * Footer</td>
0341: * <td
0342: * style="vertical-align: top; background-color: rgb(232, 232, 232); color: rgb(153, 153, 153);">Column
0343: * Footer <br>
0344: * </td>
0345: * </tr>
0346: * <tr style="color: rgb(153, 153, 153);">
0347: * <td
0348: * style="vertical-align: top; background-color: rgb(232, 232, 232);"
0349: * rowspan="1" colspan="2">Group
0350: * Footer Bar <br>
0351: * </td>
0352: * </tr>
0353: * <tr>
0354: * <td
0355: * style="vertical-align: top; background-color: rgb(232, 232, 232); color: rgb(153, 153, 153);">Table
0356: * Column Footer </td>
0357: * <td
0358: * style="vertical-align: top; background-color: rgb(232, 232, 232); color: rgb(153, 153, 153);">Table
0359: * Column Footer </td>
0360: * </tr>
0361: * <tr>
0362: * <td style="vertical-align: top;" rowspan="1" colspan="2">Action
0363: * Bar (bottom)<br>
0364: * <table style="text-align: left; width: 100%;" border="1"
0365: * cellpadding="2" cellspacing="2">
0366: * <tbody>
0367: * <tr>
0368: * <td style="vertical-align: top;">Actions <code>actionsBottom</code><br>
0369: * </td>
0370: * <td style="vertical-align: top;">Pagination Controls<br>
0371: * </td>
0372: * </tr>
0373: * </tbody>
0374: * </table>
0375: * </td>
0376: * </tr>
0377: * </tbody>
0378: * </table>
0379: * <big><span style="color: rgb(0, 0, 0);"> </span></big></td>
0380: * </tr>
0381: * <tr>
0382: * <td
0383: * style="vertical-align: top; background-color: rgb(210, 224, 235);"
0384: * rowspan="1" colspan="1"><span style="color: rgb(0, 0, 0);">Footer<code></code></span><code>
0385: * </code></td>
0386: * </tr>
0387: * </tbody>
0388: * </table>
0389: * <ul>
0390: * </ul>
0391: * <h3 style="color: rgb(0, 0, 0);">Buttons and Controls</h3>
0392: * <span style="color: rgb(0, 0, 0);">The following attributes can
0393: * be specified to add buttons and controls to the table:</span><br
0394: * style="color: rgb(0, 0, 0);">
0395: * <ul style="color: rgb(0, 0, 0);">
0396: * <li>
0397: * <p><code>clearSortButton </code>adds a button to the View-Changing
0398: * Controls area that clears any sorting of the
0399: * table.</p>
0400: * </li>
0401: * <li>
0402: * <p><code>deselectMultipleButton </code>adds a button for
0403: * tables in which multiple rows can be
0404: * selected, to allow users to deselect all table rows that are currently
0405: * displayed.</p>
0406: * </li>
0407: * <li>
0408: * <p><code>deselectSingleButton </code>adds a button for tables in
0409: * which only a single table row
0410: * can be selected at a time, to allow users to deselect a column of radio
0411: * buttons </p>
0412: * </li>
0413: * <li>
0414: * <p><code>paginateButton </code>adds a button
0415: * to allow users to switch between
0416: * viewing all data on a single page (unpaginated) or to see data in
0417: * multiple pages (paginated).</p>
0418: * </li>
0419: * <li>
0420: * <p><code>paginationControls </code>adds table
0421: * pagination controls to allow users to change which page is
0422: * displayed.</p>
0423: * </li>
0424: * <li>
0425: * <p><code>selectMultipleButton </code>adds a button that is used
0426: * for selecting multiple rows. <br>
0427: * </p>
0428: * </li>
0429: * <li>
0430: * <p><code>sortPanelToggleButton</code> adds a button that is
0431: * used to open and close the sort panel. </p>
0432: * </li>
0433: * </ul>
0434: * <span style="color: rgb(0, 0, 0);">
0435: * </span>
0436: * <h3 style="color: rgb(0, 0, 0);">Cell Spacing and Shading</h3>
0437: * <p style="color: rgb(0, 0, 0);">The following attribute can be
0438: * specified to change the spacing and shading weight of the table:</p>
0439: * <ul style="color: rgb(0, 0, 0);">
0440: * <li>
0441: * <p><code>cellPadding </code> specifies the amount of
0442: * whitespace that
0443: * should be placed between the cell contents and the cell borders in all
0444: * the cells of the table. </p>
0445: * </li>
0446: * <li>
0447: * <p><code>cellSpacing </code> specifies the amount of
0448: * whitespace
0449: * that should be placed between cells, and between the edges of the table
0450: * content area and the sides of the table. </p>
0451: * </li>
0452: * <li>
0453: * <p><code>lite </code> renders the table in a style
0454: * that makes the table look lighter weight.</p>
0455: * </li>
0456: * </ul>
0457: * <span style="color: rgb(0, 0, 0);">
0458: * </span>
0459: * <h3 style="color: rgb(0, 0, 0);">Headers</h3>
0460: * <p style="color: rgb(0, 0, 0);">The table component allows
0461: * for multiple headers. The following types of headers are supported:<br>
0462: * </p>
0463: * <ul style="color: rgb(0, 0, 0);">
0464: * <li>Column header - confined to the column for which
0465: * it is defined, and displayed by default at the top of the
0466: * table,
0467: * below the Action Bar and above all row groups. Column headers are
0468: * controlled with
0469: * attributes in the <code>ui:tableColumn</code> tag. User interface
0470: * guidelines recommend
0471: * that column headers are rendered once for each table. In tables with
0472: * multiple groups, the column headers should be defined in the <code>ui:tableColumn</code>
0473: * tags that are contained in the first <code>ui:tableRowGroup</code>
0474: * tag.
0475: * See the <a href="tableColumn.html"><code>ui:tableColumn</code>
0476: * documentation</a> for more
0477: * information. <br>
0478: * </li>
0479: * </ul>
0480: * <ul style="color: rgb(0, 0, 0);">
0481: * <li>Group header - spans across all table columns,
0482: * and is displayed above each row group. The first group header is
0483: * displayed below the column headers, above the table data. Group
0484: * headers for any other groups specified in the table are displayed above
0485: * the data rows for the group. Group headers are set in the <code>ui:tableRowGroup</code>
0486: * tag. See the <a href="tableRowGroup.html"><code>ui:tableRowGroup</code>
0487: * documentation</a> for more
0488: * information.</li>
0489: * </ul>
0490: * <h3 style="color: rgb(0, 0, 0);">Footers</h3>
0491: * <p style="color: rgb(0, 0, 0);">The table component allows
0492: * for multiple footers. The following types of footers are supported:<br>
0493: * </p>
0494: * <ul>
0495: * <li style="color: rgb(0, 0, 0);">
0496: * <p>Footer - spans the full
0497: * width of the table, and displayed at the bottom of the table. Only one
0498: * table footer is displayed in each table. The table footer is
0499: * defined in the <code>ui:table</code> tag.<br>
0500: * </p>
0501: * </li>
0502: * <li style="color: rgb(0, 0, 0);">
0503: * <p>Column footer - confined to the
0504: * column for which it is defined, and displayed by default at the bottom
0505: * of the column. In tables with multiple groups of rows, each group can
0506: * display its own column footer. The column footer is defined in <code>ui:tableColumn</code>
0507: * tags. See the <a href="tableColumn.html"><code>ui:tableColumn</code>
0508: * documentation</a> for more
0509: * information.</p>
0510: * </li>
0511: * <li>
0512: * <p><span style="color: rgb(0, 0, 0);">Table column footer -
0513: * confined to the column for which
0514: * it is defined, and displayed by default near the bottom of the table,
0515: * below all row groups, and above the Action Bar (bottom). User interface
0516: * guidelines recommend
0517: * that table column footers are rendered once for each table. In tables
0518: * with multiple groups, the table column footers should be defined in the
0519: * <code>ui:tableColumn</code> tags that are contained in the first <code>ui:tableRowGroup</code>
0520: * tag. See the </span><a href="tableColumn.html"
0521: * style="color: rgb(0, 0, 0);"><code>ui:tableColumn</code>
0522: * documentation</a><span style="color: rgb(102, 102, 204);"><span
0523: * style="color: rgb(0, 0, 0);"> for more
0524: * information. </span><br>
0525: * </span> </p>
0526: * </li>
0527: * </ul>
0528: * <h3>Facets</h3>
0529: * The <code>ui:table</code> tag supports the following facets, which
0530: * allow you to customize the
0531: * layout of the component.<br>
0532: * <br>
0533: * <span style="color: rgb(255, 153, 0);"></span><br>
0534: * <table style="width: 100%;" border="1" cellpadding="2" cellspacing="2">
0535: * <tbody>
0536: * <tr>
0537: * <td style="vertical-align: top;"><span style="font-weight: bold;">Facet
0538: * Name</span><code><br>
0539: * </code></td>
0540: * <td style="vertical-align: top; font-weight: bold;">Table Item
0541: * Implemented by the Facet<br>
0542: * </td>
0543: * </tr>
0544: * <tr>
0545: * <td><code>actionsBottom</code></td>
0546: * <td>Actions area of
0547: * the Action Bar (bottom).<br>
0548: * </td>
0549: * </tr>
0550: * <tr>
0551: * <td><code>actionsTop</code></td>
0552: * <td>Actions area of
0553: * the Action Bar (top).<br>
0554: * </td>
0555: * </tr>
0556: * <tr>
0557: * <td><code>filter</code></td>
0558: * <td>Drop down menu for
0559: * selecting a filter, in the Filter area of the Action Bar
0560: * (top).<br>
0561: * </td>
0562: * </tr>
0563: * <tr>
0564: * <td><code>filterPanel</code></td>
0565: * <td>Embedded panel for
0566: * specifying custom filter options, which is displayed when user selects
0567: * the Custom Filter option from the filter drop down menu. The
0568: * Custom Filter option is a recommended option that you can provide in
0569: * the drop down component that you specify in the filter
0570: * facet. The Custom Filter can be used to give users greater
0571: * control over filtering. The <a href="table.html#TableFilter">Filter
0572: * example</a>
0573: * explains filters in more detail.<span style="color: rgb(255, 153, 0);"><br>
0574: * </span></td>
0575: * </tr>
0576: * <tr>
0577: * <td><code>footer</code></td>
0578: * <td>Footer that spans
0579: * the
0580: * width of the table. <br>
0581: * </td>
0582: * </tr>
0583: * <tr>
0584: * <td><code>preferencesPanel</code></td>
0585: * <td>Panel displayed when
0586: * the preferences
0587: * toggle button is
0588: * clicked, to allow users to specify
0589: * preferences for viewing the table.<br>
0590: * </td>
0591: * </tr>
0592: * <tr>
0593: * <td><code>sortPanel</code></td>
0594: * <td>Panel displayed when
0595: * the sort toggle
0596: * button is clicked, to
0597: * allow users to specify sort
0598: * options.<br>
0599: * </td>
0600: * </tr>
0601: * <tr>
0602: * <td><code>title</code></td>
0603: * <td>Title in the top bar
0604: * of
0605: * the table.<br>
0606: * </td>
0607: * </tr>
0608: * </tbody>
0609: * </table>
0610: * <br>
0611: * <h3><a name="JavaScript"></a>Client-side
0612: * JavaScript
0613: * Functions</h3>
0614: * <p>The following JavaScript
0615: * functions are available in any page that uses the <code>ui:table</code>
0616: * tag. After the table is rendered, the functions you specify in the JSP
0617: * page can be invoked directly on the rendered HTML elements. For
0618: * example:
0619: * </p>
0620: * <code>var table =
0621: * document.getElementById("form1:table1");<br>
0622: * var count = table.getAllSelectedRowsCount();<br>
0623: * <br>
0624: * </code>
0625: * Note:
0626: * To use the JavaScript functions, <code>formElements.js</code> file
0627: * must be included in the page. The file is automatically included
0628: * by
0629: * the basic components such as the button and dropDown components.<br>
0630: * <br>
0631: * <span style="color: rgb(255, 153, 0);"><br>
0632: * </span>
0633: * <table style="text-align: left; width: 100%;" border="1" cellpadding="2"
0634: * cellspacing="2">
0635: * <tbody>
0636: * <tr>
0637: * <td style="vertical-align: top;"><span style="font-weight: bold;">Function
0638: * Name</span><br>
0639: * </td>
0640: * <td style="vertical-align: top; font-weight: bold;">Purpose<br>
0641: * </td>
0642: * </tr>
0643: * <tr>
0644: * <td style="vertical-align: top;"><code>confirmSelectedRows(message)<br>
0645: * </code></td>
0646: * <td style="vertical-align: top;">Confirm the number of
0647: * selected rows affected by an action such as edit, archive, etc. </td>
0648: * </tr>
0649: * <tr>
0650: * <td style="vertical-align: top;"><code>confirmDeleteSelectedRows()</code></td>
0651: * <td style="vertical-align: top;">Confirm the number of
0652: * selected rows affected by a delete action.</td>
0653: * </tr>
0654: * <tr>
0655: * <td><code><span style="">filterMenuChanged()</span></code></td>
0656: * <td>Toggle the filter panel when the user selects Custom
0657: * Filter in the Filter menu.<span style="color: rgb(102, 102, 204);"> </span>
0658: * </td>
0659: * </tr>
0660: * <tr>
0661: * <td><code>getAllSelectedRowsCount()</code></td>
0662: * <td> Get the number of
0663: * selected rows in the table, including the rows that are rendered
0664: * in the
0665: * current page, and rows that are hidden from view on other pages.<br>
0666: * </td>
0667: * </tr>
0668: * <tr>
0669: * <td><code>getAllHiddenSelectedRowsCount()</code></td>
0670: * <td>Get the number of
0671: * selected rows in the table that are on pages that are not currently
0672: * displayed. <br>
0673: * </td>
0674: * </tr>
0675: * <tr>
0676: * <td style="vertical-align: top;"><code>getAllRenderedSelectedRowsCount()</code></td>
0677: * <td style="vertical-align: top;">Get the number of
0678: * selected rows
0679: * that are currently rendered in the table. This function does not count
0680: * the rows that are hidden from view on other pages. Note that rows might
0681: * be rendered but not visible, and invisible rows are counted. See
0682: * the description of the <code>visible </code>and <code>rendered </code>attributes.
0683: * <br>
0684: * </td>
0685: * </tr>
0686: * <tr>
0687: * <td><code>initAllRows()</code></td>
0688: * <td>Initialize all rows displayed
0689: * in the table when the state
0690: * of selected components change,
0691: * such as when checkboxes or radiobuttons are used to select or deselect
0692: * all rows. <br>
0693: * </td>
0694: * </tr>
0695: * <tr>
0696: * <td style="vertical-align: top;"><code>toggleFilterPanel()</code></td>
0697: * <td style="vertical-align: top;">Open and close the custom filter
0698: * panel.</td>
0699: * </tr>
0700: * <tr>
0701: * <td style="vertical-align: top;"><code>togglePreferencesPanel()</code></td>
0702: * <td style="vertical-align: top;">Open and close the table
0703: * preferences panel.</td>
0704: * </tr>
0705: * </tbody>
0706: * </table>
0707: * <ul>
0708: * </ul>
0709: * <ul>
0710: * </ul>
0711: * <br>
0712: * <h3>Notes about <code>ui:table</code> tag</h3>
0713: * <h4><span style="font-weight: bold;">Life Cycle</span></h4>
0714: * See the <a href="tableRowGroup.html#Lifecycle">Lifecycle
0715: * description </a>in
0716: * the documentation for the <code>ui:tableRowGroup</code> component.<br>
0717: * <h4><span style="font-weight: bold;"><a name="LayoutTables"></a>Layout
0718: * Tables</span></h4>
0719: * <span style="color: rgb(0, 0, 0);">You should not use the </span><code
0720: * style="color: rgb(0, 0, 0);">ui:table</code><span
0721: * style="color: rgb(0, 0, 0);"> tag for page layout. The table
0722: * component renders elements for a table title, columns headers, and row
0723: * headers. These elements should not be used in a layout table, and
0724: * create an
0725: * accessibility issue. Use a standard HTML </span><code
0726: * style="color: rgb(0, 0, 0);"><table></code><span
0727: * style="color: rgb(0, 0, 0);"> element, a </span><code
0728: * style="color: rgb(0, 0, 0);">ui:propertySheet</code><span
0729: * style="color: rgb(0, 0, 0);"> tag, or the JavaServer Faces </span><code
0730: * style="color: rgb(0, 0, 0);">h:dataTable</code><span
0731: * style="color: rgb(0, 0, 0);"> tag to perform page layout. If
0732: * your application needs to iterate over the same components as in
0733: * jato:tiledView, use a custom tag. The JSP Standard Tag Library
0734: * (JSTL) <code>forEach</code> tag might also be useful, but there are
0735: * interoperability issues with JSTL and JavaServer Faces, so use with
0736: * caution. </span><br>
0737: * <h4><span style="font-weight: bold;">Nested Tables</span></h4>
0738: * <span style="text-decoration: line-through;"></span>
0739: * <span style="color: rgb(0, 0, 0);">Although it is technically
0740: * possible to nest tables with the <code>ui:tabl</code>e tag, you should
0741: * not use the table component to layout multiple tables for the following
0742: * reasons:<br>
0743: * </span>
0744: * <ul style="color: rgb(0, 0, 0);">
0745: * <li>
0746: * <p>Nested tables create
0747: * accessibility issues, as described in <a href="#LayoutTables">Layout
0748: * Tables.</a></p>
0749: * </li>
0750: * <li>
0751: * <p>UI guidelines do not
0752: * support nested tables.</p>
0753: * </li>
0754: * <li>
0755: * <p>Styles used by the
0756: * table component might not display properly because they are not
0757: * intended to be nested.</p>
0758: * </li>
0759: * <li>
0760: * <p>Table sorting is not
0761: * supported in nested tables. The table component does not
0762: * support complex components that maintain state not defined by the
0763: * JavaServer Faces <code>EditableValueHolder</code> interface. Since a
0764: * single
0765: * component instance is
0766: * used when iterating over DataProvider rows, only the state of an <code>EditableValueHolder</code>
0767: * can be maintained. <br>
0768: * </p>
0769: * </li>
0770: * </ul>
0771: * <br style="color: rgb(0, 0, 0);">
0772: * <span style="color: rgb(0, 0, 0);">If you need to display similar
0773: * types of data using the same table
0774: * layout, you should use a group table. Sorting is supported for group
0775: * tables because they are
0776: * configured using separate tableRowGroup instances.</span><br
0777: * style="color: rgb(0, 0, 0);">
0778: * <span style="font-weight: bold; color: rgb(0, 0, 0);"><br>
0779: * Validation</span><br style="color: rgb(0, 0, 0);">
0780: * <p style="color: rgb(0, 0, 0);">To maintain state, the table
0781: * component submits the surrounding form.
0782: * For example, when the table is sorted, the form is submitted to update
0783: * checkbox values. Likewise, the form might be submitted to update text
0784: * field values when the table component must display a new page of a
0785: * paginated table. These components cannot be updated if validation
0786: * fails for any reason. If a component requires a value to be entered,
0787: * and no value is entered, validation fails. <br>
0788: * </p>
0789: * <p style="color: rgb(0, 0, 0);">Consider the case where a
0790: * required text field and
0791: * table
0792: * appear on the same page. If the user clicks on a table sort button
0793: * while the required text field has no value, the sort action is never
0794: * invoked because a value was required and validation failed. <br>
0795: * </p>
0796: * <p style="color: rgb(0, 0, 0);">To prevent this validation issue,
0797: * you can do either of the following:<br>
0798: * </p>
0799: * <ul style="color: rgb(0, 0, 0);">
0800: * <li>Place the table and the required component in separate forms, to
0801: * allow the table data to be submitted separately from the required
0802: * field. The table can then be sorted without triggering a validation
0803: * failure on a required text field that has no value because the text
0804: * field's form is not submitted. However, the values of one form
0805: * are lost when the other form is submitted, which is expected HTML
0806: * behavior. In this example, if a user places a value in a required text
0807: * field and then sorts the table, the value in the text field is
0808: * lost. <br>
0809: * </li>
0810: * </ul>
0811: * <ul style="color: rgb(0, 0, 0);">
0812: * <li>Place the table in a virtual
0813: * form by setting the <code>internalVirtualForm</code>
0814: * method of the Table component to true. For example: <br>
0815: * <br>
0816: * <code>// Set table component.<br>
0817: * public void setTable(Table table) {<br>
0818: * this.table = table;<br>
0819: * <br>
0820: * // This binding is used only
0821: * for the internal virtual form example.<br>
0822: *
0823: * table.setInternalVirtualForm(true);<br>
0824: * }</code><br>
0825: * <br>
0826: * A virtual form allows the table data to be
0827: * submitted separately from the
0828: * other components on the page, just as using two separate HTML forms
0829: * would allow. Placing
0830: * the table in a virtual form allows the table sort action to complete
0831: * because validation for the required text field is not processed. This
0832: * behavior is similar to that caused by setting the <code>immediate</code>
0833: * property of a
0834: * button, but allows
0835: * table children to be updated so that selected checkbox values may be
0836: * sorted, for example. The
0837: * advantage to using a virtual form is that the values of the other
0838: * components on the page are not lost when table data is submitted.<br>
0839: * </li>
0840: * </ul>
0841: * <p style="margin-left: 40px; color: rgb(0, 0, 0);">
0842: * </p>
0843: * <h4 style="color: rgb(0, 0, 0);"><span style="font-weight: bold;">Value
0844: * Bindings</span></h4>
0845: * <span style="color: rgb(0, 0, 0);">Value
0846: * expressions that use DataProviders must use the following syntax:
0847: * </span><br style="color: rgb(0, 0, 0);">
0848: * <code style="color: rgb(0, 0, 0);">#{sourceVar['PERSON.NAME']}<br>
0849: * #{sourceVar.value['PERSON.NAME']}<br>
0850: * </code>
0851: * <p style="color: rgb(0, 0, 0);">Note
0852: * that the word <code>value</code> is between the DataProvider and the
0853: * FieldKey to bind. The brackets [] are required
0854: * only if the FieldKey contains dot syntax. <br>
0855: * </p>
0856: * <span style="color: rgb(0, 0, 0);">For example:</span><br
0857: * style="color: rgb(0, 0, 0);">
0858: * <ul style="color: rgb(0, 0, 0);">
0859: * <li>To
0860: * bind to a FieldKey named <code>last</code>, where the <code>sourceVar</code>
0861: * property of the table component is <code>names</code>:<br>
0862: * <p><code>#{names.value.last}</code></p>
0863: * </li>
0864: * </ul>
0865: * <div style="margin-left: 40px; color: rgb(0, 0, 0);"><code></code></div>
0866: * <code style="color: rgb(0, 0, 0);"></code><br
0867: * style="color: rgb(0, 0, 0);">
0868: * <ul style="color: rgb(0, 0, 0);">
0869: * <li>To
0870: * bind to a property named <code>test</code>, where the backing bean is
0871: * named <code>TableBean</code>.</li>
0872: * </ul>
0873: * <div style="margin-left: 40px; color: rgb(0, 0, 0);"><code>#{TableBean.test}</code><br>
0874: * <code></code></div>
0875: * <h4 style="color: rgb(0, 0, 0);"><span style="font-weight: bold;">Method
0876: * Bindings</span></h4>
0877: * <span style="color: rgb(0, 0, 0);">A JavaServer Faces issue prevents
0878: * method bindings from
0879: * working in a DataProvider. To work around the issue, you can bind to a
0880: * method in a backing bean, and use that method to retrieve values from
0881: * the DataProvider. </span><span
0882: * style="font-weight: bold; color: rgb(0, 0, 0);"><br>
0883: * <br>
0884: * </span><span style="color: rgb(0, 0, 0);">For example, the
0885: * following
0886: * syntax to bind to a DataProvider does not work:</span><br
0887: * style="color: rgb(0, 0, 0);">
0888: * <br>
0889: * <code><ui:hyperlink text="#{name.last}" action="#{name.action}"/></code><br>
0890: * <br>
0891: * Instead of using a DataProvider to handle the action (which breaks the
0892: * MVC paradigm), bind the action to a method in the backing bean. For
0893: * example:<br>
0894: * <br>
0895: * <code><ui:hyperlink text="#{name.last}"
0896: * action="#{TableBean.action}"/></code><br>
0897: * <br>
0898: * In the <code>TableBean.action</code> method, you may invoke the
0899: * following code to
0900: * retrieve values from the DataProvider:<br>
0901: * <br>
0902: * <code>public String action() {<br>
0903: * FacesContext context =
0904: * FacesContext.getCurrentInstance();<br>
0905: * ValueBinding vb =
0906: * context.getApplication().createValueBinding("#{name.first}");<br>
0907: * String first = (String) (vb.getValue(context));<br>
0908: * return "whatever";<br>
0909: * }</code><br>
0910: * <br>
0911: * If you have an instance of the DataProvider, you can also invoke the
0912: * following code to retrieve values: <br>
0913: * <br>
0914: * <code>public String action() {<br>
0915: * FacesContext context =
0916: * FacesContext.getCurrentInstance();<br>
0917: * ValueBinding vb =
0918: * context.getApplication().createValueBinding("#{name.tableRow}");<br>
0919: * RowKey row = (RowKey) (vb.getValue(context));<br>
0920: * String first = (String)
0921: * provider.getFieldKey("first"), row)<br>
0922: * }</code><br>
0923: * <h4 style="color: rgb(0, 0, 0);"><span style="font-weight: bold;">Logging</span></h4>
0924: * To see messages logged by the table component, set the following global
0925: * defaults in your JDK's "jre/lib/logging.properties" file.
0926: * Alternatively, you can use a different file by specifying a filename
0927: * with the java.util.logging.config.file system property (e.g., setenv
0928: * CATALINA_OPTS -Djava.util.logging.config.file=myFile).<br>
0929: * <br>
0930: * <code></code><code>java.util.logging.ConsoleHandler.level = FINE <br>
0931: * com.sun.rave.web.ui.event.TablePaginationActionListener.level = FINE <br>
0932: * com.sun.rave.web.ui.event.TableSelectPhaseListener.level = FINE <br>
0933: * com.sun.rave.web.ui.event.TableSortActionListener.level = FINE <br>
0934: * com.sun.rave.web.ui.component.Table.level = FINE<br>
0935: * com.sun.rave.web.ui.component.TableActions.level = FINE <br>
0936: * com.sun.rave.web.ui.component.TableColumn.level = FINE <br>
0937: * com.sun.rave.web.ui.component.TableFooter.level = FINE <br>
0938: * com.sun.rave.web.ui.component.TableHeader.level = FINE <br>
0939: * com.sun.rave.web.ui.component.TablePanels.level = FINE <br>
0940: * com.sun.rave.web.ui.component.TableRowGroup.level = FINE <br>
0941: * com.sun.rave.web.ui.renderer.TableActionsRenderer.level = FINE <br>
0942: * com.sun.rave.web.ui.renderer.TableColumnRenderer.level = FINE <br>
0943: * com.sun.rave.web.ui.renderer.TableFooterRenderer.level = FINE <br>
0944: * com.sun.rave.web.ui.renderer.TableHeaderRenderer.level = FINE <br>
0945: * com.sun.rave.web.ui.renderer.TablePanelsRenderer.level = FINE <br>
0946: * com.sun.rave.web.ui.renderer.TableRenderer.level = FINE <br>
0947: * com.sun.rave.web.ui.renderer.TableRowGroupRenderer.level = FINE<br>
0948: * </code><code></code><br>
0949: * <h3 style="color: rgb(0, 0, 0);">Examples</h3>
0950: * <span style="color: rgb(0, 0, 0);">The following examples use a
0951: * backing bean called </span><a href="table.html#Example:_TableBean_"
0952: * style="color: rgb(0, 0, 0);">TableBean</a><span
0953: * style="color: rgb(0, 0, 0);">
0954: * and </span><a href="table.html#UtilityClasses"
0955: * style="color: rgb(0, 0, 0);">some
0956: * utility classes</a><span style="color: rgb(0, 0, 0);">, which are
0957: * included after the examples.
0958: * Additional examples are shown in the </span><code
0959: * style="color: rgb(0, 0, 0);"><a href="tableRowGroup.html">ui:tableRowGroup</a></code><span
0960: * style="color: rgb(0, 0, 0);">
0961: * and </span><code style="color: rgb(0, 0, 0);"><a
0962: * href="tableColumn.html">ui:tableColumn</a></code><span
0963: * style="color: rgb(0, 0, 0);">
0964: * documents.</span><br style="color: rgb(0, 0, 0);">
0965: * <br>
0966: * <span style="font-weight: bold;">Examples in this file:</span>
0967: * <div style="margin-left: 40px;">
0968: * <p><a href="table.html#BasicTable">Example
0969: * 1: Basic Table</a></p>
0970: * <p><a href="table.html#CustomTitle">Example
0971: * 2: Custom Title in Table</a></p>
0972: * <p><a href="table.html#PaginatedTable">Example
0973: * 3: Paginated Table</a></p>
0974: * <p><a href="table.html#TableSortPanel">Example
0975: * 4: Table Sort Panel</a></p>
0976: * <p><a href="table.html#TablePreferences">Example
0977: * 5: Table Preferences</a></p>
0978: * <p><a href="table.html#TableFilter">Example
0979: * 6: Table Filter</a></p>
0980: * <p><a href="table.html#TableActions">Example
0981: * 7: Table Actions</a></p>
0982: * </div>
0983: * <p style="font-weight: bold;">Supporting files:</p>
0984: * <div style="margin-left: 40px;">
0985: * <p><a href="table.html#Example:_TableBean_">TableBean
0986: * backing bean </a></p>
0987: * <p><a href="table.html#UtilityClasses">Utility
0988: * classes used in the examples</a></p>
0989: * </div>
0990: * <h4><a name="BasicTable"></a>Example 1: Basic Table</h4>
0991: * This example shows how to create a basic
0992: * table.<br>
0993: * <br>
0994: * <code><!-- Basic Table --><br>
0995: * <ui:table id="table1" title="Basic Table"><br>
0996: * <ui:tableRowGroup id="rowGroup1"<br>
0997: * sourceData="#{TableBean.groupB.names}"
0998: * sourceVar="name"><br>
0999: * <ui:tableColumn id="col1"<br>
1000: * alignKey="last"
1001: * headerText="Last Name" rowHeader="true"><br>
1002: * <ui:staticText
1003: * text="#{name.value.last}"/><br>
1004: * </ui:tableColumn><br>
1005: * <ui:tableColumn id="col2" alignKey="first"
1006: * headerText="First Name"><br>
1007: * <ui:staticText
1008: * text="#{name.value.first}"/><br>
1009: * </ui:tableColumn><br>
1010: * </ui:tableRowGroup><br>
1011: * </ui:table></code><br>
1012: * <br>
1013: * <a name="CustomTitle"></a><span style="font-weight: bold;">Example 2:
1014: * Custom Title</span><br>
1015: * <span style="color: rgb(0, 0, 0);">This example shows how
1016: * to
1017: * create a custom title for a table, using the <code></code><code>title</code>
1018: * facet. When
1019: * you
1020: * use the
1021: * title
1022: * attribute as shown in the <a href="#BasicTable">BasicTable</a>
1023: * example, the
1024: * component provides a default title implementation which can include
1025: * information regarding paginated rows and applied
1026: * filters. This example implements the title with a <code>ui:staticText</code>
1027: * tag in
1028: * the <code>title</code> facet.</span><br>
1029: * <code><br>
1030: * <!-- Custom Title --><br>
1031: * <ui:table id="table1"><br>
1032: * <ui:tableRowGroup id="rowGroup1" <br>
1033: * sourceData="#{TableBean.groupB.names}"
1034: * sourceVar="name"><br>
1035: * <ui:tableColumn id="col1" <br>
1036: * alignKey="last"
1037: * headerText="Last Name" rowHeader="true"><br>
1038: * <ui:staticText
1039: * text="#{name.value.last}"/><br>
1040: * </ui:tableColumn><br>
1041: * <ui:tableColumn id="col2" alignKey="first"
1042: * headerText="First Name"><br>
1043: * <ui:staticText
1044: * text="#{name.value.first}"/><br>
1045: * </ui:tableColumn><br>
1046: * </ui:tableRowGroup><br>
1047: * <!-- Title --><br>
1048: * <f:facet name="title"><br>
1049: * <ui:staticText text="Custom Title"/><br>
1050: * </f:facet><br>
1051: * </ui:table></code><br>
1052: * <h4><a name="PaginatedTable"></a>Example 3: Paginated Table<br>
1053: * </h4>
1054: * This example shows how to create a paginated
1055: * table. The default number of rows to be displayed for a paginated table
1056: * is 25 per page.<span style="color: rgb(102, 102, 204);"> </span>You
1057: * can override this value with
1058: * the
1059: * <code>rows</code> attribute<span style="color: rgb(102, 102, 204);"> </span>in
1060: * the <code>ui:tableRowGroup</code> tag. <br>
1061: * <br>
1062: * Note: The rows attribute is used only for paginated tables.<br>
1063: * <br>
1064: * <code><!-- Paginated Table --><br>
1065: * <ui:table id="table1"<br>
1066: * paginateButton="true"<br>
1067: * paginationControls="true"<br>
1068: * title="Paginated Table"><br>
1069: * <ui:tableRowGroup id="rowGroup1"<br>
1070: * sourceData="#{TableBean.groupA.names}"
1071: * sourceVar="name" rows="5"><br>
1072: * <ui:tableColumn id="col1"<br>
1073: * alignKey="last"
1074: * headerText="Last Name" rowHeader="true"><br>
1075: * <ui:staticText
1076: * text="#{name.value.last}"/><br>
1077: * </ui:tableColumn><br>
1078: * <ui:tableColumn id="col2" alignKey="first"
1079: * headerText="First Name"><br>
1080: * <ui:staticText
1081: * text="#{name.value.first}"/><br>
1082: * </ui:tableColumn><br>
1083: * </ui:tableRowGroup><br>
1084: * </ui:table></code><br>
1085: * <h4><a name="TableSortPanel"></a>Example 4: Sort Panel<br>
1086: * </h4>
1087: * This example shows how to add
1088: * the sort panel. You
1089: * can use the
1090: * default sort panel by setting the
1091: * <code>sortPanelToggleButton</code>
1092: * attribute to true. This button opens an embedded panel in the table,
1093: * displaying a default implementation. The default
1094: * implementation shows
1095: * one, two, or three drop down menus that represent the primary,
1096: * secondary, and
1097: * tertiary sorts. The menus
1098: * list the column headers for each sortable column. If a column is not
1099: * sortable, it is not shown as a sortable option. If there are
1100: * only two sortable columns, only the primary and secondary drop down
1101: * menus are shown. If there is only one sort, only the
1102: * primary drop down menu is shown. Next to each sort menu is a menu to
1103: * select ascending or descending sort order.<span
1104: * style="color: rgb(102, 102, 204);"><br>
1105: * </span>
1106: * <p> </p>
1107: * <code><!-- Sort Panel --><br>
1108: * <ui:table id="table"<br>
1109: * clearSortButton="true"<br>
1110: * sortPanelToggleButton="true"<br>
1111: * title="Sort Panel"><br>
1112: * <!-- Insert tableRowGroup tag here --><br>
1113: * </ui:table></code><br>
1114: * <br>
1115: * To override the default sort panel, use the <code>sortPanel</code>
1116: * facet. The sort panel toggle
1117: * button is shown when you use the facet, so you do not
1118: * need to specify the <code>sortPanelToggleButton</code>
1119: * attribute. <br>
1120: * <code></code>
1121: * <h4><a name="TablePreferences"></a>Example 5: Table Preferences<br>
1122: * </h4>
1123: * <code></code>This example shows how
1124: * to add the preferences toggle button and the table panel. The
1125: * preferences panel toggle button is
1126: * shown only when you use the <code>preferencesPanel</code>
1127: * facet.
1128: * The button opens an embedded panel in the table, displaying the
1129: * contents that you provide in the <code>preferencesPanel</code> facet. <br
1130: * style="color: rgb(102, 102, 204);">
1131: * <br style="color: rgb(102, 102, 204);">
1132: * In this example, the preferences panel is used to set
1133: * the number
1134: * of paginated rows with the rows attribute of <code>ui:tableRowGroup</code>.
1135: * See the <a href="#Preferences.java">Preferences.java</a> example
1136: * utility class, which provides functionality for preferences for
1137: * this example.<br>
1138: * <code></code><br>
1139: * <code><!-- Preferences --><br>
1140: * <ui:table id="table1" paginationControls="true"
1141: * title="Preferences"><br>
1142: * <ui:tableRowGroup id="rowGroup1"<br>
1143: *
1144: * rows="#{TableBean.groupA.preferences.rows}"<br>
1145: * sourceData="#{TableBean.groupA.names}"<br>
1146: * sourceVar="name"><br>
1147: * <ui:tableColumn id="col1"<br>
1148: * alignKey="last"
1149: * headerText="Last Name" rowHeader="true"><br>
1150: * <ui:staticText
1151: * text="#{name.value.last}"/><br>
1152: * </ui:tableColumn><br>
1153: * <ui:tableColumn id="col2" alignKey="first"
1154: * headerText="First Name"><br>
1155: * <ui:staticText
1156: * text="#{name.value.first}"/><br>
1157: * </ui:tableColumn><br>
1158: * </ui:tableRowGroup><br>
1159: * <br>
1160: * <!-- Preferences Panel --><br>
1161: * <f:facet name="preferencesPanel"><br>
1162: * <f:subview id="preferencesPanel"><br>
1163: * <jsp:include
1164: * page="preferencesPanel.jsp"/><br>
1165: * </f:subview><br>
1166: * </f:facet><br>
1167: * </ui:table></code><br>
1168: * <br style="color: rgb(102, 102, 204);">
1169: * <span style="font-weight: bold;">preferencesPanel.jsp</span><br
1170: * style="color: rgb(102, 102, 204);">
1171: * <br>
1172: * This example shows the contents of the <code>preferencesPanel.jsp</code>
1173: * file included in the JSP page example above.<br>
1174: * <br>
1175: * <code><!-- Preferences Panel --><br>
1176: * <ui:textField id="rows"<br>
1177: * columns="5"<br>
1178: * label="Rows Per Page:"<br>
1179: * labelLevel="2"<br>
1180: * onKeyPress="if (event.keyCode==13) {var
1181: * e=document.getElementById('form1:table1:preferencesPanel:submit'); if
1182: * (e != null) e.click(); return false}"<br>
1183: *
1184: * text="#{TableBean.groupA.preferences.preference}"/><br>
1185: * <ui:markup tag="div" styleClass="TblPnlBtnDiv"><br>
1186: * <ui:button id="submit"<br>
1187: *
1188: * action="#{TableBean.groupA.preferences.applyPreferences}"<br>
1189: * mini="true"<br>
1190: * primary="true"<br>
1191: * text="OK"/><br>
1192: * <ui:button id="cancel"<br>
1193: * mini="true"<br>
1194: * onClick="togglePreferencesPanel();
1195: * return false"<br>
1196: * text="Cancel"/><br>
1197: * </ui:markup><br>
1198: * <br>
1199: * <!-- Note: If the user presses the enter key while the text field
1200: * has focus,<br>
1201: * the page will be submitted incorrectly, unless
1202: * we capture the onKeyPress<br>
1203: * event and invoke the click method of the
1204: * submit button. --></code><br>
1205: * <br>
1206: * <span style="font-weight: bold;">preferences.js</span><br>
1207: * <br>
1208: * This example shows the contents of the preferences.js file used in the <code>tablePreferencesPanel.jsp</code>
1209: * example
1210: * above. The <code>togglePreferencesPanel()</code> JavaScript function
1211: * is used with
1212: * the <code>onClick</code> attribute of a <code>ui:button</code> tag.<br>
1213: * <br>
1214: * <code>// Use this function to toggle the preferences panel open or
1215: * closed. This<br>
1216: * // functionality requires the filterId of the table component to be set.<br>
1217: * function togglePreferencesPanel() {<br>
1218: * var table = document.getElementById("form1:table1");<br>
1219: * table.togglePreferencesPanel();<br>
1220: * }</code><br>
1221: * <h4><a name="TableFilter"></a>Example 6: Table Filter<br>
1222: * </h4>
1223: * <p>This example shows how to add filters using a filter drop down
1224: * menu and the filter panel. In this example, the filter
1225: * panel is used to set a custom filter.
1226: * The custom filter removes all rows from the view that do not match the
1227: * given last name. <span style="color: rgb(0, 0, 0);">See the </span><a
1228: * href="#Filter.java" style="color: rgb(0, 0, 0);">Filter.java</a><span
1229: * style="color: rgb(0, 0, 0);">
1230: * example, which provides the functionality for filters for
1231: * this example.</span></p>
1232: * <p style="color: rgb(0, 0, 0);">Basic
1233: * filters
1234: * are filters that
1235: * you define for the users of your application. Custom filters enable
1236: * users to specify the data to be used by the table component to
1237: * determine which table entries to display. You specify the basic
1238: * filter names as items in a <a href="dropDown.html"><code>ui:dropDown</code>
1239: * </a>tag in the <code>filter</code>
1240: * facet. If you want to allow users to use a custom filter, include a
1241: * "Custom Filter" item as one of the <code>ui:dropDown</code>
1242: * items. <br>
1243: * </p>
1244: * <p style="color: rgb(0, 0, 0);">If you
1245: * include a "Custom Filter" item in
1246: * the Filter drop down menu, you can allow users to
1247: * open a filter panel to filter the table data using a custom
1248: * filter. When the Custom
1249: * Filter option is selected, an embedded panel in the table is
1250: * opened,
1251: * displaying the contents that you provide in the <code>filterPanel</code>
1252: * facet. The default
1253: * custom filter functionality requires you to use the
1254: * <code>filterMenuChanged</code> JavaScript function for the <code>onChange</code>
1255: * event in the <code>ui:dropDown</code> tag. After the custom
1256: * filter is
1257: * applied, you should display a non-selectable "Custom
1258: * Filter Applied" item in
1259: * the
1260: * filter drop down menu,
1261: * to indicate that a custom filter has been applied. You should also set
1262: * the <code>filterText</code> attribute. The table component updates the
1263: * table title to
1264: * indicate that a basic or custom
1265: * filter has been applied by inserting the text <span
1266: * style="font-style: italic;"><filterText></span> Filter Applied. </p>
1267: * <p style="color: rgb(0, 0, 0);">The
1268: * default
1269: * custom filter
1270: * functionality depends on a specific value assigned to the
1271: * Custom Filter item in the dropDown component. The table component
1272: * provides a method named <code>getFilterOptions()</code> to add the
1273: * item text and value for the custom filter option to the drop down list.
1274: * You can use <code>getFilterOptions()</code> in your backing
1275: * bean to append either the
1276: * "Custom Filter" or "Custom Filter Applied" item to the basic filter
1277: * items. <br>
1278: * </p>
1279: * <p style="color: rgb(0, 0, 0);">In the <a href="#Filter.java">Filter.java</a>
1280: * util example, the
1281: * "Custom Filter" and "Custom Filter Applied" items are
1282: * assigned
1283: * based on the
1284: * boolean value <code style="text-decoration: line-through;"></code>
1285: * provided
1286: * to <code>getFilterOptions(</code><code>)</code>. If
1287: * this value is true,
1288: * the
1289: * "Custom Filter Applied" item value is added. If the value is false,
1290: * "Custom Filter" item value is added. The <code>filterMenuChanged</code>
1291: * JavaScript function, assigned to the dropDown component's <code>onChange</code>
1292: * event, behaves differently depending on
1293: * which item is added. See the comments in <a href="#filters.js">filters.js </a>for
1294: * more information. <br>
1295: * </p>
1296: * <p style="color: rgb(0, 0, 0);">The
1297: * default custom filter functionality
1298: * also depends on the id of the
1299: * <code>ui:dropDown</code> tag in the <code>filter</code>
1300: * facet. Note that if you use the <code>ui:dropDown</code> tag as the
1301: * only component
1302: * in the filter facet, the <code>filterId</code> is optional. If you use
1303: * a custom
1304: * component, or use the <code>ui:dropDown</code> as a child component,
1305: * you must
1306: * specify a filterID.</p>
1307: * <span style="color: rgb(0, 0, 0);">The table
1308: * implements functionality to reset the dropDown menu. If you
1309: * use the <code>filterId</code> attribute, the menu can be reset
1310: * whenever the sort and preferences toggle buttons are clicked. You can
1311: * also use the filterMenuChanged JavaScript function to reset the menu at
1312: * some other time. Note:
1313: * This functionality requires the </span><code
1314: * style="color: rgb(0, 0, 0);">selected</code><span
1315: * style="color: rgb(0, 0, 0);"> value of the <code>ui:dropDown</code>
1316: * tag to be set in order
1317: * to
1318: * restore the default selected value when the embedded filter panel is
1319: * closed.</span><br style="color: rgb(0, 0, 0);">
1320: * <span style="color: rgb(0, 0, 0);"><br>
1321: * </span><span style="color: rgb(102, 102, 204);"><span
1322: * style="color: rgb(0, 0, 0);">The filter
1323: * code can be placed in a util class, as shown in the </span><a
1324: * href="#Filter.java" style="color: rgb(0, 0, 0);">Filter.java</a><span
1325: * style="color: rgb(0, 0, 0);"> example, or in a backing bean.</span><span
1326: * style="font-weight: bold;"><br>
1327: * </span></span><span style="color: rgb(102, 102, 204);"></span><br>
1328: * <code><!-- Filter --><br>
1329: * <ui:table id="table1"<br>
1330: * filterText="#{TableBean.groupA.filter.filterText}"<br>
1331: * paginateButton="true"<br>
1332: * paginationControls="true"<br>
1333: * title="Filter"><br>
1334: * <ui:tableRowGroup id="rowGroup1"<br>
1335: *
1336: * binding="#{TableBean.groupA.tableRowGroup}"<br>
1337: * rows="5"<br>
1338: * sourceData="#{TableBean.groupA.names}"<br>
1339: * sourceVar="name"><br>
1340: * <ui:tableColumn id="col1"<br>
1341: * alignKey="last"
1342: * headerText="Last Name" rowHeader="true"><br>
1343: * <ui:staticText
1344: * text="#{name.value.last}"/><br>
1345: * </ui:tableColumn><br>
1346: * <ui:tableColumn id="col2" alignKey="first"
1347: * headerText="First Name"><br>
1348: * <ui:staticText
1349: * text="#{name.value.first}"/><br>
1350: * </ui:tableColumn><br>
1351: * </ui:tableRowGroup><br>
1352: * <br>
1353: * <!-- Filter --><br>
1354: * <f:facet name="filter"><br>
1355: * <ui:dropDown submitForm="true" id="filter"<br>
1356: *
1357: * action="#{TableBean.groupA.filter.applyBasicFilter}" <br>
1358: *
1359: * items="#{TableBean.groupA.filter.filterOptions}"<br>
1360: * onChange="if
1361: * (filterMenuChanged() == false) return false"<br>
1362: *
1363: * selected="#{TableBean.groupA.filter.basicFilter}"/><br>
1364: * </f:facet><br>
1365: * <br>
1366: * <!-- Filter Panel --><br>
1367: * <f:facet name="filterPanel"><br>
1368: * <f:subview id="filterPanel"><br>
1369: * <jsp:include
1370: * page="filterPanel.jsp"/><br>
1371: * </f:subview><br>
1372: * </f:facet><br>
1373: * </ui:table></code><br>
1374: * <br>
1375: * <span style="font-weight: bold;">filterPanel.jsp</span><br>
1376: * <br>
1377: * This example shows the contents of the <code>filterPanel.jsp</code><span
1378: * style="font-weight: bold;"> </span>file included in the JSP page in
1379: * the example above.<br>
1380: * <code><br>
1381: * <!-- Filter Panel --><br>
1382: * <ui:textField id="customFilter"<br>
1383: * columns="50"<br>
1384: * label="Show only rows containing last name:"<br>
1385: * labelLevel="2"<br>
1386: * onKeyPress="if (event.keyCode==13) {var
1387: * e=document.getElementById('form1:table1:filterPanel:submit'); if (e !=
1388: * null) e.click(); return false}"<br>
1389: * text="#{TableBean.groupA.filter.customFilter}"/><br>
1390: * <ui:markup tag="div" styleClass="TblPnlBtnDiv"><br>
1391: * <ui:button id="submit"<br>
1392: *
1393: * action="#{TableBean.groupA.filter.applyCustomFilter}"<br>
1394: * mini="true"<br>
1395: * primary="true"<br>
1396: * text="OK"/><br>
1397: * <ui:button id="cancel"<br>
1398: * mini="true"<br>
1399: * onClick="toggleFilterPanel(); return
1400: * false"<br>
1401: * text="Cancel"/><br>
1402: * </ui:markup><br>
1403: * <br>
1404: * <!-- Note: If the user presses the enter key while the text field
1405: * has focus,<br>
1406: * the page will be submitted incorrectly, unless
1407: * we capture the onKeyPress<br>
1408: * event and invoke the click method of the
1409: * submit button. --></code><br>
1410: * <br>
1411: * <span style="font-weight: bold;"><a name="filters.js"></a>filters.js</span><br>
1412: * <br>
1413: * This example shows the contents of the <code>filters.js</code><span
1414: * style="font-weight: bold;"> </span>file used in the <code>filterPanel.jsp<br>
1415: * </code>example above. The <code>toggleFilterPanel()</code>
1416: * JavaScript function is used with the <code>onClick</code> attribute of
1417: * a <code>ui:button</code> tag to allow the user to close the
1418: * filter panel without specifying a filter.<br>
1419: * <br>
1420: * <code>// Toggle the filter panel from the filter menu.<br>
1421: * //<br>
1422: * // If the "Custom Filter" option has been selected, the filter panel is
1423: * <br>
1424: * // toggled. In this scenario, false is returned indicating the onChange
1425: * event,<br>
1426: * // generated by the filter menu, should not be allowed to continue.<br>
1427: * // <br>
1428: * // If the "Custom Filter Applied" option has been selected, no action
1429: * is taken.<br>
1430: * // Instead, the filter menu is reverted back to the original selection.
1431: * In this<br>
1432: * // scenario, false is also returned indicating the onChange event,
1433: * generated by<br>
1434: * // the filter menu, should not be allowed to continue.<br>
1435: * //<br>
1436: * // For all other selections, true is returned indicating the onChange
1437: * event, <br>
1438: * // generated by the filter menu, should be allowed to continue.<br>
1439: * function filterMenuChanged() {<br>
1440: * var table = document.getElementById("form1:table1");<br>
1441: * return table.filterMenuChanged();<br>
1442: * }<br>
1443: * <br>
1444: * // Use this function to toggle the filter panel open or closed. This<br>
1445: * // functionality requires the filterId of the table component to be
1446: * set. In <br>
1447: * // addition, the selected value must be set as well to restore the
1448: * default<br>
1449: * // selected value when the embedded filter panel is closed.<br>
1450: * function toggleFilterPanel() {<br>
1451: * var table = document.getElementById("form1:table1");<br>
1452: * table.toggleFilterPanel();<br>
1453: * }</code><br>
1454: * <h4><a name="TableActions"></a>Example 7: Table Actions<br>
1455: * </h4>
1456: * <span style="color: rgb(0, 0, 0);">This example shows how to add
1457: * actions </span><span style="color: rgb(102, 102, 204);"><span
1458: * style="color: rgb(0, 0, 0);">to a table by using the </span><code
1459: * style="color: rgb(0, 0, 0);">actionsTop</code><span
1460: * style="color: rgb(0, 0, 0);">
1461: * and </span><code style="color: rgb(0, 0, 0);">actionsBottom</code><span
1462: * style="color: rgb(0, 0, 0);">
1463: * facets. Four buttons and a drop down menu are added to the Action Bar
1464: * (top) and Action Bar (bottom). When the page is initially
1465: * displayed, all actions
1466: * are disabled. When the user selects at least one checkbox, the actions
1467: * are enabled. If the user deselects all checkboxes, the actions are
1468: * disabled again. </span><br>
1469: * <br>
1470: * <span style="color: rgb(0, 0, 0);">Note that this example defines a
1471: * JavaScript function called </span><code style="color: rgb(0, 0, 0);">disableActions</code><span
1472: * style="color: rgb(0, 0, 0);">, which is shown in </span><a
1473: * href="table.html#actions.js" style="color: rgb(0, 0, 0);">actions.js.
1474: * </a><span style="color: rgb(0, 0, 0);">The </span></span><code
1475: * style="color: rgb(0, 0, 0);">disableActions</code><span
1476: * style="color: rgb(0, 0, 0);"> function is
1477: * defined by the developer, and is not part of the table component. </span><br
1478: * style="color: rgb(0, 0, 0);">
1479: * <br style="color: rgb(0, 0, 0);">
1480: * <span style="color: rgb(0, 0, 0);">When the
1481: * user clicks on a checkbox, a JavaScript <code>disableActions</code>
1482: * function is invoked
1483: * with the <code>onClick</code> event. The JavaScript <code>setTimeout</code>
1484: * function
1485: * is used to ensure checkboxes are selected immediately, instead of
1486: * waiting for
1487: * the JavaScript function to complete.
1488: * See the <a href="#Actions.java">Actions.java</a> example, which
1489: * provides functionality for table actions in this example.</span><br
1490: * style="color: rgb(0, 0, 0);">
1491: * <br>
1492: * <code><!-- Actions --><br>
1493: * <ui:table id="table1"<br>
1494: * deselectMultipleButton="true"<br>
1495: *
1496: * deselectMultipleButtonOnClick="setTimeout('disableActions()', 0)"<br>
1497: * paginateButton="true"<br>
1498: * paginationControls="true"<br>
1499: * selectMultipleButton="true"<br>
1500: *
1501: * selectMultipleButtonOnClick="setTimeout('disableActions()', 0)"<br>
1502: * title="Actions"><br>
1503: * <ui:tableRowGroup id="rowGroup1"<br>
1504: *
1505: * binding="#{TableBean.groupA.tableRowGroup}"<br>
1506: * rows="5"<br>
1507: *
1508: * selected="#{TableBean.groupA.select.selectedState}"<br>
1509: * sourceData="#{TableBean.groupA.names}"<br>
1510: * sourceVar="name"><br>
1511: * <ui:tableColumn id="col0"<br>
1512: * selectId="select"<br>
1513: *
1514: * sort="#{TableBean.groupA.select.selectedState}"><br>
1515: * <ui:checkbox id="select"<br>
1516: *
1517: * onClick="setTimeout('initAllRows(); disableActions()', 0)"<br>
1518: *
1519: * selected="#{TableBean.groupA.select.selected}"<br>
1520: *
1521: * selectedValue="#{TableBean.groupA.select.selectedValue}"/><br>
1522: * </ui:tableColumn><br>
1523: * <ui:tableColumn id="col1" <br>
1524: * alignKey="last"
1525: * headerText="Last Name" rowHeader="true"><br>
1526: * <ui:staticText
1527: * text="#{name.value.last}"/><br>
1528: * </ui:tableColumn><br>
1529: * <ui:tableColumn id="col2" alignKey="first"
1530: * headerText="First Name"><br>
1531: * <ui:staticText
1532: * text="#{name.value.first}"/><br>
1533: * </ui:tableColumn><br>
1534: * </ui:tableRowGroup><br>
1535: * <br>
1536: * <!-- Actions (Top) --><br>
1537: * <f:facet name="actionsTop"><br>
1538: * <f:subview id="actionsTop"><br>
1539: * <jsp:include
1540: * page="actionsTop.jsp"/><br>
1541: * </f:subview><br>
1542: * </f:facet><br>
1543: * <br>
1544: * <!-- Actions (Bottom) --><br>
1545: * <f:facet name="actionsBottom"><br>
1546: * <f:subview id="actionsBottom"><br>
1547: * <jsp:include
1548: * page="actionsBottom.jsp"/><br>
1549: * </f:subview><br>
1550: * </f:facet><br>
1551: * </ui:table></code><code><br>
1552: * <br>
1553: * </code><span style="font-weight: bold;">actionsTop.jsp</span><br>
1554: * <br>
1555: * This example shows the contents of the <code>actionsTop.jsp</code><span
1556: * style="font-weight: bold;"> </span>file included in the <code>actionsTop</code>
1557: * facet in the JSP page in the example above.<br>
1558: * <br>
1559: * <code><!-- Actions (Top) --><br>
1560: * <ui:button id="action1"<br>
1561: * action="#{TableBean.groupA.actions.delete}"<br>
1562: * disabled="#{TableBean.groupA.actions.disabled}"<br>
1563: * onClick="if (confirmDeleteSelectedRows() == false)
1564: * return false"<br>
1565: * text="Delete"/><br>
1566: * <ui:button id="action2"<br>
1567: * action="#{TableBean.groupA.actions.action}"<br>
1568: * disabled="#{TableBean.groupA.actions.disabled}"<br>
1569: * onClick="if (confirmSelectedRows() == false) return
1570: * false"<br>
1571: * text="Action 2"/><br>
1572: * <ui:button id="action3"<br>
1573: * action="#{TableBean.groupA.actions.action}"<br>
1574: * disabled="#{TableBean.groupA.actions.disabled}"<br>
1575: * onClick="if (confirmSelectedRows() == false) return
1576: * false"<br>
1577: * text="Action 3"/><br>
1578: * <ui:button id="action4"<br>
1579: * action="#{TableBean.groupA.actions.action}"<br>
1580: * disabled="#{TableBean.groupA.actions.disabled}"<br>
1581: * onClick="if (confirmSelectedRows() == false) return
1582: * false"<br>
1583: * text="Action 4"/><br>
1584: * <ui:dropDown submitForm="true" id="moreActions"<br>
1585: * action="#{TableBean.groupA.actions.moreActions}"<br>
1586: * disabled="#{TableBean.groupA.actions.disabled}"<br>
1587: *
1588: * items="#{TableBean.groupA.actions.moreActionsOptions}"<br>
1589: *
1590: * selected="#{TableBean.groupA.actions.moreActions}"/></code><br>
1591: * <br>
1592: * <span style="font-weight: bold;">actionsBottom.jsp</span><br>
1593: * <br>
1594: * This example shows the contents of the <code>actionsBottom.jsp</code><span
1595: * style="font-weight: bold;"> </span>file included in the <code>actionsBottom</code>
1596: * facet in the JSP page in the example above.<br>
1597: * <br>
1598: * <code><!-- Actions (Bottom) --><br>
1599: * <ui:button id="action1"<br>
1600: * action="#{TableBean.groupA.actions.delete}"<br>
1601: * disabled="#{TableBean.groupA.actions.disabled}"<br>
1602: * onClick="if (confirmDeleteSelectedRows() == false)
1603: * return false"<br>
1604: * text="Delete"/><br>
1605: * <ui:button id="action2"<br>
1606: * action="#{TableBean.groupA.actions.action}"<br>
1607: * disabled="#{TableBean.groupA.actions.disabled}"<br>
1608: * onClick="if (confirmSelectedRows() == false) return
1609: * false"<br>
1610: * text="Action 2"/><br>
1611: * <ui:button id="action3"<br>
1612: * action="#{TableBean.groupA.actions.action}"<br>
1613: * disabled="#{TableBean.groupA.actions.disabled}"<br>
1614: * onClick="if (confirmSelectedRows() == false) return
1615: * false"<br>
1616: * text="Action 3"/><br>
1617: * <ui:button id="action4"<br>
1618: * action="#{TableBean.groupA.actions.action}"<br>
1619: * disabled="#{TableBean.groupA.actions.disabled}"<br>
1620: * onClick="if (confirmSelectedRows() == false) return
1621: * false"<br>
1622: * text="Action 4"/><br>
1623: * <ui:dropDown submitForm="true" id="moreActions"<br>
1624: * action="#{TableBean.groupA.actions.moreActions}"<br>
1625: * disabled="#{TableBean.groupA.actions.disabled}"<br>
1626: *
1627: * items="#{TableBean.groupA.actions.moreActionsOptions}"<br>
1628: *
1629: * selected="#{TableBean.groupA.actions.moreActions}"/></code><br>
1630: * <br>
1631: * <span style="font-weight: bold;">select.js</span><br>
1632: * <br>
1633: * This example shows the contents of the <code>select.js</code><span
1634: * style="font-weight: bold;"> </span>file used in the example above.<br>
1635: * <br>
1636: * <code>// Use this function to initialize all rows displayed in the
1637: * table when the<br>
1638: * // state of selected components change (i.e., checkboxes or
1639: * radiobuttons used to<br>
1640: * // de/select rows of the table). This functionality requires the
1641: * selectId <br>
1642: * // property of the tableColumn component to be set.<br>
1643: * // <br>
1644: * // Note: Use setTimeout when invoking this function. This will ensure
1645: * that <br>
1646: * // checkboxes and radiobutton are selected immediately, instead of
1647: * waiting for <br>
1648: * // the onClick event to complete. For example: <br>
1649: * //<br>
1650: * // onClick="setTimeout('initAllRows(); disableActions()', 0)"<br>
1651: * function initAllRows() {<br>
1652: * // Disable table actions by default.<br>
1653: * var table = document.getElementById("form1:table1");<br>
1654: * table.initAllRows();<br>
1655: * }</code><br>
1656: * <br>
1657: * <span style="font-weight: bold;"><a name="actions.js"></a></span><span
1658: * style="font-weight: bold;">actions.js</span><br>
1659: * <br>
1660: * This example shows the contents of the <code>actions.js</code><span
1661: * style="font-weight: bold;"> </span>file used in the example above.<br>
1662: * <br>
1663: * <code>// Set disabled state of table actions. If a selection has been
1664: * made, actions<br>
1665: * // are enabled. If no selection has been made, actions are disabled.<br>
1666: * // <br>
1667: * // Note: Use setTimeout when invoking this function. This will ensure
1668: * that <br>
1669: * // checkboxes and radiobutton are selected immediately, instead of
1670: * waiting for <br>
1671: * // the onClick event to complete. For example: <br>
1672: * //<br>
1673: * // onClick="setTimeout('initAllRows(); disableActions()', 0)"<br>
1674: * function disableActions() {<br>
1675: * // Disable table actions by default.<br>
1676: * var table = document.getElementById("form1:table1");<br>
1677: * var selections = table.getAllSelectedRowsCount(); //
1678: * Hidden & visible selections.<br>
1679: * var disabled = (selections > 0) ? false : true;<br>
1680: * <br>
1681: * // Set disabled state for top actions.<br>
1682: *
1683: * document.getElementById("form1:table1:actionsTop:action1").setDisabled(disabled);<br>
1684: *
1685: * document.getElementById("form1:table1:actionsTop:action2").setDisabled(disabled);<br>
1686: *
1687: * document.getElementById("form1:table1:actionsTop:action3").setDisabled(disabled);<br>
1688: *
1689: * document.getElementById("form1:table1:actionsTop:action4").setDisabled(disabled);<br>
1690: *
1691: * dropDown_setDisabled("form1:table1:actionsTop:moreActions", disabled);<br>
1692: * <br>
1693: * // Set disabled state for bottom actions.<br>
1694: *
1695: * document.getElementById("form1:table1:actionsBottom:action1").setDisabled(disabled);<br>
1696: *
1697: * document.getElementById("form1:table1:actionsBottom:action2").setDisabled(disabled);<br>
1698: *
1699: * document.getElementById("form1:table1:actionsBottom:action3").setDisabled(disabled);<br>
1700: *
1701: * document.getElementById("form1:table1:actionsBottom:action4").setDisabled(disabled);<br>
1702: *
1703: * dropDown_setDisabled("form1:table1:actionsBottom:moreActions",
1704: * disabled);<br>
1705: * }<br>
1706: * <br>
1707: * //<br>
1708: * // Use this function to confirm the number of selected components
1709: * (i.e., <br>
1710: * // checkboxes or radiobuttons used to de/select rows of the table),
1711: * affected by<br>
1712: * // a delete action. This functionality requires the selectId property
1713: * of the<br>
1714: * // tableColumn component and hiddenSelectedRows property of the
1715: * tableRowGroup<br>
1716: * // component to be set.<br>
1717: * // <br>
1718: * // If selections are hidden from view, the confirmation message
1719: * indicates the<br>
1720: * // number of selections not displayed in addition to the total number of<br>
1721: * // selections. If selections are not hidden, the confirmation message
1722: * indicates<br>
1723: * // only the total selections.<br>
1724: * function confirmDeleteSelectedRows() {<br>
1725: * var table = document.getElementById("form1:table1");<br>
1726: * return table.confirmDeleteSelectedRows();<br>
1727: * }<br>
1728: * <br>
1729: * // Use this function to confirm the number of selected components
1730: * (i.e., <br>
1731: * // checkboxes or radiobuttons used to de/select rows of the table),
1732: * affected by<br>
1733: * // an action such as edit, archive, etc. This functionality requires
1734: * the <br>
1735: * // selectId property of the tableColumn component and hiddenSelectedRows<br>
1736: * // property of the tableRowGroup component to be set.<br>
1737: * // <br>
1738: * // If selections are hidden from view, the confirmation message
1739: * indicates the<br>
1740: * // number of selections not displayed in addition to the total number of<br>
1741: * // selections. If selections are not hidden, the confirmation message
1742: * indicates<br>
1743: * // only the total selections.<br>
1744: * function confirmSelectedRows() {<br>
1745: * var table = document.getElementById("form1:table1");<br>
1746: * return table.confirmSelectedRows("\n\nArchive all
1747: * selections?");<br>
1748: * }</code><br>
1749: * <h3>faces_config.xml Entry for Managed Bean</h3>
1750: * The previous examples are based on managed beans, such as the example
1751: * below, added to the<code>
1752: * faces_config.xml </code>file.<br>
1753: * <br>
1754: * <code><!DOCTYPE faces-config PUBLIC<br>
1755: * '-//Sun Microsystems, Inc.//DTD JavaServer Faces
1756: * Config 1.0//EN'<br>
1757: * 'http://java.sun.com/dtd/web-facesconfig_1_1.dtd'><br>
1758: * <br>
1759: * <faces-config><br>
1760: * <managed-bean><br>
1761: * <description>The
1762: * backing bean for the table example</description><br>
1763: *
1764: * <managed-bean-name>TableBean</managed-bean-name><br>
1765: *
1766: * <managed-bean-class>table.TableBean</managed-bean-class><br>
1767: *
1768: * <managed-bean-scope>session</managed-bean-scope><br>
1769: * </managed-bean><br>
1770: * </faces-config></code><br>
1771: * <h3><a name="Example:_TableBean_"></a>TableBean<br>
1772: * </h3>
1773: * <code>package table;<br>
1774: * <br>
1775: * import com.sun.rave.web.ui.component.Alarm;<br>
1776: * <br>
1777: * import java.util.ArrayList;<br>
1778: * <br>
1779: * import table.util.Group;<br>
1780: * import table.util.Name;<br>
1781: * <br>
1782: * // Backing bean for table examples.<br>
1783: * public class TableBean {<br>
1784: * // Group util for table examples.<br>
1785: * private Group groupA = null; // List (rows 0-19).<br>
1786: * private Group groupB = null; // Array (rows 0-9).<br>
1787: * private Group groupC = null; // Array (rows 10-19).<br>
1788: * <br>
1789: * // Alarms.<br>
1790: * private static final Alarm down = new
1791: * Alarm(Alarm.SEVERITY_DOWN);<br>
1792: * private static final Alarm critical = new
1793: * Alarm(Alarm.SEVERITY_CRITICAL);<br>
1794: * private static final Alarm major = new
1795: * Alarm(Alarm.SEVERITY_MAJOR);<br>
1796: * private static final Alarm minor = new
1797: * Alarm(Alarm.SEVERITY_MINOR);<br>
1798: * private static final Alarm ok = new
1799: * Alarm(Alarm.SEVERITY_OK);<br>
1800: * <br>
1801: * // Data for table examples.<br>
1802: * protected static final Name[] names = {<br>
1803: * new Name("William",
1804: * "Dupont", down),<br>
1805: * new Name("Anna", "Keeney",
1806: * critical),<br>
1807: * new Name("Mariko", "Randor",
1808: * major),<br>
1809: * new Name("John", "Wilson",
1810: * minor),<br>
1811: * new Name("Lynn",
1812: * "Seckinger", ok),<br>
1813: * new Name("Richard",
1814: * "Tattersall", down),<br>
1815: * new Name("Gabriella",
1816: * "Sarintia", critical),<br>
1817: * new Name("Lisa", "Hartwig",
1818: * major),<br>
1819: * new Name("Shirley", "Jones",
1820: * minor),<br>
1821: * new Name("Bill", "Sprague",
1822: * ok),<br>
1823: * new Name("Greg", "Doench",
1824: * down),<br>
1825: * new Name("Solange",
1826: * "Nadeau", critical),<br>
1827: * new Name("Heather",
1828: * "McGann", major),<br>
1829: * new Name("Roy", "Martin",
1830: * minor),<br>
1831: * new Name("Claude",
1832: * "Loubier", ok),<br>
1833: * new Name("Dan", "Woodard",
1834: * down),<br>
1835: * new Name("Ron", "Dunlap",
1836: * critical),<br>
1837: * new Name("Keith",
1838: * "Frankart", major),<br>
1839: * new Name("Andre", "Nadeau",
1840: * minor),<br>
1841: * new Name("Horace",
1842: * "Celestin", ok),<br>
1843: * };<br>
1844: * <br>
1845: * // Default constructor.<br>
1846: * public TableBean() {<br>
1847: * }<br>
1848: * <br>
1849: * // Get Group util created with a List containing all
1850: * names.<br>
1851: * public Group getGroupA() {<br>
1852: * if (groupA != null) {<br>
1853: *
1854: * return groupA;<br>
1855: * }<br>
1856: * // Create List with all
1857: * names.<br>
1858: * ArrayList newNames = new
1859: * ArrayList();<br>
1860: * for (int i = names.length -
1861: * 1; i >= 0; i--) {<br>
1862: *
1863: * newNames.add(names[i]);<br>
1864: * }<br>
1865: * return (groupA = new
1866: * Group(newNames));<br>
1867: * }<br>
1868: * <br>
1869: * // Get Group util created with an array containing a
1870: * subset of names.<br>
1871: * public Group getGroupB() {<br>
1872: * if (groupB != null) {<br>
1873: *
1874: * return groupB;<br>
1875: * }<br>
1876: * // Create an array with
1877: * subset of names (i.e., 0-9).<br>
1878: * Name[] newNames = new
1879: * Name[10];<br>
1880: * System.arraycopy(names, 0,
1881: * newNames, 0, 10);<br>
1882: * return (groupB = new
1883: * Group(newNames));<br>
1884: * }<br>
1885: * <br>
1886: * // Get Group util created with an array containing a
1887: * subset of names.<br>
1888: * public Group getGroupC() {<br>
1889: * if (groupC != null) {<br>
1890: *
1891: * return groupC;<br>
1892: * }<br>
1893: * // Create an array with
1894: * subset of names (i.e., 10-19).<br>
1895: * Name[] newNames = new
1896: * Name[10];<br>
1897: * System.arraycopy(names, 10,
1898: * newNames, 0, 10);<br>
1899: * return (groupC = new
1900: * Group(newNames));<br>
1901: * }<br>
1902: * }</code><br>
1903: * <h3><a name="UtilityClasses"></a>Utility Classes used in the examples</h3>
1904: * The following utility classes are used in the examples for the table
1905: * tags:<code> ui:table</code>, <code>ui:tableRowGroup</code>, and <code>ui:tableColumn.<br>
1906: * </code><code></code>
1907: * <p><a href="#Group.java">Group.java</a><br>
1908: * <a href="#Actions.java">Actions.java</a><br>
1909: * <a href="#Filter.java">Filter.java</a><br>
1910: * <a href="#Name.java">Name.java</a><br>
1911: * <a href="#Select.java">Select.java</a><br>
1912: * <a href="#Preferences.java">Preferences.java</a><br>
1913: * </p>
1914: * <h4><a name="Group.java"></a>Group.java Utility Class<br>
1915: * </h4>
1916: * <code>package table.util;<br>
1917: * <br>
1918: * import com.sun.data.provider.TableDataProvider;<br>
1919: * import com.sun.data.provider.impl.ObjectArrayDataProvider;<br>
1920: * import com.sun.data.provider.impl.ObjectListDataProvider;<br>
1921: * import com.sun.rave.web.ui.component.Checkbox;<br>
1922: * import com.sun.rave.web.ui.component.TableRowGroup;<br>
1923: * <br>
1924: * import java.util.List;<br>
1925: * <br>
1926: * // This class contains data provider and util classes. Note that not
1927: * all util<br>
1928: * // classes are used for each example.<br>
1929: * public class Group {<br>
1930: * private TableRowGroup tableRowGroup = null; //
1931: * TableRowGroup component.<br>
1932: * private TableDataProvider provider = null; // Data
1933: * provider.<br>
1934: * private Checkbox checkbox = null; // Checkbox
1935: * component.<br>
1936: * private Preferences prefs = null; // Preferences
1937: * util.<br>
1938: * private Messages messages = null; // Messages util.<br>
1939: * private Actions actions = null; // Actions util.<br>
1940: * private Filter filter = null; // Filter util.<br>
1941: * private Select select = null; // Select util.<br>
1942: * private Clean clean = null; // Clean util.<br>
1943: * <br>
1944: * // Default constructor.<br>
1945: * public Group() {<br>
1946: * actions = new Actions(this);<br>
1947: * filter = new Filter(this);<br>
1948: * select = new Select(this);<br>
1949: * clean = new Clean(this);<br>
1950: * prefs = new Preferences();<br>
1951: * messages = new Messages();<br>
1952: * }<br>
1953: * <br>
1954: * // Construct an instance using given Object array.<br>
1955: * public Group(Object[] array) {<br>
1956: * this();<br>
1957: * provider = new
1958: * ObjectArrayDataProvider(array);<br>
1959: * }<br>
1960: * <br>
1961: * // Construct an instance using given List.<br>
1962: * public Group(List list) {<br>
1963: * this();<br>
1964: * provider = new
1965: * ObjectListDataProvider(list);<br>
1966: * }<br>
1967: * <br>
1968: * // Get data provider.<br>
1969: * public TableDataProvider getNames() {<br>
1970: * return provider;<br>
1971: * }<br>
1972: * <br>
1973: * // Get Actions util.<br>
1974: * public Actions getActions() {<br>
1975: * return actions;<br>
1976: * }<br>
1977: * <br>
1978: * // Get Filter util.<br>
1979: * public Filter getFilter() {<br>
1980: * return filter;<br>
1981: * }<br>
1982: * <br>
1983: * // Get Messages util.<br>
1984: * public Messages getMessages() {<br>
1985: * return messages;<br>
1986: * }<br>
1987: * <br>
1988: * // Get Preferences util.<br>
1989: * public Preferences getPreferences() {<br>
1990: * return prefs;<br>
1991: * }<br>
1992: * <br>
1993: * // Get Select util.<br>
1994: * public Select getSelect() {<br>
1995: * return select;<br>
1996: * }<br>
1997: * <br>
1998: * // Get tableRowGroup component.<br>
1999: * public TableRowGroup getTableRowGroup() {<br>
2000: * return tableRowGroup;<br>
2001: * }<br>
2002: * <br>
2003: * // Set tableRowGroup component.<br>
2004: * public void setTableRowGroup(TableRowGroup
2005: * tableRowGroup) {<br>
2006: * this.tableRowGroup =
2007: * tableRowGroup;<br>
2008: * }<br>
2009: * <br>
2010: * // Get checkbox component.<br>
2011: * public Checkbox getCheckbox() {<br>
2012: * return checkbox;<br>
2013: * }<br>
2014: * <br>
2015: * // Set checkbox component.<br>
2016: * public void setCheckbox(Checkbox checkbox) {<br>
2017: * this.checkbox = checkbox;<br>
2018: * }<br>
2019: * }</code><span style="font-family: monospace;"></span><br>
2020: * <h4><a name="Actions.java"></a>Actions.java Utility Class<br>
2021: * </h4>
2022: * <code>package table.util;<br>
2023: * <br>
2024: * import com.sun.data.provider.FieldKey;<br>
2025: * import com.sun.data.provider.RowKey;<br>
2026: * import com.sun.data.provider.TableDataProvider;<br>
2027: * import com.sun.data.provider.impl.ObjectListDataProvider;<br>
2028: * import com.sun.rave.web.ui.model.Option;<br>
2029: * <br>
2030: * import java.util.List;<br>
2031: * import java.util.Map;<br>
2032: * <br>
2033: * import javax.faces.context.FacesContext;<br>
2034: * <br>
2035: * // This class provides functionality for table actions.<br>
2036: * public class Actions {<br>
2037: * private Group group = null; // Group util.<br>
2038: * <br>
2039: * // Action menu items.<br>
2040: * protected static final Option[] moreActionsOptions =
2041: * {<br>
2042: * new Option("ACTION0",
2043: * "&#8212; More Actions &#8212;"),<br>
2044: * new Option("ACTION1",
2045: * "Action 1"),<br>
2046: * new Option("ACTION2",
2047: * "Action 2"),<br>
2048: * new Option("ACTION3",
2049: * "Action 3"),<br>
2050: * new Option("ACTION4",
2051: * "Action 4"),<br>
2052: * };<br>
2053: * <br>
2054: * // Default constructor.<br>
2055: * public Actions(Group group) {<br>
2056: * this.group = group;<br>
2057: * }<br>
2058: * <br>
2059: * // Action button event.<br>
2060: * public void action() {<br>
2061: * String message = null;<br>
2062: * <br>
2063: * // Get hyperlink parameter
2064: * used for embedded actions example.<br>
2065: * Map map =
2066: * FacesContext.getCurrentInstance().getExternalContext()<br>
2067: *
2068: * .getRequestParameterMap();<br>
2069: * String param = (String)
2070: * map.get("param");<br>
2071: * if (param != null) {<br>
2072: *
2073: * message = "Embedded Action Selected: Parameter = " + param;<br>
2074: * } else {<br>
2075: *
2076: * message = "Table Action Selected";<br>
2077: * }<br>
2078: * <br>
2079: *
2080: * group.getMessages().setMessage(message);<br>
2081: * }<br>
2082: * <br>
2083: * // Action to remove rows from ObjectListDataProvider.<br>
2084: * public void delete() {<br>
2085: * // Since mutiple examples
2086: * are using the same beans, the binding<br>
2087: * // simply tells us that
2088: * checkbox state is maintained arcoss pages.<br>
2089: * if
2090: * (group.getSelect().isKeepSelected()) {<br>
2091: * //
2092: * If we got here, then we're maintaining state across pages.<br>
2093: *
2094: * delete(group.getTableRowGroup().getSelectedRowKeys());<br>
2095: * } else {<br>
2096: * //
2097: * If we got here, then we're using the phase listener and must<br>
2098: * //
2099: * take filtering, sorting, and pagination into account.<br>
2100: *
2101: * delete(group.getTableRowGroup().getRenderedSelectedRowKeys());<br>
2102: * }<br>
2103: * }<br>
2104: * <br>
2105: * // Set disabled value for table actions.<br>
2106: * public boolean getDisabled() {<br>
2107: * // If there is at least one
2108: * row selection, actions are enabled.<br>
2109: * boolean result = true;<br>
2110: * if (group.getTableRowGroup()
2111: * == null) {<br>
2112: *
2113: * return result;<br>
2114: * }<br>
2115: * <br>
2116: * // Since mutiple examples
2117: * are using the same beans, the binding<br>
2118: * // simply tells us that
2119: * checkbox state is maintained arcoss pages.<br>
2120: * if
2121: * (group.getSelect().isKeepSelected()) {<br>
2122: * //
2123: * If we got here, then we're maintaining state across pages.<br>
2124: *
2125: * result = group.getTableRowGroup().getSelectedRowsCount() < 1;<br>
2126: * } else {<br>
2127: * //
2128: * If we got here, then we're using the phase listener and must<br>
2129: * //
2130: * take filtering, sorting, and pagination into account.<br>
2131: *
2132: * result = group.getTableRowGroup().getRenderedSelectedRowsCount() < 1;<br>
2133: * }<br>
2134: * return result;<br>
2135: * }<br>
2136: * <br>
2137: * // Get action.<br>
2138: * public String getMoreActions() {<br>
2139: * // Per the UI guidelines,
2140: * always snap back to "More Actions...".<br>
2141: * return "ACTION0";<br>
2142: * }<br>
2143: * <br>
2144: * // Get action menu options.<br>
2145: * public Option[] getMoreActionsOptions() {<br>
2146: * return moreActionsOptions;<br>
2147: * }<br>
2148: * <br>
2149: * // Action menu event.<br>
2150: * public void moreActions() {<br>
2151: *
2152: * group.getMessages().setMessage("More Actions Menu Selected");<br>
2153: * }<br>
2154: * <br>
2155: * // Set action.<br>
2156: * public void setMoreActions(String action) {<br>
2157: * // Do nothing.<br>
2158: * }<br>
2159: * <br>
2160: * //
2161: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
2162: * // Private methods<br>
2163: * //
2164: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
2165: * <br>
2166: * // Action to remove rows from ObjectListDataProvider.<br>
2167: * private void delete(RowKey[] rowKeys) {<br>
2168: * if (rowKeys == null) {<br>
2169: *
2170: * return;<br>
2171: * }<br>
2172: * TableDataProvider provider =
2173: * group.getNames();<br>
2174: * for (int i = 0; i <
2175: * rowKeys.length; i++) {<br>
2176: *
2177: * RowKey rowKey = rowKeys[i];<br>
2178: * if
2179: * (provider.canRemoveRow(rowKey)) {<br>
2180: *
2181: * provider.removeRow(rowKey);<br>
2182: * }<br>
2183: * }<br>
2184: * ((ObjectListDataProvider)
2185: * provider).commitChanges(); // Commit.<br>
2186: * group.getSelect().clear();
2187: * // Clear phase listener.<br>
2188: * }<br>
2189: * }</code><br>
2190: * <h4><a name="Filter.java"></a>Filter.java Utility Class<br>
2191: * </h4>
2192: * <code>package table.util;<br>
2193: * <br>
2194: * import com.sun.data.provider.FilterCriteria;<br>
2195: * import com.sun.data.provider.impl.CompareFilterCriteria;<br>
2196: * import com.sun.rave.web.ui.component.Table;<br>
2197: * import com.sun.rave.web.ui.model.Option;<br>
2198: * <br>
2199: * // This class provides functionality for table filters.<br>
2200: * //<br>
2201: * // This util class sets filters directly on the TableRowGroup component
2202: * using <br>
2203: * // FilterCriteria; however, there is also a FilteredTableDataProvider
2204: * class that<br>
2205: * // can used for filtering outside of the table. The table will pick up
2206: * what ever <br>
2207: * // filter has been applied automatically, for example:<br>
2208: * //<br>
2209: * // // Some choice of TableDataProvider.<br>
2210: * // TableDataProvider provider = new ...<br>
2211: * //<br>
2212: * // // This wraps and filters an existing TableDataProvider.<br>
2213: * // FilteredTableDataProvider filteredProvider = new
2214: * FilteredTableDataProvider();<br>
2215: * // filteredProvider.setTableDataProvider(provider);<br>
2216: * //<br>
2217: * // // Set FilteredTableDataProvider in the TableRowGroup component.<br>
2218: * // tableRowGroup.setSourceData(filteredProvider);<br>
2219: * //<br>
2220: * // The table component itself has no idea that there is any filtering
2221: * going on, <br>
2222: * // but the filtering functionality has been encapsulated in the data
2223: * provider. <br>
2224: * // The developer can then use different FilterCriteria types to apply
2225: * filters,<br>
2226: * // for example:<br>
2227: * //<br>
2228: * // CompareFilterCriteria cfc = new ...<br>
2229: * // RegexFilterCriteria rxfc = new ...<br>
2230: * // filteredProvider.setFilterCriteria(new FilterCriteria[] { cfc, fxfc
2231: * });<br>
2232: * public class Filter {<br>
2233: * private String customFilter = null; // Custom filter.<br>
2234: * private String basicFilter = null; // Basic filter
2235: * menu option.<br>
2236: * private String filterText = null; // Filter text.<br>
2237: * private Group group = null; // Group util.<br>
2238: * <br>
2239: * // Filter menu items.<br>
2240: * protected static final Option[] filterOptions = {<br>
2241: * new Option("FILTER0", "All
2242: * Items"),<br>
2243: * new Option("FILTER1",
2244: * "Filter 1"),<br>
2245: * new Option("FILTER2",
2246: * "Filter 2"),<br>
2247: * };<br>
2248: * <br>
2249: * // Default constructor.<br>
2250: * public Filter(Group group) {<br>
2251: * this.group = group;<br>
2252: * }<br>
2253: * <br>
2254: * // UI guidelines state that a "Custom Filter" option
2255: * should be added to the<br>
2256: * // filter menu, used to open the table filter panel.
2257: * Thus, if the <br>
2258: * // CUSTOM_FILTER option is selected, Javascript
2259: * invoked via the onChange<br>
2260: * // event will open the table filter panel.<br>
2261: * //<br>
2262: * // UI guidelines also state that a "Custom Filter
2263: * Applied" option should be <br>
2264: * // added to the filter menu, indicating that a
2265: * custom filter has been <br>
2266: * // applied. In this scenario, set the selected
2267: * property of the filter menu <br>
2268: * // as CUSTOM_FILTER_APPLIED. This selection should
2269: * persist until another <br>
2270: * // menu option has been selected.<br>
2271: * //<br>
2272: * // Further, UI guidelines state that the table title
2273: * should indicate that a <br>
2274: * // custom filter has been applied. To add this text
2275: * to the table title, set <br>
2276: * // the filter property.<br>
2277: * <br>
2278: * // Basic filter event.<br>
2279: * public void applyBasicFilter() {<br>
2280: * if
2281: * (basicFilter.equals("FILTER1")) {<br>
2282: *
2283: * filterText = "Filter 1";<br>
2284: * } else if
2285: * (basicFilter.equals("FILTER2")) {<br>
2286: *
2287: * filterText = "Filter 2";<br>
2288: * } else {<br>
2289: *
2290: * filterText = null;<br>
2291: * }<br>
2292: * <br>
2293: * // Clear all filters since
2294: * we don't have an example here.<br>
2295: * //<br>
2296: * // Note: TableRowGroup
2297: * ensures pagination is reset per UI guidelines.<br>
2298: *
2299: * group.getTableRowGroup().setFilterCriteria(null);<br>
2300: * }<br>
2301: * <br>
2302: * // Custom filter event.<br>
2303: * public void applyCustomFilter() {<br>
2304: * basicFilter =
2305: * Table.CUSTOM_FILTER_APPLIED; // Set filter menu option.<br>
2306: * filterText = "Custom";<br>
2307: * <br>
2308: * // Filter rows that do not
2309: * match custom filter.<br>
2310: * CompareFilterCriteria
2311: * criteria = new CompareFilterCriteria(<br>
2312: *
2313: * group.getNames().getFieldKey("last"), customFilter);<br>
2314: * <br>
2315: * // Note: TableRowGroup
2316: * ensures pagination is reset per UI guidelines.<br>
2317: *
2318: * group.getTableRowGroup().setFilterCriteria(<br>
2319: * new
2320: * FilterCriteria[] {criteria});<br>
2321: * }<br>
2322: * <br>
2323: * // Get basic filter.<br>
2324: * public String getBasicFilter() {<br>
2325: * // Note: the selected value
2326: * must be set to restore the default selected<br>
2327: * // value when the embedded
2328: * filter panel is closed. Further, the selected<br>
2329: * // value should never be set
2330: * as "Custom Filter...".<br>
2331: * return (basicFilter != null
2332: * && !basicFilter.equals(Table.CUSTOM_FILTER))<br>
2333: * ?
2334: * basicFilter : "FILTER0";<br>
2335: * }<br>
2336: * <br>
2337: * // Set basic filter.<br>
2338: * public void setBasicFilter(String value) {<br>
2339: * basicFilter = value;<br>
2340: * }<br>
2341: * <br>
2342: * // Get custom filter.<br>
2343: * public String getCustomFilter() {<br>
2344: * return customFilter;<br>
2345: * }<br>
2346: * <br>
2347: * // Set custom filter.<br>
2348: * public void setCustomFilter(String value) {<br>
2349: * customFilter = value;<br>
2350: * }<br>
2351: * <br>
2352: * // Get filter menu options.<br>
2353: * public Option[] getFilterOptions() {<br>
2354: * // Get filter options based
2355: * on the selected filter menu option.<br>
2356: * return
2357: * Table.getFilterOptions(filterOptions,<br>
2358: *
2359: * basicFilter == Table.CUSTOM_FILTER_APPLIED);<br>
2360: * }<br>
2361: * <br>
2362: * // Get filter text.<br>
2363: * public String getFilterText() {<br>
2364: * return filterText;<br>
2365: * }<br>
2366: * }</code><br>
2367: * <h4><a name="Name.java"></a>Name.java Utility Class<br>
2368: * </h4>
2369: * <code>package table.util;<br>
2370: * <br>
2371: * import com.sun.rave.web.ui.component.Alarm;<br>
2372: * import com.sun.rave.web.ui.theme.ThemeImages;<br>
2373: * <br>
2374: * public class Name {<br>
2375: * private String last = null; // Last name.<br>
2376: * private String first = null; // First name.<br>
2377: * private Alarm alarm = null; // Alarm.<br>
2378: * <br>
2379: * // Default constructor.<br>
2380: * public Name(String first, String last) {<br>
2381: * this.last = last;<br>
2382: * this.first = first;<br>
2383: * }<br>
2384: * <br>
2385: * // Construct an instance with given alarm severity.<br>
2386: * public Name(String first, String last, Alarm alarm) {<br>
2387: * this(first, last);<br>
2388: * this.alarm = alarm;<br>
2389: * }<br>
2390: * <br>
2391: * // Get first name.<br>
2392: * public String getFirst() {<br>
2393: * return (alarm != null) ? " "
2394: * + first : first;<br>
2395: * }<br>
2396: * <br>
2397: * // Set first name.<br>
2398: * public void setFirst(String first) {<br>
2399: * this.first = first;<br>
2400: * }<br>
2401: * <br>
2402: * // Get last name.<br>
2403: * public String getLast() {<br>
2404: * return last;<br>
2405: * }<br>
2406: * <br>
2407: * // Set last name.<br>
2408: * public void setLast(String last) {<br>
2409: * this.last = last;<br>
2410: * }<br>
2411: * <br>
2412: * // Get alarm.<br>
2413: * public Alarm getAlarm() {<br>
2414: * return alarm;<br>
2415: * }<br>
2416: * <br>
2417: * // Get alarm.<br>
2418: * public void setAlarm(Alarm alarm) {<br>
2419: * this.alarm = alarm;<br>
2420: * }<br>
2421: * <br>
2422: * // Get alarm severity.<br>
2423: * public String getSeverity() {<br>
2424: * return alarm.getSeverity();<br>
2425: * }<br>
2426: * <br>
2427: * // Get alarm severity.<br>
2428: * public void setSeverity(String severity) {<br>
2429: * alarm.setSeverity(severity);<br>
2430: * }<br>
2431: * }</code><br>
2432: * <h4><a name="Select.java"></a>Select.java Utility Class<br>
2433: * </h4>
2434: * <code>package table.util;<br>
2435: * <br>
2436: * import com.sun.data.provider.FieldKey;<br>
2437: * import com.sun.data.provider.RowKey;<br>
2438: * import com.sun.data.provider.TableDataProvider;<br>
2439: * import com.sun.rave.web.ui.event.TableSelectPhaseListener;<br>
2440: * <br>
2441: * import javax.faces.context.FacesContext;<br>
2442: * import javax.faces.el.ValueBinding;<br>
2443: * <br>
2444: * // This class provides functionality for select tables.<br>
2445: * //<br>
2446: * // Note: UI guidelines recomend that rows should be unselected when no
2447: * longer in<br>
2448: * // view. For example, when a user selects rows of the table and
2449: * navigates to<br>
2450: * // another page. Or, when a user applies a filter or sort that may hide<br>
2451: * // previously selected rows from view. If a user invokes an action to
2452: * delete<br>
2453: * // the currently selected rows, they may inadvertently remove rows not<br>
2454: * // displayed on the current page. Using TableSelectPhaseListener ensures<br>
2455: * // that invalid row selections are not rendered by clearing selected
2456: * state<br>
2457: * // after the render response phase.<br>
2458: * public class Select {<br>
2459: * private TableSelectPhaseListener tspl = null; //
2460: * Phase listener.<br>
2461: * private Group group = null; // Group util.<br>
2462: * <br>
2463: * // Default constructor.<br>
2464: * public Select(Group group) {<br>
2465: * this.group = group;<br>
2466: * tspl = new
2467: * TableSelectPhaseListener();<br>
2468: * }<br>
2469: * <br>
2470: * // Clear selected state from phase listener (e.g.,
2471: * when deleting rows).<br>
2472: * public void clear() {<br>
2473: * tspl.clear();<br>
2474: * }<br>
2475: * <br>
2476: * // Test flag indicating that selected objects should
2477: * not be cleared.<br>
2478: * public boolean isKeepSelected() {<br>
2479: * return tspl.isKeepSelected();<br>
2480: * }<br>
2481: * <br>
2482: * // Set flag indicating that selected objects should
2483: * not be cleared.<br>
2484: * public void keepSelected(boolean keepSelected) {<br>
2485: *
2486: * tspl.keepSelected(keepSelected);<br>
2487: * }<br>
2488: * <br>
2489: * // Get selected property.<br>
2490: * public Object getSelected() {<br>
2491: * return tspl.getSelected(getTableRow());<br>
2492: * }<br>
2493: * <br>
2494: * // Set selected property.<br>
2495: * public void setSelected(Object object) {<br>
2496: * RowKey rowKey =
2497: * getTableRow();<br>
2498: * if (rowKey != null) {<br>
2499: *
2500: * tspl.setSelected(rowKey, object);<br>
2501: * }<br>
2502: * }<br>
2503: * <br>
2504: * // Get selected value property.<br>
2505: * public Object getSelectedValue() {<br>
2506: * RowKey rowKey =
2507: * getTableRow();<br>
2508: * return (rowKey != null) ?
2509: * rowKey.getRowId() : null;<br>
2510: * }<br>
2511: * <br>
2512: * // Get the selected state -- Sort on checked state
2513: * only.<br>
2514: * public boolean getSelectedState() {<br>
2515: * // Typically, selected state
2516: * is tested by comparing the selected and <br>
2517: * // selectedValue properties.
2518: * In this example, however, the phase <br>
2519: * // listener value is not
2520: * null when selected.<br>
2521: * return
2522: * getSelectedState(getTableRow());<br>
2523: * }<br>
2524: * <br>
2525: * // Get the selected state.<br>
2526: * public boolean getSelectedState(RowKey rowKey) {<br>
2527: * return
2528: * tspl.isSelected(rowKey);<br>
2529: * }<br>
2530: * <br>
2531: * // Get current table row.<br>
2532: * //<br>
2533: * // Note: To obtain a RowKey for the current table
2534: * row, the use the same <br>
2535: * // sourceVar property given to the TableRowGroup
2536: * component. For example, if <br>
2537: * // sourceVar="name", use "#{name.tableRow}" as the
2538: * expression string.<br>
2539: * private RowKey getTableRow() {<br>
2540: * FacesContext context =
2541: * FacesContext.getCurrentInstance();<br>
2542: * ValueBinding vb =
2543: * context.getApplication().createValueBinding(<br>
2544: *
2545: * "#{name.tableRow}");<br>
2546: * return (RowKey)
2547: * vb.getValue(context);<br>
2548: * }<br>
2549: * }</code><br>
2550: * <h4><a name="Preferences.java"></a>Preferences.java Utility Class<br>
2551: * </h4>
2552: * <code>package table.util;<br>
2553: * <br>
2554: * // This class provides functionality for table preferences.<br>
2555: * public class Preferences {<br>
2556: * private String preference = null; // Rows preference.<br>
2557: * private int rows = 5; // Rows per page.<br>
2558: * <br>
2559: * // Default constructor.<br>
2560: * public Preferences() {<br>
2561: * }<br>
2562: * <br>
2563: * // Table preferences event.<br>
2564: * public void applyPreferences() {<br>
2565: * try {<br>
2566: * int
2567: * rows = Integer.parseInt(preference);<br>
2568: * if
2569: * (rows > 0) {<br>
2570: *
2571: * this.rows = rows;<br>
2572: * }<br>
2573: * } catch
2574: * (NumberFormatException e) {}<br>
2575: * }<br>
2576: * <br>
2577: * // Get rows per page.<br>
2578: * public int getRows() {<br>
2579: * return rows;<br>
2580: * }<br>
2581: * <br>
2582: * // Get preference.<br>
2583: * public String getPreference() {<br>
2584: * return
2585: * Integer.toString(rows);<br>
2586: * }<br>
2587: * <br>
2588: * // Set preference.<br>
2589: * public void setPreference(String value) {<br>
2590: * preference = value;<br>
2591: * }<br>
2592: * }
2593: * </code><br>
2594: * <br>
2595: * <p>Auto-generated component class.
2596: * Do <strong>NOT</strong> modify; all changes
2597: * <strong>will</strong> be lost!</p>
2598: */
2599:
2600: public abstract class TableBase extends
2601: javax.faces.component.UIComponentBase {
2602:
2603: /**
2604: * <p>Construct a new <code>TableBase</code>.</p>
2605: */
2606: public TableBase() {
2607: super ();
2608: setRendererType("com.sun.rave.web.ui.Table");
2609: }
2610:
2611: /**
2612: * <p>Return the identifier of the component family to which this
2613: * component belongs. This identifier, in conjunction with the value
2614: * of the <code>rendererType</code> property, may be used to select
2615: * the appropriate {@link Renderer} for this component instance.</p>
2616: */
2617: public String getFamily() {
2618: return "com.sun.rave.web.ui.Table";
2619: }
2620:
2621: // align
2622: private String align = null;
2623:
2624: /**
2625: * <p>Sets the alignment of the table (left, right or center) on the page (deprecated in HTML 4.0)</p>
2626: */
2627: public String getAlign() {
2628: if (this .align != null) {
2629: return this .align;
2630: }
2631: ValueBinding _vb = getValueBinding("align");
2632: if (_vb != null) {
2633: return (String) _vb.getValue(getFacesContext());
2634: }
2635: return null;
2636: }
2637:
2638: /**
2639: * <p>Sets the alignment of the table (left, right or center) on the page (deprecated in HTML 4.0)</p>
2640: * @see #getAlign()
2641: */
2642: public void setAlign(String align) {
2643: this .align = align;
2644: }
2645:
2646: // augmentTitle
2647: private boolean augmentTitle = false;
2648: private boolean augmentTitle_set = false;
2649:
2650: /**
2651: * <p>Flag indicating that the table title should be augmented with the range of items
2652: * currently displayed and the total number of items in the table. For example,
2653: * "(1 - 25 of 200)". If the table is not currently paginated, the title is
2654: * augmented with the number of displayed items. For example, "(18)". When set to
2655: * false, any values set for <code>itemsText</code> and <code>filterText</code>
2656: * are overridden.</p>
2657: */
2658: public boolean isAugmentTitle() {
2659: if (this .augmentTitle_set) {
2660: return this .augmentTitle;
2661: }
2662: ValueBinding _vb = getValueBinding("augmentTitle");
2663: if (_vb != null) {
2664: Object _result = _vb.getValue(getFacesContext());
2665: if (_result == null) {
2666: return false;
2667: } else {
2668: return ((Boolean) _result).booleanValue();
2669: }
2670: }
2671: return true;
2672: }
2673:
2674: /**
2675: * <p>Flag indicating that the table title should be augmented with the range of items
2676: * currently displayed and the total number of items in the table. For example,
2677: * "(1 - 25 of 200)". If the table is not currently paginated, the title is
2678: * augmented with the number of displayed items. For example, "(18)". When set to
2679: * false, any values set for <code>itemsText</code> and <code>filterText</code>
2680: * are overridden.</p>
2681: * @see #isAugmentTitle()
2682: */
2683: public void setAugmentTitle(boolean augmentTitle) {
2684: this .augmentTitle = augmentTitle;
2685: this .augmentTitle_set = true;
2686: }
2687:
2688: // bgColor
2689: private String bgColor = null;
2690:
2691: /**
2692: * <p>Sets the background color for the table (deprecated in HTML 4.0)</p>
2693: */
2694: public String getBgColor() {
2695: if (this .bgColor != null) {
2696: return this .bgColor;
2697: }
2698: ValueBinding _vb = getValueBinding("bgColor");
2699: if (_vb != null) {
2700: return (String) _vb.getValue(getFacesContext());
2701: }
2702: return null;
2703: }
2704:
2705: /**
2706: * <p>Sets the background color for the table (deprecated in HTML 4.0)</p>
2707: * @see #getBgColor()
2708: */
2709: public void setBgColor(String bgColor) {
2710: this .bgColor = bgColor;
2711: }
2712:
2713: // border
2714: private int border = Integer.MIN_VALUE;
2715: private boolean border_set = false;
2716:
2717: /**
2718: * <p>Set the border width in pixels within the table</p>
2719: */
2720: public int getBorder() {
2721: if (this .border_set) {
2722: return this .border;
2723: }
2724: ValueBinding _vb = getValueBinding("border");
2725: if (_vb != null) {
2726: Object _result = _vb.getValue(getFacesContext());
2727: if (_result == null) {
2728: return Integer.MIN_VALUE;
2729: } else {
2730: return ((Integer) _result).intValue();
2731: }
2732: }
2733: return Integer.MIN_VALUE;
2734: }
2735:
2736: /**
2737: * <p>Set the border width in pixels within the table</p>
2738: * @see #getBorder()
2739: */
2740: public void setBorder(int border) {
2741: this .border = border;
2742: this .border_set = true;
2743: }
2744:
2745: // cellPadding
2746: private String cellPadding = null;
2747:
2748: /**
2749: * <p>Sets the whitespace between the borders and the contents of a cell</p>
2750: */
2751: public String getCellPadding() {
2752: if (this .cellPadding != null) {
2753: return this .cellPadding;
2754: }
2755: ValueBinding _vb = getValueBinding("cellPadding");
2756: if (_vb != null) {
2757: return (String) _vb.getValue(getFacesContext());
2758: }
2759: return null;
2760: }
2761:
2762: /**
2763: * <p>Sets the whitespace between the borders and the contents of a cell</p>
2764: * @see #getCellPadding()
2765: */
2766: public void setCellPadding(String cellPadding) {
2767: this .cellPadding = cellPadding;
2768: }
2769:
2770: // cellSpacing
2771: private String cellSpacing = null;
2772:
2773: /**
2774: * <p>Sets the whitespace between cells and also at the edges of the table</p>
2775: */
2776: public String getCellSpacing() {
2777: if (this .cellSpacing != null) {
2778: return this .cellSpacing;
2779: }
2780: ValueBinding _vb = getValueBinding("cellSpacing");
2781: if (_vb != null) {
2782: return (String) _vb.getValue(getFacesContext());
2783: }
2784: return null;
2785: }
2786:
2787: /**
2788: * <p>Sets the whitespace between cells and also at the edges of the table</p>
2789: * @see #getCellSpacing()
2790: */
2791: public void setCellSpacing(String cellSpacing) {
2792: this .cellSpacing = cellSpacing;
2793: }
2794:
2795: // clearSortButton
2796: private boolean clearSortButton = false;
2797: private boolean clearSortButton_set = false;
2798:
2799: /**
2800: * <p>In the View-Changing Controls area of the Action Bar, display a button that
2801: * clears any sorting of the table. When the button is clicked, the table items
2802: * return to the order they were in when the page was initially rendered.</p>
2803: */
2804: public boolean isClearSortButton() {
2805: if (this .clearSortButton_set) {
2806: return this .clearSortButton;
2807: }
2808: ValueBinding _vb = getValueBinding("clearSortButton");
2809: if (_vb != null) {
2810: Object _result = _vb.getValue(getFacesContext());
2811: if (_result == null) {
2812: return false;
2813: } else {
2814: return ((Boolean) _result).booleanValue();
2815: }
2816: }
2817: return false;
2818: }
2819:
2820: /**
2821: * <p>In the View-Changing Controls area of the Action Bar, display a button that
2822: * clears any sorting of the table. When the button is clicked, the table items
2823: * return to the order they were in when the page was initially rendered.</p>
2824: * @see #isClearSortButton()
2825: */
2826: public void setClearSortButton(boolean clearSortButton) {
2827: this .clearSortButton = clearSortButton;
2828: this .clearSortButton_set = true;
2829: }
2830:
2831: // deselectMultipleButton
2832: private boolean deselectMultipleButton = false;
2833: private boolean deselectMultipleButton_set = false;
2834:
2835: /**
2836: * <p>In the Action Bar, display a deselect button for tables in which multiple rows
2837: * can be selected, to allow users to deselect all table rows that are currently
2838: * displayed. This button is used to deselect a column of checkboxes using the id
2839: * that was given to the selectId attribute of the <code>ui:tableColumn</code> tag.</p>
2840: */
2841: public boolean isDeselectMultipleButton() {
2842: if (this .deselectMultipleButton_set) {
2843: return this .deselectMultipleButton;
2844: }
2845: ValueBinding _vb = getValueBinding("deselectMultipleButton");
2846: if (_vb != null) {
2847: Object _result = _vb.getValue(getFacesContext());
2848: if (_result == null) {
2849: return false;
2850: } else {
2851: return ((Boolean) _result).booleanValue();
2852: }
2853: }
2854: return false;
2855: }
2856:
2857: /**
2858: * <p>In the Action Bar, display a deselect button for tables in which multiple rows
2859: * can be selected, to allow users to deselect all table rows that are currently
2860: * displayed. This button is used to deselect a column of checkboxes using the id
2861: * that was given to the selectId attribute of the <code>ui:tableColumn</code> tag.</p>
2862: * @see #isDeselectMultipleButton()
2863: */
2864: public void setDeselectMultipleButton(boolean deselectMultipleButton) {
2865: this .deselectMultipleButton = deselectMultipleButton;
2866: this .deselectMultipleButton_set = true;
2867: }
2868:
2869: // deselectMultipleButtonOnClick
2870: private String deselectMultipleButtonOnClick = null;
2871:
2872: /**
2873: * <p>Scripting code that is executed when the user clicks the deselect multiple
2874: * button. You should use the JavaScript <code>setTimeout()</code> function to
2875: * invoke the script to ensure that checkboxes are deselected immediately, instead
2876: * of waiting for the script to complete.</p>
2877: */
2878: public String getDeselectMultipleButtonOnClick() {
2879: if (this .deselectMultipleButtonOnClick != null) {
2880: return this .deselectMultipleButtonOnClick;
2881: }
2882: ValueBinding _vb = getValueBinding("deselectMultipleButtonOnClick");
2883: if (_vb != null) {
2884: return (String) _vb.getValue(getFacesContext());
2885: }
2886: return null;
2887: }
2888:
2889: /**
2890: * <p>Scripting code that is executed when the user clicks the deselect multiple
2891: * button. You should use the JavaScript <code>setTimeout()</code> function to
2892: * invoke the script to ensure that checkboxes are deselected immediately, instead
2893: * of waiting for the script to complete.</p>
2894: * @see #getDeselectMultipleButtonOnClick()
2895: */
2896: public void setDeselectMultipleButtonOnClick(
2897: String deselectMultipleButtonOnClick) {
2898: this .deselectMultipleButtonOnClick = deselectMultipleButtonOnClick;
2899: }
2900:
2901: // deselectSingleButton
2902: private boolean deselectSingleButton = false;
2903: private boolean deselectSingleButton_set = false;
2904:
2905: /**
2906: * <p>In the Action Bar, display a deselect button for tables in which only a single
2907: * table row can be selected at a time. This button is used to deselect a column of
2908: * radio buttons using the id that was given to the selectId attribute of the
2909: * <code>ui:tableColumn</code> tag.</p>
2910: */
2911: public boolean isDeselectSingleButton() {
2912: if (this .deselectSingleButton_set) {
2913: return this .deselectSingleButton;
2914: }
2915: ValueBinding _vb = getValueBinding("deselectSingleButton");
2916: if (_vb != null) {
2917: Object _result = _vb.getValue(getFacesContext());
2918: if (_result == null) {
2919: return false;
2920: } else {
2921: return ((Boolean) _result).booleanValue();
2922: }
2923: }
2924: return false;
2925: }
2926:
2927: /**
2928: * <p>In the Action Bar, display a deselect button for tables in which only a single
2929: * table row can be selected at a time. This button is used to deselect a column of
2930: * radio buttons using the id that was given to the selectId attribute of the
2931: * <code>ui:tableColumn</code> tag.</p>
2932: * @see #isDeselectSingleButton()
2933: */
2934: public void setDeselectSingleButton(boolean deselectSingleButton) {
2935: this .deselectSingleButton = deselectSingleButton;
2936: this .deselectSingleButton_set = true;
2937: }
2938:
2939: // deselectSingleButtonOnClick
2940: private String deselectSingleButtonOnClick = null;
2941:
2942: /**
2943: * <p>Scripting code that is executed when the user clicks the deselect single button.
2944: * You should use the JavaScript <code>setTimeout()</code> function to invoke the
2945: * script to ensure that the radio button is deselected immediately, instead of
2946: * waiting for the script to complete.</p>
2947: */
2948: public String getDeselectSingleButtonOnClick() {
2949: if (this .deselectSingleButtonOnClick != null) {
2950: return this .deselectSingleButtonOnClick;
2951: }
2952: ValueBinding _vb = getValueBinding("deselectSingleButtonOnClick");
2953: if (_vb != null) {
2954: return (String) _vb.getValue(getFacesContext());
2955: }
2956: return null;
2957: }
2958:
2959: /**
2960: * <p>Scripting code that is executed when the user clicks the deselect single button.
2961: * You should use the JavaScript <code>setTimeout()</code> function to invoke the
2962: * script to ensure that the radio button is deselected immediately, instead of
2963: * waiting for the script to complete.</p>
2964: * @see #getDeselectSingleButtonOnClick()
2965: */
2966: public void setDeselectSingleButtonOnClick(
2967: String deselectSingleButtonOnClick) {
2968: this .deselectSingleButtonOnClick = deselectSingleButtonOnClick;
2969: }
2970:
2971: // extraActionBottomHtml
2972: private String extraActionBottomHtml = null;
2973:
2974: /**
2975: * <p>Extra HTML code to be appended to the <code><td> </code>HTML element that
2976: * is rendered for the Action Bar (bottom). Use only code that is valid in an HTML
2977: * <code><td></code> element. The code you specify is inserted in the HTML
2978: * element, and is not checked for validity. For example, you might set this
2979: * attribute to <code>"style=`myActionBarStyle'"</code>.</p>
2980: */
2981: public String getExtraActionBottomHtml() {
2982: if (this .extraActionBottomHtml != null) {
2983: return this .extraActionBottomHtml;
2984: }
2985: ValueBinding _vb = getValueBinding("extraActionBottomHtml");
2986: if (_vb != null) {
2987: return (String) _vb.getValue(getFacesContext());
2988: }
2989: return null;
2990: }
2991:
2992: /**
2993: * <p>Extra HTML code to be appended to the <code><td> </code>HTML element that
2994: * is rendered for the Action Bar (bottom). Use only code that is valid in an HTML
2995: * <code><td></code> element. The code you specify is inserted in the HTML
2996: * element, and is not checked for validity. For example, you might set this
2997: * attribute to <code>"style=`myActionBarStyle'"</code>.</p>
2998: * @see #getExtraActionBottomHtml()
2999: */
3000: public void setExtraActionBottomHtml(String extraActionBottomHtml) {
3001: this .extraActionBottomHtml = extraActionBottomHtml;
3002: }
3003:
3004: // extraActionTopHtml
3005: private String extraActionTopHtml = null;
3006:
3007: /**
3008: * <p>Extra HTML code to be appended to the <code><td> </code>HTML element that
3009: * is rendered for the Action Bar (top). Use only code that is valid in an HTML
3010: * <code><td></code> element. The code you specify is inserted in the HTML
3011: * element, and is not checked for validity. For example, you might set this
3012: * attribute to <code>"style=`myActionBarStyle'"</code>.</p>
3013: */
3014: public String getExtraActionTopHtml() {
3015: if (this .extraActionTopHtml != null) {
3016: return this .extraActionTopHtml;
3017: }
3018: ValueBinding _vb = getValueBinding("extraActionTopHtml");
3019: if (_vb != null) {
3020: return (String) _vb.getValue(getFacesContext());
3021: }
3022: return null;
3023: }
3024:
3025: /**
3026: * <p>Extra HTML code to be appended to the <code><td> </code>HTML element that
3027: * is rendered for the Action Bar (top). Use only code that is valid in an HTML
3028: * <code><td></code> element. The code you specify is inserted in the HTML
3029: * element, and is not checked for validity. For example, you might set this
3030: * attribute to <code>"style=`myActionBarStyle'"</code>.</p>
3031: * @see #getExtraActionTopHtml()
3032: */
3033: public void setExtraActionTopHtml(String extraActionTopHtml) {
3034: this .extraActionTopHtml = extraActionTopHtml;
3035: }
3036:
3037: // extraFooterHtml
3038: private String extraFooterHtml = null;
3039:
3040: /**
3041: * <p>Extra HTML code to be appended to the <code><td> </code>HTML element that
3042: * is rendered for the table footer. Use only code that is valid in an HTML
3043: * <code><td></code> element. The code you specify is inserted in the HTML
3044: * element, and is not checked for validity. For example, you might set this
3045: * attribute to <code>"nowrap=`nowrap'"</code>.</p>
3046: */
3047: public String getExtraFooterHtml() {
3048: if (this .extraFooterHtml != null) {
3049: return this .extraFooterHtml;
3050: }
3051: ValueBinding _vb = getValueBinding("extraFooterHtml");
3052: if (_vb != null) {
3053: return (String) _vb.getValue(getFacesContext());
3054: }
3055: return null;
3056: }
3057:
3058: /**
3059: * <p>Extra HTML code to be appended to the <code><td> </code>HTML element that
3060: * is rendered for the table footer. Use only code that is valid in an HTML
3061: * <code><td></code> element. The code you specify is inserted in the HTML
3062: * element, and is not checked for validity. For example, you might set this
3063: * attribute to <code>"nowrap=`nowrap'"</code>.</p>
3064: * @see #getExtraFooterHtml()
3065: */
3066: public void setExtraFooterHtml(String extraFooterHtml) {
3067: this .extraFooterHtml = extraFooterHtml;
3068: }
3069:
3070: // extraPanelHtml
3071: private String extraPanelHtml = null;
3072:
3073: /**
3074: * <p>Extra HTML code to be appended to the <code><td> </code>HTML element that
3075: * is rendered for an embedded panel. Use only code that is valid in an HTML
3076: * <code><td></code> element. The code you specify is inserted in the HTML
3077: * element, and is not checked for validity.</p>
3078: */
3079: public String getExtraPanelHtml() {
3080: if (this .extraPanelHtml != null) {
3081: return this .extraPanelHtml;
3082: }
3083: ValueBinding _vb = getValueBinding("extraPanelHtml");
3084: if (_vb != null) {
3085: return (String) _vb.getValue(getFacesContext());
3086: }
3087: return null;
3088: }
3089:
3090: /**
3091: * <p>Extra HTML code to be appended to the <code><td> </code>HTML element that
3092: * is rendered for an embedded panel. Use only code that is valid in an HTML
3093: * <code><td></code> element. The code you specify is inserted in the HTML
3094: * element, and is not checked for validity.</p>
3095: * @see #getExtraPanelHtml()
3096: */
3097: public void setExtraPanelHtml(String extraPanelHtml) {
3098: this .extraPanelHtml = extraPanelHtml;
3099: }
3100:
3101: // extraTitleHtml
3102: private String extraTitleHtml = null;
3103:
3104: /**
3105: * <p>Extra HTML code to be appended to the <code><caption></code> HTML element
3106: * that is rendered for the table title. Use only code that is valid in an HTML
3107: * <code><caption></code> element. The code you specify is inserted in the
3108: * HTML element, and is not checked for validity. For example, you might set this
3109: * attribute to <code>"style=`myTitleStyle'"</code>.</p>
3110: */
3111: public String getExtraTitleHtml() {
3112: if (this .extraTitleHtml != null) {
3113: return this .extraTitleHtml;
3114: }
3115: ValueBinding _vb = getValueBinding("extraTitleHtml");
3116: if (_vb != null) {
3117: return (String) _vb.getValue(getFacesContext());
3118: }
3119: return null;
3120: }
3121:
3122: /**
3123: * <p>Extra HTML code to be appended to the <code><caption></code> HTML element
3124: * that is rendered for the table title. Use only code that is valid in an HTML
3125: * <code><caption></code> element. The code you specify is inserted in the
3126: * HTML element, and is not checked for validity. For example, you might set this
3127: * attribute to <code>"style=`myTitleStyle'"</code>.</p>
3128: * @see #getExtraTitleHtml()
3129: */
3130: public void setExtraTitleHtml(String extraTitleHtml) {
3131: this .extraTitleHtml = extraTitleHtml;
3132: }
3133:
3134: // filterId
3135: private String filterId = null;
3136:
3137: /**
3138: * <p>The element id to be applied to the outermost HTML element that is rendered
3139: * for the dropDown component used to display filter options. The id must be
3140: * fully qualified. This id is required for JavaScript functions to set the
3141: * dropDown styles when the embedded filter panel is opened, and to reset the
3142: * default selected value when the panel is closed. Note that if you use the
3143: * <code>ui:dropDown</code> tag as the only component in the <code>filter</code>
3144: * facet, the <code>filterId</code> is optional. If you use a custom component, or
3145: * use the <code>ui:dropDown</code> as a child component, you must specify a
3146: * filterID.</p>
3147: */
3148: public String getFilterId() {
3149: if (this .filterId != null) {
3150: return this .filterId;
3151: }
3152: ValueBinding _vb = getValueBinding("filterId");
3153: if (_vb != null) {
3154: return (String) _vb.getValue(getFacesContext());
3155: }
3156: return null;
3157: }
3158:
3159: /**
3160: * <p>The element id to be applied to the outermost HTML element that is rendered
3161: * for the dropDown component used to display filter options. The id must be
3162: * fully qualified. This id is required for JavaScript functions to set the
3163: * dropDown styles when the embedded filter panel is opened, and to reset the
3164: * default selected value when the panel is closed. Note that if you use the
3165: * <code>ui:dropDown</code> tag as the only component in the <code>filter</code>
3166: * facet, the <code>filterId</code> is optional. If you use a custom component, or
3167: * use the <code>ui:dropDown</code> as a child component, you must specify a
3168: * filterID.</p>
3169: * @see #getFilterId()
3170: */
3171: public void setFilterId(String filterId) {
3172: this .filterId = filterId;
3173: }
3174:
3175: // filterPanelFocusId
3176: private String filterPanelFocusId = null;
3177:
3178: /**
3179: * <p>The element id used to set focus when the filter panel is open.</p>
3180: */
3181: public String getFilterPanelFocusId() {
3182: if (this .filterPanelFocusId != null) {
3183: return this .filterPanelFocusId;
3184: }
3185: ValueBinding _vb = getValueBinding("filterPanelFocusId");
3186: if (_vb != null) {
3187: return (String) _vb.getValue(getFacesContext());
3188: }
3189: return null;
3190: }
3191:
3192: /**
3193: * <p>The element id used to set focus when the filter panel is open.</p>
3194: * @see #getFilterPanelFocusId()
3195: */
3196: public void setFilterPanelFocusId(String filterPanelFocusId) {
3197: this .filterPanelFocusId = filterPanelFocusId;
3198: }
3199:
3200: // filterText
3201: private String filterText = null;
3202:
3203: /**
3204: * <p>Text to be inserted into the table title bar when a filter is applied. This text
3205: * is expected to be the name of the filter that the user has selected. The
3206: * attribute value should be a JavaServer Faces EL expression that resolves to a
3207: * backing bean property whose value is set in your filter code. The value of the
3208: * filterText attribute is inserted into the table title, as follows: Your Table's
3209: * Title <span style="font-style: italic;">filterText</span> Filter Applied.</p>
3210: */
3211: public String getFilterText() {
3212: if (this .filterText != null) {
3213: return this .filterText;
3214: }
3215: ValueBinding _vb = getValueBinding("filterText");
3216: if (_vb != null) {
3217: return (String) _vb.getValue(getFacesContext());
3218: }
3219: return null;
3220: }
3221:
3222: /**
3223: * <p>Text to be inserted into the table title bar when a filter is applied. This text
3224: * is expected to be the name of the filter that the user has selected. The
3225: * attribute value should be a JavaServer Faces EL expression that resolves to a
3226: * backing bean property whose value is set in your filter code. The value of the
3227: * filterText attribute is inserted into the table title, as follows: Your Table's
3228: * Title <span style="font-style: italic;">filterText</span> Filter Applied.</p>
3229: * @see #getFilterText()
3230: */
3231: public void setFilterText(String filterText) {
3232: this .filterText = filterText;
3233: }
3234:
3235: // footerText
3236: private String footerText = null;
3237:
3238: /**
3239: * <p>The text to be displayed in the table footer, which expands across the width of
3240: * the table.</p>
3241: */
3242: public String getFooterText() {
3243: if (this .footerText != null) {
3244: return this .footerText;
3245: }
3246: ValueBinding _vb = getValueBinding("footerText");
3247: if (_vb != null) {
3248: return (String) _vb.getValue(getFacesContext());
3249: }
3250: return null;
3251: }
3252:
3253: /**
3254: * <p>The text to be displayed in the table footer, which expands across the width of
3255: * the table.</p>
3256: * @see #getFooterText()
3257: */
3258: public void setFooterText(String footerText) {
3259: this .footerText = footerText;
3260: }
3261:
3262: // frame
3263: private String frame = null;
3264:
3265: /**
3266: * <p>Specifies the width in pixels of the border around a table.</p>
3267: */
3268: public String getFrame() {
3269: if (this .frame != null) {
3270: return this .frame;
3271: }
3272: ValueBinding _vb = getValueBinding("frame");
3273: if (_vb != null) {
3274: return (String) _vb.getValue(getFacesContext());
3275: }
3276: return null;
3277: }
3278:
3279: /**
3280: * <p>Specifies the width in pixels of the border around a table.</p>
3281: * @see #getFrame()
3282: */
3283: public void setFrame(String frame) {
3284: this .frame = frame;
3285: }
3286:
3287: // hiddenSelectedRows
3288: private boolean hiddenSelectedRows = false;
3289: private boolean hiddenSelectedRows_set = false;
3290:
3291: /**
3292: * <p>Flag indicating that selected rows might be currently hidden from view. UI
3293: * guidelines recommend that rows that are not in view are deselected. For example,
3294: * when users select rows of the table and navigate to another page, the selected
3295: * rows should be deselected automatically. Or, when a user applies a filter or
3296: * sort that hides previously selected rows from view, those selected rows should
3297: * be deselected. By deselecting hidden rows, you prevent the user from
3298: * inadvertantly invoking an action on rows that are not displayed.
3299: * <br/><br/>
3300: * However, sometimes state must be maintained aross table pages. If your table
3301: * must maintain state, you must set the hiddenSelectedRows attribute to true. The
3302: * attribute causes text to be displayed in the table title and footer to indicate
3303: * the number of selected rows that are currently hidden from view. This title and
3304: * footer text is also displayed with a count of 0 when there are no hidden
3305: * selections, to make the user aware of the possibility of hidden selections.
3306: * <br/><br/>
3307: * Note: When hiddenSelectedRows is false, the descending sort button for the
3308: * select column is disabled when the table is paginated. Disabling this button
3309: * prevents a sort from placing selected rows on a page other than the current
3310: * page.</p>
3311: */
3312: public boolean isHiddenSelectedRows() {
3313: if (this .hiddenSelectedRows_set) {
3314: return this .hiddenSelectedRows;
3315: }
3316: ValueBinding _vb = getValueBinding("hiddenSelectedRows");
3317: if (_vb != null) {
3318: Object _result = _vb.getValue(getFacesContext());
3319: if (_result == null) {
3320: return false;
3321: } else {
3322: return ((Boolean) _result).booleanValue();
3323: }
3324: }
3325: return false;
3326: }
3327:
3328: /**
3329: * <p>Flag indicating that selected rows might be currently hidden from view. UI
3330: * guidelines recommend that rows that are not in view are deselected. For example,
3331: * when users select rows of the table and navigate to another page, the selected
3332: * rows should be deselected automatically. Or, when a user applies a filter or
3333: * sort that hides previously selected rows from view, those selected rows should
3334: * be deselected. By deselecting hidden rows, you prevent the user from
3335: * inadvertantly invoking an action on rows that are not displayed.
3336: * <br/><br/>
3337: * However, sometimes state must be maintained aross table pages. If your table
3338: * must maintain state, you must set the hiddenSelectedRows attribute to true. The
3339: * attribute causes text to be displayed in the table title and footer to indicate
3340: * the number of selected rows that are currently hidden from view. This title and
3341: * footer text is also displayed with a count of 0 when there are no hidden
3342: * selections, to make the user aware of the possibility of hidden selections.
3343: * <br/><br/>
3344: * Note: When hiddenSelectedRows is false, the descending sort button for the
3345: * select column is disabled when the table is paginated. Disabling this button
3346: * prevents a sort from placing selected rows on a page other than the current
3347: * page.</p>
3348: * @see #isHiddenSelectedRows()
3349: */
3350: public void setHiddenSelectedRows(boolean hiddenSelectedRows) {
3351: this .hiddenSelectedRows = hiddenSelectedRows;
3352: this .hiddenSelectedRows_set = true;
3353: }
3354:
3355: // internalVirtualForm
3356: private boolean internalVirtualForm = false;
3357: private boolean internalVirtualForm_set = false;
3358:
3359: /**
3360: * <p>Flag indicating that this component should use a virtual form. A virtual form is
3361: * equivalent to enclosing the table component in its own HTML form element,
3362: * separate from other HTML elements on the same page. As an example, consider the
3363: * case where a required text field and table appear on the same page. If the user
3364: * clicks on a table sort button, while the required text field has no value, the
3365: * sort action is never invoked because a value was required and validation failed.
3366: * Placing the table in a virtual form allows the table sort action to complete
3367: * because validation for the required text field is not processed. This is similar
3368: * to using the immediate property of a button, but allows table children to be
3369: * submitted so that selected checkbox values may be sorted, for example.</p>
3370: */
3371: public boolean isInternalVirtualForm() {
3372: if (this .internalVirtualForm_set) {
3373: return this .internalVirtualForm;
3374: }
3375: ValueBinding _vb = getValueBinding("internalVirtualForm");
3376: if (_vb != null) {
3377: Object _result = _vb.getValue(getFacesContext());
3378: if (_result == null) {
3379: return false;
3380: } else {
3381: return ((Boolean) _result).booleanValue();
3382: }
3383: }
3384: return false;
3385: }
3386:
3387: /**
3388: * <p>Flag indicating that this component should use a virtual form. A virtual form is
3389: * equivalent to enclosing the table component in its own HTML form element,
3390: * separate from other HTML elements on the same page. As an example, consider the
3391: * case where a required text field and table appear on the same page. If the user
3392: * clicks on a table sort button, while the required text field has no value, the
3393: * sort action is never invoked because a value was required and validation failed.
3394: * Placing the table in a virtual form allows the table sort action to complete
3395: * because validation for the required text field is not processed. This is similar
3396: * to using the immediate property of a button, but allows table children to be
3397: * submitted so that selected checkbox values may be sorted, for example.</p>
3398: * @see #isInternalVirtualForm()
3399: */
3400: public void setInternalVirtualForm(boolean internalVirtualForm) {
3401: this .internalVirtualForm = internalVirtualForm;
3402: this .internalVirtualForm_set = true;
3403: }
3404:
3405: // itemsText
3406: private String itemsText = null;
3407:
3408: /**
3409: * <p>Text to add to the title of an unpaginated table. For example, if your table
3410: * title is "Critical" and there are 20 items in the table, the default unpaginated
3411: * table title would be Critical (20). If you specify itemsText="alerts", the title
3412: * would be Critical (20 alerts).</p>
3413: */
3414: public String getItemsText() {
3415: if (this .itemsText != null) {
3416: return this .itemsText;
3417: }
3418: ValueBinding _vb = getValueBinding("itemsText");
3419: if (_vb != null) {
3420: return (String) _vb.getValue(getFacesContext());
3421: }
3422: return null;
3423: }
3424:
3425: /**
3426: * <p>Text to add to the title of an unpaginated table. For example, if your table
3427: * title is "Critical" and there are 20 items in the table, the default unpaginated
3428: * table title would be Critical (20). If you specify itemsText="alerts", the title
3429: * would be Critical (20 alerts).</p>
3430: * @see #getItemsText()
3431: */
3432: public void setItemsText(String itemsText) {
3433: this .itemsText = itemsText;
3434: }
3435:
3436: // lite
3437: private boolean lite = false;
3438: private boolean lite_set = false;
3439:
3440: /**
3441: * <p>Renders the table in a style that makes the table look lighter weight, generally
3442: * by omitting the shading around the table and in the title bar.</p>
3443: */
3444: public boolean isLite() {
3445: if (this .lite_set) {
3446: return this .lite;
3447: }
3448: ValueBinding _vb = getValueBinding("lite");
3449: if (_vb != null) {
3450: Object _result = _vb.getValue(getFacesContext());
3451: if (_result == null) {
3452: return false;
3453: } else {
3454: return ((Boolean) _result).booleanValue();
3455: }
3456: }
3457: return false;
3458: }
3459:
3460: /**
3461: * <p>Renders the table in a style that makes the table look lighter weight, generally
3462: * by omitting the shading around the table and in the title bar.</p>
3463: * @see #isLite()
3464: */
3465: public void setLite(boolean lite) {
3466: this .lite = lite;
3467: this .lite_set = true;
3468: }
3469:
3470: // onClick
3471: private String onClick = null;
3472:
3473: /**
3474: * <p>Scripting code executed when a mouse click
3475: * occurs over this component.</p>
3476: */
3477: public String getOnClick() {
3478: if (this .onClick != null) {
3479: return this .onClick;
3480: }
3481: ValueBinding _vb = getValueBinding("onClick");
3482: if (_vb != null) {
3483: return (String) _vb.getValue(getFacesContext());
3484: }
3485: return null;
3486: }
3487:
3488: /**
3489: * <p>Scripting code executed when a mouse click
3490: * occurs over this component.</p>
3491: * @see #getOnClick()
3492: */
3493: public void setOnClick(String onClick) {
3494: this .onClick = onClick;
3495: }
3496:
3497: // onDblClick
3498: private String onDblClick = null;
3499:
3500: /**
3501: * <p>Scripting code executed when a mouse double click
3502: * occurs over this component.</p>
3503: */
3504: public String getOnDblClick() {
3505: if (this .onDblClick != null) {
3506: return this .onDblClick;
3507: }
3508: ValueBinding _vb = getValueBinding("onDblClick");
3509: if (_vb != null) {
3510: return (String) _vb.getValue(getFacesContext());
3511: }
3512: return null;
3513: }
3514:
3515: /**
3516: * <p>Scripting code executed when a mouse double click
3517: * occurs over this component.</p>
3518: * @see #getOnDblClick()
3519: */
3520: public void setOnDblClick(String onDblClick) {
3521: this .onDblClick = onDblClick;
3522: }
3523:
3524: // onKeyDown
3525: private String onKeyDown = null;
3526:
3527: /**
3528: * <p>Scripting code executed when the user presses down on a key while the
3529: * component has focus.</p>
3530: */
3531: public String getOnKeyDown() {
3532: if (this .onKeyDown != null) {
3533: return this .onKeyDown;
3534: }
3535: ValueBinding _vb = getValueBinding("onKeyDown");
3536: if (_vb != null) {
3537: return (String) _vb.getValue(getFacesContext());
3538: }
3539: return null;
3540: }
3541:
3542: /**
3543: * <p>Scripting code executed when the user presses down on a key while the
3544: * component has focus.</p>
3545: * @see #getOnKeyDown()
3546: */
3547: public void setOnKeyDown(String onKeyDown) {
3548: this .onKeyDown = onKeyDown;
3549: }
3550:
3551: // onKeyPress
3552: private String onKeyPress = null;
3553:
3554: /**
3555: * <p>Scripting code executed when the user presses and releases a key while
3556: * the component has focus.</p>
3557: */
3558: public String getOnKeyPress() {
3559: if (this .onKeyPress != null) {
3560: return this .onKeyPress;
3561: }
3562: ValueBinding _vb = getValueBinding("onKeyPress");
3563: if (_vb != null) {
3564: return (String) _vb.getValue(getFacesContext());
3565: }
3566: return null;
3567: }
3568:
3569: /**
3570: * <p>Scripting code executed when the user presses and releases a key while
3571: * the component has focus.</p>
3572: * @see #getOnKeyPress()
3573: */
3574: public void setOnKeyPress(String onKeyPress) {
3575: this .onKeyPress = onKeyPress;
3576: }
3577:
3578: // onKeyUp
3579: private String onKeyUp = null;
3580:
3581: /**
3582: * <p>Scripting code executed when the user releases a key while the
3583: * component has focus.</p>
3584: */
3585: public String getOnKeyUp() {
3586: if (this .onKeyUp != null) {
3587: return this .onKeyUp;
3588: }
3589: ValueBinding _vb = getValueBinding("onKeyUp");
3590: if (_vb != null) {
3591: return (String) _vb.getValue(getFacesContext());
3592: }
3593: return null;
3594: }
3595:
3596: /**
3597: * <p>Scripting code executed when the user releases a key while the
3598: * component has focus.</p>
3599: * @see #getOnKeyUp()
3600: */
3601: public void setOnKeyUp(String onKeyUp) {
3602: this .onKeyUp = onKeyUp;
3603: }
3604:
3605: // onMouseDown
3606: private String onMouseDown = null;
3607:
3608: /**
3609: * <p>Scripting code executed when the user presses a mouse button while the
3610: * mouse pointer is on the component.</p>
3611: */
3612: public String getOnMouseDown() {
3613: if (this .onMouseDown != null) {
3614: return this .onMouseDown;
3615: }
3616: ValueBinding _vb = getValueBinding("onMouseDown");
3617: if (_vb != null) {
3618: return (String) _vb.getValue(getFacesContext());
3619: }
3620: return null;
3621: }
3622:
3623: /**
3624: * <p>Scripting code executed when the user presses a mouse button while the
3625: * mouse pointer is on the component.</p>
3626: * @see #getOnMouseDown()
3627: */
3628: public void setOnMouseDown(String onMouseDown) {
3629: this .onMouseDown = onMouseDown;
3630: }
3631:
3632: // onMouseMove
3633: private String onMouseMove = null;
3634:
3635: /**
3636: * <p>Scripting code executed when the user moves the mouse pointer while
3637: * over the component.</p>
3638: */
3639: public String getOnMouseMove() {
3640: if (this .onMouseMove != null) {
3641: return this .onMouseMove;
3642: }
3643: ValueBinding _vb = getValueBinding("onMouseMove");
3644: if (_vb != null) {
3645: return (String) _vb.getValue(getFacesContext());
3646: }
3647: return null;
3648: }
3649:
3650: /**
3651: * <p>Scripting code executed when the user moves the mouse pointer while
3652: * over the component.</p>
3653: * @see #getOnMouseMove()
3654: */
3655: public void setOnMouseMove(String onMouseMove) {
3656: this .onMouseMove = onMouseMove;
3657: }
3658:
3659: // onMouseOut
3660: private String onMouseOut = null;
3661:
3662: /**
3663: * <p>Scripting code executed when a mouse out movement
3664: * occurs over this component.</p>
3665: */
3666: public String getOnMouseOut() {
3667: if (this .onMouseOut != null) {
3668: return this .onMouseOut;
3669: }
3670: ValueBinding _vb = getValueBinding("onMouseOut");
3671: if (_vb != null) {
3672: return (String) _vb.getValue(getFacesContext());
3673: }
3674: return null;
3675: }
3676:
3677: /**
3678: * <p>Scripting code executed when a mouse out movement
3679: * occurs over this component.</p>
3680: * @see #getOnMouseOut()
3681: */
3682: public void setOnMouseOut(String onMouseOut) {
3683: this .onMouseOut = onMouseOut;
3684: }
3685:
3686: // onMouseOver
3687: private String onMouseOver = null;
3688:
3689: /**
3690: * <p>Scripting code executed when the user moves the mouse pointer into
3691: * the boundary of this component.</p>
3692: */
3693: public String getOnMouseOver() {
3694: if (this .onMouseOver != null) {
3695: return this .onMouseOver;
3696: }
3697: ValueBinding _vb = getValueBinding("onMouseOver");
3698: if (_vb != null) {
3699: return (String) _vb.getValue(getFacesContext());
3700: }
3701: return null;
3702: }
3703:
3704: /**
3705: * <p>Scripting code executed when the user moves the mouse pointer into
3706: * the boundary of this component.</p>
3707: * @see #getOnMouseOver()
3708: */
3709: public void setOnMouseOver(String onMouseOver) {
3710: this .onMouseOver = onMouseOver;
3711: }
3712:
3713: // onMouseUp
3714: private String onMouseUp = null;
3715:
3716: /**
3717: * <p>Scripting code executed when the user releases a mouse button while
3718: * the mouse pointer is on the component.</p>
3719: */
3720: public String getOnMouseUp() {
3721: if (this .onMouseUp != null) {
3722: return this .onMouseUp;
3723: }
3724: ValueBinding _vb = getValueBinding("onMouseUp");
3725: if (_vb != null) {
3726: return (String) _vb.getValue(getFacesContext());
3727: }
3728: return null;
3729: }
3730:
3731: /**
3732: * <p>Scripting code executed when the user releases a mouse button while
3733: * the mouse pointer is on the component.</p>
3734: * @see #getOnMouseUp()
3735: */
3736: public void setOnMouseUp(String onMouseUp) {
3737: this .onMouseUp = onMouseUp;
3738: }
3739:
3740: // paginateButton
3741: private boolean paginateButton = false;
3742: private boolean paginateButton_set = false;
3743:
3744: /**
3745: * <p>Show table paginate button to allow users to switch between viewing all data on
3746: * a single page (unpaginated) or to see data in multiple pages (paginated).</p>
3747: */
3748: public boolean isPaginateButton() {
3749: if (this .paginateButton_set) {
3750: return this .paginateButton;
3751: }
3752: ValueBinding _vb = getValueBinding("paginateButton");
3753: if (_vb != null) {
3754: Object _result = _vb.getValue(getFacesContext());
3755: if (_result == null) {
3756: return false;
3757: } else {
3758: return ((Boolean) _result).booleanValue();
3759: }
3760: }
3761: return false;
3762: }
3763:
3764: /**
3765: * <p>Show table paginate button to allow users to switch between viewing all data on
3766: * a single page (unpaginated) or to see data in multiple pages (paginated).</p>
3767: * @see #isPaginateButton()
3768: */
3769: public void setPaginateButton(boolean paginateButton) {
3770: this .paginateButton = paginateButton;
3771: this .paginateButton_set = true;
3772: }
3773:
3774: // paginationControls
3775: private boolean paginationControls = false;
3776: private boolean paginationControls_set = false;
3777:
3778: /**
3779: * <p>Show the table pagination controls, which allow users to change which page is
3780: * displayed. The controls include an input field for specifying the page number, a
3781: * Go button to go to the specified page, and buttons for going to the first, last,
3782: * previous, and next page.</p>
3783: */
3784: public boolean isPaginationControls() {
3785: if (this .paginationControls_set) {
3786: return this .paginationControls;
3787: }
3788: ValueBinding _vb = getValueBinding("paginationControls");
3789: if (_vb != null) {
3790: Object _result = _vb.getValue(getFacesContext());
3791: if (_result == null) {
3792: return false;
3793: } else {
3794: return ((Boolean) _result).booleanValue();
3795: }
3796: }
3797: return false;
3798: }
3799:
3800: /**
3801: * <p>Show the table pagination controls, which allow users to change which page is
3802: * displayed. The controls include an input field for specifying the page number, a
3803: * Go button to go to the specified page, and buttons for going to the first, last,
3804: * previous, and next page.</p>
3805: * @see #isPaginationControls()
3806: */
3807: public void setPaginationControls(boolean paginationControls) {
3808: this .paginationControls = paginationControls;
3809: this .paginationControls_set = true;
3810: }
3811:
3812: // preferencesPanelFocusId
3813: private String preferencesPanelFocusId = null;
3814:
3815: /**
3816: * <p>The element id used to set focus when the preferences panel is open.</p>
3817: */
3818: public String getPreferencesPanelFocusId() {
3819: if (this .preferencesPanelFocusId != null) {
3820: return this .preferencesPanelFocusId;
3821: }
3822: ValueBinding _vb = getValueBinding("preferencesPanelFocusId");
3823: if (_vb != null) {
3824: return (String) _vb.getValue(getFacesContext());
3825: }
3826: return null;
3827: }
3828:
3829: /**
3830: * <p>The element id used to set focus when the preferences panel is open.</p>
3831: * @see #getPreferencesPanelFocusId()
3832: */
3833: public void setPreferencesPanelFocusId(
3834: String preferencesPanelFocusId) {
3835: this .preferencesPanelFocusId = preferencesPanelFocusId;
3836: }
3837:
3838: // rules
3839: private String rules = null;
3840:
3841: public String getRules() {
3842: if (this .rules != null) {
3843: return this .rules;
3844: }
3845: ValueBinding _vb = getValueBinding("rules");
3846: if (_vb != null) {
3847: return (String) _vb.getValue(getFacesContext());
3848: }
3849: return null;
3850: }
3851:
3852: public void setRules(String rules) {
3853: this .rules = rules;
3854: }
3855:
3856: // selectMultipleButton
3857: private boolean selectMultipleButton = false;
3858: private boolean selectMultipleButton_set = false;
3859:
3860: /**
3861: * <p>Show the button that is used for selecting multiple rows. The button is
3862: * displayed in the Action Bar (top), and allows users to select all rows currently
3863: * displayed. The button selects a column of checkboxes using the id specified in
3864: * the selectId attribute of the <code>ui:tableColumn</code> tag.</p>
3865: */
3866: public boolean isSelectMultipleButton() {
3867: if (this .selectMultipleButton_set) {
3868: return this .selectMultipleButton;
3869: }
3870: ValueBinding _vb = getValueBinding("selectMultipleButton");
3871: if (_vb != null) {
3872: Object _result = _vb.getValue(getFacesContext());
3873: if (_result == null) {
3874: return false;
3875: } else {
3876: return ((Boolean) _result).booleanValue();
3877: }
3878: }
3879: return false;
3880: }
3881:
3882: /**
3883: * <p>Show the button that is used for selecting multiple rows. The button is
3884: * displayed in the Action Bar (top), and allows users to select all rows currently
3885: * displayed. The button selects a column of checkboxes using the id specified in
3886: * the selectId attribute of the <code>ui:tableColumn</code> tag.</p>
3887: * @see #isSelectMultipleButton()
3888: */
3889: public void setSelectMultipleButton(boolean selectMultipleButton) {
3890: this .selectMultipleButton = selectMultipleButton;
3891: this .selectMultipleButton_set = true;
3892: }
3893:
3894: // selectMultipleButtonOnClick
3895: private String selectMultipleButtonOnClick = null;
3896:
3897: /**
3898: * <p>Scripting code executed when the user clicks the mouse on the select multiple
3899: * button.</p>
3900: */
3901: public String getSelectMultipleButtonOnClick() {
3902: if (this .selectMultipleButtonOnClick != null) {
3903: return this .selectMultipleButtonOnClick;
3904: }
3905: ValueBinding _vb = getValueBinding("selectMultipleButtonOnClick");
3906: if (_vb != null) {
3907: return (String) _vb.getValue(getFacesContext());
3908: }
3909: return null;
3910: }
3911:
3912: /**
3913: * <p>Scripting code executed when the user clicks the mouse on the select multiple
3914: * button.</p>
3915: * @see #getSelectMultipleButtonOnClick()
3916: */
3917: public void setSelectMultipleButtonOnClick(
3918: String selectMultipleButtonOnClick) {
3919: this .selectMultipleButtonOnClick = selectMultipleButtonOnClick;
3920: }
3921:
3922: // sortPanelFocusId
3923: private String sortPanelFocusId = null;
3924:
3925: /**
3926: * <p>The element id used to set focus when the sort panel is open.</p>
3927: */
3928: public String getSortPanelFocusId() {
3929: if (this .sortPanelFocusId != null) {
3930: return this .sortPanelFocusId;
3931: }
3932: ValueBinding _vb = getValueBinding("sortPanelFocusId");
3933: if (_vb != null) {
3934: return (String) _vb.getValue(getFacesContext());
3935: }
3936: return null;
3937: }
3938:
3939: /**
3940: * <p>The element id used to set focus when the sort panel is open.</p>
3941: * @see #getSortPanelFocusId()
3942: */
3943: public void setSortPanelFocusId(String sortPanelFocusId) {
3944: this .sortPanelFocusId = sortPanelFocusId;
3945: }
3946:
3947: // sortPanelToggleButton
3948: private boolean sortPanelToggleButton = false;
3949: private boolean sortPanelToggleButton_set = false;
3950:
3951: /**
3952: * <p>Show the button that is used to open and close the sort panel.</p>
3953: */
3954: public boolean isSortPanelToggleButton() {
3955: if (this .sortPanelToggleButton_set) {
3956: return this .sortPanelToggleButton;
3957: }
3958: ValueBinding _vb = getValueBinding("sortPanelToggleButton");
3959: if (_vb != null) {
3960: Object _result = _vb.getValue(getFacesContext());
3961: if (_result == null) {
3962: return false;
3963: } else {
3964: return ((Boolean) _result).booleanValue();
3965: }
3966: }
3967: return false;
3968: }
3969:
3970: /**
3971: * <p>Show the button that is used to open and close the sort panel.</p>
3972: * @see #isSortPanelToggleButton()
3973: */
3974: public void setSortPanelToggleButton(boolean sortPanelToggleButton) {
3975: this .sortPanelToggleButton = sortPanelToggleButton;
3976: this .sortPanelToggleButton_set = true;
3977: }
3978:
3979: // style
3980: private String style = null;
3981:
3982: /**
3983: * <p>CSS style(s) to be applied when this component is rendered.</p>
3984: */
3985: public String getStyle() {
3986: if (this .style != null) {
3987: return this .style;
3988: }
3989: ValueBinding _vb = getValueBinding("style");
3990: if (_vb != null) {
3991: return (String) _vb.getValue(getFacesContext());
3992: }
3993: return null;
3994: }
3995:
3996: /**
3997: * <p>CSS style(s) to be applied when this component is rendered.</p>
3998: * @see #getStyle()
3999: */
4000: public void setStyle(String style) {
4001: this .style = style;
4002: }
4003:
4004: // styleClass
4005: private String styleClass = null;
4006:
4007: /**
4008: * <p>CSS style class(es) to be applied when this component is rendered.</p>
4009: */
4010: public String getStyleClass() {
4011: if (this .styleClass != null) {
4012: return this .styleClass;
4013: }
4014: ValueBinding _vb = getValueBinding("styleClass");
4015: if (_vb != null) {
4016: return (String) _vb.getValue(getFacesContext());
4017: }
4018: return null;
4019: }
4020:
4021: /**
4022: * <p>CSS style class(es) to be applied when this component is rendered.</p>
4023: * @see #getStyleClass()
4024: */
4025: public void setStyleClass(String styleClass) {
4026: this .styleClass = styleClass;
4027: }
4028:
4029: // summary
4030: private String summary = null;
4031:
4032: /**
4033: * <p>Summary text that describes the table for accessibility purposes</p>
4034: */
4035: public String getSummary() {
4036: if (this .summary != null) {
4037: return this .summary;
4038: }
4039: ValueBinding _vb = getValueBinding("summary");
4040: if (_vb != null) {
4041: return (String) _vb.getValue(getFacesContext());
4042: }
4043: return null;
4044: }
4045:
4046: /**
4047: * <p>Summary text that describes the table for accessibility purposes</p>
4048: * @see #getSummary()
4049: */
4050: public void setSummary(String summary) {
4051: this .summary = summary;
4052: }
4053:
4054: // tabIndex
4055: private int tabIndex = Integer.MIN_VALUE;
4056: private boolean tabIndex_set = false;
4057:
4058: /**
4059: * <p>The position of this component in the tabbing order sequence</p>
4060: */
4061: public int getTabIndex() {
4062: if (this .tabIndex_set) {
4063: return this .tabIndex;
4064: }
4065: ValueBinding _vb = getValueBinding("tabIndex");
4066: if (_vb != null) {
4067: Object _result = _vb.getValue(getFacesContext());
4068: if (_result == null) {
4069: return Integer.MIN_VALUE;
4070: } else {
4071: return ((Integer) _result).intValue();
4072: }
4073: }
4074: return Integer.MIN_VALUE;
4075: }
4076:
4077: /**
4078: * <p>The position of this component in the tabbing order sequence</p>
4079: * @see #getTabIndex()
4080: */
4081: public void setTabIndex(int tabIndex) {
4082: this .tabIndex = tabIndex;
4083: this .tabIndex_set = true;
4084: }
4085:
4086: // title
4087: private String title = null;
4088:
4089: /**
4090: * <p>The text displayed for the table title.</p>
4091: */
4092: public String getTitle() {
4093: if (this .title != null) {
4094: return this .title;
4095: }
4096: ValueBinding _vb = getValueBinding("title");
4097: if (_vb != null) {
4098: return (String) _vb.getValue(getFacesContext());
4099: }
4100: return null;
4101: }
4102:
4103: /**
4104: * <p>The text displayed for the table title.</p>
4105: * @see #getTitle()
4106: */
4107: public void setTitle(String title) {
4108: this .title = title;
4109: }
4110:
4111: // toolTip
4112: private String toolTip = null;
4113:
4114: /**
4115: * <p>Display the text as a tooltip for this component</p>
4116: */
4117: public String getToolTip() {
4118: if (this .toolTip != null) {
4119: return this .toolTip;
4120: }
4121: ValueBinding _vb = getValueBinding("toolTip");
4122: if (_vb != null) {
4123: return (String) _vb.getValue(getFacesContext());
4124: }
4125: return null;
4126: }
4127:
4128: /**
4129: * <p>Display the text as a tooltip for this component</p>
4130: * @see #getToolTip()
4131: */
4132: public void setToolTip(String toolTip) {
4133: this .toolTip = toolTip;
4134: }
4135:
4136: // visible
4137: private boolean visible = false;
4138: private boolean visible_set = false;
4139:
4140: /**
4141: * <p>Use the visible attribute to indicate whether the component should be
4142: * viewable by the user in the rendered HTML page. If set to false, the
4143: * HTML code for the component is present in the page, but the component
4144: * is hidden with style attributes. By default, visible is set to true, so
4145: * HTML for the component HTML is included and visible to the user. If the
4146: * component is not visible, it can still be processed on subsequent form
4147: * submissions because the HTML is present.</p>
4148: */
4149: public boolean isVisible() {
4150: if (this .visible_set) {
4151: return this .visible;
4152: }
4153: ValueBinding _vb = getValueBinding("visible");
4154: if (_vb != null) {
4155: Object _result = _vb.getValue(getFacesContext());
4156: if (_result == null) {
4157: return false;
4158: } else {
4159: return ((Boolean) _result).booleanValue();
4160: }
4161: }
4162: return true;
4163: }
4164:
4165: /**
4166: * <p>Use the visible attribute to indicate whether the component should be
4167: * viewable by the user in the rendered HTML page. If set to false, the
4168: * HTML code for the component is present in the page, but the component
4169: * is hidden with style attributes. By default, visible is set to true, so
4170: * HTML for the component HTML is included and visible to the user. If the
4171: * component is not visible, it can still be processed on subsequent form
4172: * submissions because the HTML is present.</p>
4173: * @see #isVisible()
4174: */
4175: public void setVisible(boolean visible) {
4176: this .visible = visible;
4177: this .visible_set = true;
4178: }
4179:
4180: // width
4181: private String width = null;
4182:
4183: /**
4184: * <p>Set the width of the table on the page (deprecated in HTML 4.0)</p>
4185: */
4186: public String getWidth() {
4187: if (this .width != null) {
4188: return this .width;
4189: }
4190: ValueBinding _vb = getValueBinding("width");
4191: if (_vb != null) {
4192: return (String) _vb.getValue(getFacesContext());
4193: }
4194: return null;
4195: }
4196:
4197: /**
4198: * <p>Set the width of the table on the page (deprecated in HTML 4.0)</p>
4199: * @see #getWidth()
4200: */
4201: public void setWidth(String width) {
4202: this .width = width;
4203: }
4204:
4205: /**
4206: * <p>Restore the state of this component.</p>
4207: */
4208: public void restoreState(FacesContext _context, Object _state) {
4209: Object _values[] = (Object[]) _state;
4210: super .restoreState(_context, _values[0]);
4211: this .align = (String) _values[1];
4212: this .augmentTitle = ((Boolean) _values[2]).booleanValue();
4213: this .augmentTitle_set = ((Boolean) _values[3]).booleanValue();
4214: this .bgColor = (String) _values[4];
4215: this .border = ((Integer) _values[5]).intValue();
4216: this .border_set = ((Boolean) _values[6]).booleanValue();
4217: this .cellPadding = (String) _values[7];
4218: this .cellSpacing = (String) _values[8];
4219: this .clearSortButton = ((Boolean) _values[9]).booleanValue();
4220: this .clearSortButton_set = ((Boolean) _values[10])
4221: .booleanValue();
4222: this .deselectMultipleButton = ((Boolean) _values[11])
4223: .booleanValue();
4224: this .deselectMultipleButton_set = ((Boolean) _values[12])
4225: .booleanValue();
4226: this .deselectMultipleButtonOnClick = (String) _values[13];
4227: this .deselectSingleButton = ((Boolean) _values[14])
4228: .booleanValue();
4229: this .deselectSingleButton_set = ((Boolean) _values[15])
4230: .booleanValue();
4231: this .deselectSingleButtonOnClick = (String) _values[16];
4232: this .extraActionBottomHtml = (String) _values[17];
4233: this .extraActionTopHtml = (String) _values[18];
4234: this .extraFooterHtml = (String) _values[19];
4235: this .extraPanelHtml = (String) _values[20];
4236: this .extraTitleHtml = (String) _values[21];
4237: this .filterId = (String) _values[22];
4238: this .filterPanelFocusId = (String) _values[23];
4239: this .filterText = (String) _values[24];
4240: this .footerText = (String) _values[25];
4241: this .frame = (String) _values[26];
4242: this .hiddenSelectedRows = ((Boolean) _values[27])
4243: .booleanValue();
4244: this .hiddenSelectedRows_set = ((Boolean) _values[28])
4245: .booleanValue();
4246: this .internalVirtualForm = ((Boolean) _values[29])
4247: .booleanValue();
4248: this .internalVirtualForm_set = ((Boolean) _values[30])
4249: .booleanValue();
4250: this .itemsText = (String) _values[31];
4251: this .lite = ((Boolean) _values[32]).booleanValue();
4252: this .lite_set = ((Boolean) _values[33]).booleanValue();
4253: this .onClick = (String) _values[34];
4254: this .onDblClick = (String) _values[35];
4255: this .onKeyDown = (String) _values[36];
4256: this .onKeyPress = (String) _values[37];
4257: this .onKeyUp = (String) _values[38];
4258: this .onMouseDown = (String) _values[39];
4259: this .onMouseMove = (String) _values[40];
4260: this .onMouseOut = (String) _values[41];
4261: this .onMouseOver = (String) _values[42];
4262: this .onMouseUp = (String) _values[43];
4263: this .paginateButton = ((Boolean) _values[44]).booleanValue();
4264: this .paginateButton_set = ((Boolean) _values[45])
4265: .booleanValue();
4266: this .paginationControls = ((Boolean) _values[46])
4267: .booleanValue();
4268: this .paginationControls_set = ((Boolean) _values[47])
4269: .booleanValue();
4270: this .preferencesPanelFocusId = (String) _values[48];
4271: this .rules = (String) _values[49];
4272: this .selectMultipleButton = ((Boolean) _values[50])
4273: .booleanValue();
4274: this .selectMultipleButton_set = ((Boolean) _values[51])
4275: .booleanValue();
4276: this .selectMultipleButtonOnClick = (String) _values[52];
4277: this .sortPanelFocusId = (String) _values[53];
4278: this .sortPanelToggleButton = ((Boolean) _values[54])
4279: .booleanValue();
4280: this .sortPanelToggleButton_set = ((Boolean) _values[55])
4281: .booleanValue();
4282: this .style = (String) _values[56];
4283: this .styleClass = (String) _values[57];
4284: this .summary = (String) _values[58];
4285: this .tabIndex = ((Integer) _values[59]).intValue();
4286: this .tabIndex_set = ((Boolean) _values[60]).booleanValue();
4287: this .title = (String) _values[61];
4288: this .toolTip = (String) _values[62];
4289: this .visible = ((Boolean) _values[63]).booleanValue();
4290: this .visible_set = ((Boolean) _values[64]).booleanValue();
4291: this .width = (String) _values[65];
4292: }
4293:
4294: /**
4295: * <p>Save the state of this component.</p>
4296: */
4297: public Object saveState(FacesContext _context) {
4298: Object _values[] = new Object[66];
4299: _values[0] = super .saveState(_context);
4300: _values[1] = this .align;
4301: _values[2] = this .augmentTitle ? Boolean.TRUE : Boolean.FALSE;
4302: _values[3] = this .augmentTitle_set ? Boolean.TRUE
4303: : Boolean.FALSE;
4304: _values[4] = this .bgColor;
4305: _values[5] = new Integer(this .border);
4306: _values[6] = this .border_set ? Boolean.TRUE : Boolean.FALSE;
4307: _values[7] = this .cellPadding;
4308: _values[8] = this .cellSpacing;
4309: _values[9] = this .clearSortButton ? Boolean.TRUE
4310: : Boolean.FALSE;
4311: _values[10] = this .clearSortButton_set ? Boolean.TRUE
4312: : Boolean.FALSE;
4313: _values[11] = this .deselectMultipleButton ? Boolean.TRUE
4314: : Boolean.FALSE;
4315: _values[12] = this .deselectMultipleButton_set ? Boolean.TRUE
4316: : Boolean.FALSE;
4317: _values[13] = this .deselectMultipleButtonOnClick;
4318: _values[14] = this .deselectSingleButton ? Boolean.TRUE
4319: : Boolean.FALSE;
4320: _values[15] = this .deselectSingleButton_set ? Boolean.TRUE
4321: : Boolean.FALSE;
4322: _values[16] = this .deselectSingleButtonOnClick;
4323: _values[17] = this .extraActionBottomHtml;
4324: _values[18] = this .extraActionTopHtml;
4325: _values[19] = this .extraFooterHtml;
4326: _values[20] = this .extraPanelHtml;
4327: _values[21] = this .extraTitleHtml;
4328: _values[22] = this .filterId;
4329: _values[23] = this .filterPanelFocusId;
4330: _values[24] = this .filterText;
4331: _values[25] = this .footerText;
4332: _values[26] = this .frame;
4333: _values[27] = this .hiddenSelectedRows ? Boolean.TRUE
4334: : Boolean.FALSE;
4335: _values[28] = this .hiddenSelectedRows_set ? Boolean.TRUE
4336: : Boolean.FALSE;
4337: _values[29] = this .internalVirtualForm ? Boolean.TRUE
4338: : Boolean.FALSE;
4339: _values[30] = this .internalVirtualForm_set ? Boolean.TRUE
4340: : Boolean.FALSE;
4341: _values[31] = this .itemsText;
4342: _values[32] = this .lite ? Boolean.TRUE : Boolean.FALSE;
4343: _values[33] = this .lite_set ? Boolean.TRUE : Boolean.FALSE;
4344: _values[34] = this .onClick;
4345: _values[35] = this .onDblClick;
4346: _values[36] = this .onKeyDown;
4347: _values[37] = this .onKeyPress;
4348: _values[38] = this .onKeyUp;
4349: _values[39] = this .onMouseDown;
4350: _values[40] = this .onMouseMove;
4351: _values[41] = this .onMouseOut;
4352: _values[42] = this .onMouseOver;
4353: _values[43] = this .onMouseUp;
4354: _values[44] = this .paginateButton ? Boolean.TRUE
4355: : Boolean.FALSE;
4356: _values[45] = this .paginateButton_set ? Boolean.TRUE
4357: : Boolean.FALSE;
4358: _values[46] = this .paginationControls ? Boolean.TRUE
4359: : Boolean.FALSE;
4360: _values[47] = this .paginationControls_set ? Boolean.TRUE
4361: : Boolean.FALSE;
4362: _values[48] = this .preferencesPanelFocusId;
4363: _values[49] = this .rules;
4364: _values[50] = this .selectMultipleButton ? Boolean.TRUE
4365: : Boolean.FALSE;
4366: _values[51] = this .selectMultipleButton_set ? Boolean.TRUE
4367: : Boolean.FALSE;
4368: _values[52] = this .selectMultipleButtonOnClick;
4369: _values[53] = this .sortPanelFocusId;
4370: _values[54] = this .sortPanelToggleButton ? Boolean.TRUE
4371: : Boolean.FALSE;
4372: _values[55] = this .sortPanelToggleButton_set ? Boolean.TRUE
4373: : Boolean.FALSE;
4374: _values[56] = this .style;
4375: _values[57] = this .styleClass;
4376: _values[58] = this .summary;
4377: _values[59] = new Integer(this .tabIndex);
4378: _values[60] = this .tabIndex_set ? Boolean.TRUE : Boolean.FALSE;
4379: _values[61] = this .title;
4380: _values[62] = this .toolTip;
4381: _values[63] = this .visible ? Boolean.TRUE : Boolean.FALSE;
4382: _values[64] = this .visible_set ? Boolean.TRUE : Boolean.FALSE;
4383: _values[65] = this.width;
4384: return _values;
4385: }
4386:
4387: }
|