What Happens at Runtime: Passing Values

5-2 Web User Interface Developers Guide for Oracle Application Development Framework While ADF Faces adheres to standard JSF event handling techniques, it also enhances event handling in two key ways by providing: ■ Ajax-based functionality partial page rendering ■ A client-side event model

5.1.1 Events and Partial Page Rendering

Unlike standard JSF events, ADF Faces events support AJAX-style partial postbacks to enable partial page rendering PPR. Instead of full page rendering, ADF Faces events and components can trigger partial page rendering, that is, only portions of a page refresh upon request. Certain components are considered event root components. Event root components determine boundaries on the page, and so allow the lifecycle to run just on components within that boundary for more information about this aspect of the lifecycle, see Section 4.3, Using the Optimized Lifecycle . When an event occurs within an event root, only those components that are children to the root are refreshed on the page. An example of an event root component is a popup. When an event happens within a popup, only the popup and its children are rerendered, and not the whole page. Additionally, certain events indicate a specific component as an event root component. For example, the disclosure event sent when a expanding or collapsing a showDetail component see Section 8.8, Displaying and Hiding Contents Dynamically , indicates that the showDetail component is a root. The lifecycle is run only on the showDetail component and any child components or other components that point to this as a trigger, and only they are rerendered when it is expanded or collapsed. Table 5–1 shows the event types in ADF Faces, and whether or not the source component is an event root. Note: Any ADF Faces component that has built-in event functionality must be enclosed in the form tag. Table 5–1 Events and Event Root Components Event Type Component Trigger Is Event Root action All command components false dialog dialog false disclosure showDetail, showDetailHeader true disclosure showDetailItem true focus tree, treeTable true launch All command components NA launchPopup inputListOfValues, inputComboboxListOfValues true load document NA poll poll true popupOpened popup NA popupOpening popup NA popupClosed popup NA Handling Events 5-3

5.1.2 Client-Side Event Model

In addition to server-side action and value change events, ADF Faces components also invoke client-side action and value change events, and other kinds of server and client events. Some events are generated by both server and client components for example, selection events; some events are generated by server components only for example, launch events; and some events are generated by client components only for example, load events. By default, most client events are propagated to the server. Changes to the component state are automatically synchronized back to the server to ensure consistency of state, and events are delivered, when necessary, to the server for further processing. However, you can configure your event so that it does not propagate. In addition, any time you register a client-side event listener on the server-side Java component, the RCF assumes that you require a JavaScript component, so a client-side component is created. Client-side JavaScript events can come from several sources: they can be derived automatically from DOM events, from property change events, or they can be manually created during the processing of other events.

5.2 Using ADF Faces Server Events

ADF Faces provides a number of server-side events. Table 5–2 lists the events generated by ADF Faces components on the server, and the components that trigger them. propertyChange All components NA queryEvent query, quickQuery true queryOperation query, quickQuery true rangeChange table NA regionNavigation region NA return All command components true returnPopupData inputListOfValues, inputComboboxListOfValues true returnPopup inputListOfValues, inputComboboxListOfValues true rowDisclosure tree, treeTable true selection tree, treeTable, table true sort treeTable, table true valueChange All input and select components components that implement EditableValueHolder true Tip: If components outside of the event root need to be processed when the event root is processed, then you must set the partialTrigger attribute on those components to the ID of the event root component. Table 5–1 Cont. Events and Event Root Components Event Type Component Trigger Is Event Root