What You May Need to Know About Programmatically Enabling Sorting for Table Columns What You May Need to Know About Performing an Action on Selected Rows in Tables

10-28 Web User Interface Developers Guide for Oracle Application Development Framework facet is shown. When the user clicks on the toggle icon again, the component is hidden. Figure 10–15 shows the additional column that is displayed when content is added to the detailStamp facet. Figure 10–15 Table with Unexpanded DetailStamp Facet Figure 10–16 shows the same table, but with the detailStamp facet expanded for the first row. Figure 10–16 Expanded detailStamp Facet

10.3.1 How to Use the detailStamp Facet

To use the detailStamp facet, you insert a component that is bound to the data to be displayed or hidden into the facet. To use the detailStamp facet: 1. In the Component Palette, drag the components you want to appear in the facet to the detailStamp facet folder. Figure 10–17 shows the detailStamp facet folder in the Structure window. Note: When a table that uses the detailStamp facet is rendered in Screen Reader mode, the contents of the facet appear in a popup window. For more information about accessibility, see Chapter 22, Developing Accessible ADF Faces Pages. Note: If you set the table to allow columns to freeze, the freeze will not work when you display the detailStamp facet. That is, a user cannot freeze a column while the details are being displayed. Using Tables and Trees 10-29 Figure 10–17 detailStamp Facet in the Structure Window 2. If the attribute to be displayed is specific to a current record, replace the JSF code which simply binds the component to the attribute, so that it uses the table’s variable to display the data for the current record. Example 10–8 shows abbreviated code used to display the detailStamp facet shown in Figure 10–16 , which shows details about the selected row. Example 10–8 Code for detailStamp Facet af:table rowSelection=multiple var=test1 value={tableTestData} f:facet name=detailStamp af:panelFormLayout rows=4 labelWidth=33 fieldWidth=67 inlineStyle=width:400px af:inputText label=Name value={test1.name} af:group af:inputText label=Size value={test1.size} af:inputText label=Date Modified value={test1.inputDate} af:inputText label=Created by af:group af:panelFormLayout f:facet af:table

10.3.2 What Happens at Runtime: Disclosing Row Data

When the user hides or shows the details of a row, the table generates a rowDisclosureEvent event. The event tells the table to toggle the details that is, either expand or collapse. The rowDisclosureEvent event has an associated listener. You can bind the rowDisclosureListener attribute on the table to a method on a managed bean. This method will then be invoked in response to the rowDisclosureEvent event to execute any needed post-processing. Tip: If the facet folder does not appear in the Structure window, right-click the table and choose Facets - Table Detail Stamp. Note: If your application uses the Fusion technology stack, then you can drag attributes from a data control and drop them into the detailStamp facet. You don’t need to modify the code. 10-30 Web User Interface Developers Guide for Oracle Application Development Framework

10.4 Enabling Filtering in Tables

You can add a filter to a table that can be used so that the table displays only rows whose values match the filter. When enabled and set to visible, a search criteria input field displays above each searchable column. For example, the table in Figure 10–18 has been filtered to display only rows in which the Location value is 1700. Figure 10–18 Filtered Table Filtered table searches are based on Query-by-Example and use the QBE text or date input field formats. The input validators are turned off to allow for entering characters for operators such as and to modify the search criteria. For example, you can enter 1500 as the search criteria for a number column. Wildcard characters may also be supported. Searches can be either case-sensitive or case-insensitive. If a column does not support QBE, the search criteria input field will not render for that column. The filtering feature uses a model for filtering data into the table. The table’s filterModel attribute object must be bound to an instance of the FilterableQueryDescriptor class. In Example 10–9 , the table filterVisible attribute is set to true to enable the filter input fields, and the sortProperty attribute is set on the column to identify the column in the filterModel instance. Each column element has its filterable attribute set to true. Example 10–9 Table Component with Filtering Enabled af:table value={myBean.products} var=row ... filterVisible=true ... rowselection=single ... af:column sortProperty=ProductID filterable=true sortable=true af:outputText value={row.ProductID} ... af:column af:column sortProperty=Name filterable=true sortable=true af:outputText value={row.Name} Note: If your application uses the Fusion technology stack, then you can use data controls to create tables and filtering will be created for you. For more information see the Creating ADF Databound Tables chapter of the Oracle Fusion Middleware Web User Interface Developers Guide for Oracle Application Development Framework