What Happens at Runtime: Data Delivery

Using Tables and Trees 10-27 FacesContext context = FacesContext.getCurrentInstance; Object rowItemObj = context.getApplication.evaluateExpressionGet context, {row.items}, Object.class; if rowItemObj == null return null; Convert the model objects into items ListSomeModelObject list = ListSomeModelObject rowItemObj; ListSelectItem items = new ArrayListSelectItemlist.size; for SomeModelObject entry : list { items.addnew SelectItementry.getValue, entry.getLabel;public } Return the items return items; } You can then access the list from the one component on the page, as shown in Example 10–6 . Example 10–6 Accessing the Items from a JSF Page af:table var=row af:column af:selectOneChoice value={row.myValue} f:Items value={page_backing.Items} af:selectOneChoice af:column af:table

10.2.10 What You May Need to Know About Using the Iterator Tag

When you do not want to use a table, but still need the same stamping capabilities, you can use the iterator tag. For example, say you want to display a list of periodic table elements, and for each element, you want to display the name, atomic number, symbol, and group. You can use the iterator tag as shown in Example 10–7 . Example 10–7 Using the Iterator Tag af:iterator var=row first=3 rows=3 varStatus=stat value={periodicTable.tableData} af:outputText value={stat.count}.Index:{stat.index} of {stat.model.rowCount} af:inputText label=Element Name value={row.name} af:inputText label=Atomic Number value={row.number} af:inputText label=Symbol value={row.symbol} af:inputText label=Group value={row.group} af:iterator Each child is stamped as many times as necessary. Iteration starts at the index specified by the first attribute for as many indexes specified by the row attribute. If the row attribute is set to 0, then the iteration continues until there are no more elements in the underlying data.

10.3 Adding Hidden Capabilities to a Table

You can use the detailStamp facet in a table to include data that can be displayed or hidden. When you add a component to this facet, the table displays an additional column with a toggle icon. When the user clicks the icon, the component added to the 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.