How to Create a Panel Card What Happens at Runtime When a Panel Card Component Is Rendered

29-24 Web User Interface Developers Guide for Oracle Application Development Framework expression that evaluates to true when the relationship matches the value you specify in this example, CONSULTANT: rendered={node.relationship == CEO}

29.8 Adding Search to a Hierarchy Viewer

The hierarchy viewer search functionality looks through the data structure of the hierarchy viewer and presents matches in a scrollable list. Users can double-click a search result to display the matching node as the anchor node in the hierarchy viewer. When enabled, a search panel is displayed in the upper right-hand corner of the hierarchy viewer, and results are displayed below the search panel. Figure 29–16 shows a sample search panel. Figure 29–16 Hierarchy Viewer Search Panel Figure 29–17 shows sample search results. Figure 29–17 Hierarchy Viewer Sample Search Results

29.8.1 How to Configure Searching in a Hierarchy Viewer

Add the dvt:search tag as a child of the dvt:hierarchyViewer tag to enable searching, and dvt:searchResults as a child of dvt:search to specify how to handle the results. To configure search in a hierarchy viewer: 1. In the Structure window, right-click the dvt:hierarchyViewer node and choose insert inside dvt:hierarchyViewer dvt:search. 2. In the Property Inspector, set the following attributes to configure the search functionality: ■ value: Specify the variable to hold the search text. ■ actionListener: Enter the listener called to perform the search. Using ADF Hierarchy Viewer Components 29-25 ■ initialBehavior: Specify how the search panel is initially displayed. Valid values are initCollapsed for initially collapsed, initExpanded for initially expanded, or hidden for completely hidden from view. 3. Optionally, add a f:facet with a value of name=end to specify a component that will launch an advanced search outside of the hierarchy viewer component. This facet should contain only a single component, for example af:commandLink, to launch a comprehensive search of a data set. For more information, see Section 12.4, Using the query Component.

4. In the Structure window, right-click the dvt:search node and choose insert inside

dvt:search dvt:searchResults. 5. In the Property Inspector, set the following attributes to configure the display of the search results: ■ value: Specify the search results data model. This must be an instance of oracle.adf.view.faces.bi.model.DataModel. ■ var: Enter the name of the EL variable used to reference each element of the hierarchy viewer collection. Once this component has completed rendering, this variable is removed, or reverted back, to its previous value. ■ varStatus: Enter the name of the EL variable used to reference the varStatus information. Once this component has completed rendering, this variable is removed, or reverted back, to its previous value. ■ resultListener: Specify a reference to an action listener that will be called after a row in the search results is selected. ■ emptyText: Specify the text to display when no results are returned. ■ fetchSize: Specify the number of result rows to fetch at a time.

6. In the Structure window, right-click the dvt:searchResults node and select insert

inside dvt:searchResults , then select ADF Faces, then select af:setPropertyListener . 7. In the Property Inspector, set the following attributes to map the search results node from the results model to the corresponding hierarchy viewer model: ■ from: Specify the source of the value, a constant or an EL expression. ■ to: Specify the target of the value. ■ type: Choose action as the value.

8. In the Structure window, right-click the dvt:searchResults node and choose insert

inside dvt:searchResults

f:facet with a value of name=content. 9.

In the Structure window, right-click the f:facet content node and do the following to specify the components to stamp out the search results: ■ Insert an ADF Faces af:panelGroupLayout element to wrap the output of the search results. ■ Insert the ADF Faces output components to display the search results. For example: af:outputText value={resultRow.Lastname} id=ot1 inlineStyle=color:blue; af:outputText value={resultRow.Firstname} id=ot2 Each stamped row references the current row using the var attribute of the dvt:searchResults tag.