First page Back Continue Last page Graphics


Notes:

Enabling PPR Declaratively (continued)

To enable a component to partially refresh another component, perform the following steps:

1. On the trigger component:

Set the id attribute to a unique value.

If it is an input component in a form, set the autoSubmit attribute of the component to true. Otherwise, set the partialSubmit attribute of the component to true.

2. On the target component that you want to partially refresh when the trigger command component is activated, set the partialTriggers attribute to the ID of the trigger component. If the component refresh is to be triggered by more than one other component, list their IDs separated by spaces. It is recommended that you use the partial trigger editor for choosing the ID values. If the target component is inside a *container* component, the partialTrigger value might contain that *container* ID as well—which the partial trigger editor would automatically pick up.

At run time, when the triggering component fires a partial event, the output component, which is listening for partial events from the triggering component, refreshes its values using PPR.

Example:

<af:commandButton text="Toggle" id="commandButton1partialSubmit="true" actionListener="#{backing_page.commandButton1_actionListener}"/> <af:outputText value="Hello World" binding="#{backing_page.outputText1}" id="outputText1" partialTriggers="commandButton1"/>

Setting partialSubmit to true (the default value is false) on af:commandButton causes ADF Faces to perform the action through a partial page submit when the button is clicked (action listeners and events, as used in the example, are discussed the lesson titled “Responding to Application Events”). The partialTriggers attribute on af:outputText tells the component to listen for any event triggered by the af:commandButton; when an event is triggered, the af:outputText component automatically refreshes itself. ADF Faces does not rerender the entire page, but only those components (for example, af:outputText) that are listening for events fired by trigger components (for example, af:commandButton) are rerendered.

Note that only the following ADF Faces command components use full page rendering for their action events by default (that is, partialSubmit is false by default):

af:commandButton

af:commandLink

af:commandNavigationItem

In contrast, the following command components always use PPR for their action events (that is, partialSubmit is true by default), unless explicitly set otherwise:

af:commandMenuItem

af:commandToolbarButton

Like action events, value change events in ADF Faces components can also use PPR. ADF Faces input and select components (such as af:inputText and af:selectOneChoice) automatically trigger partial page requests when their autoSubmit attribute is set to true.