First page Back Continue Last page Graphics


Notes:

Controlling the Execution of Executables (continued)

Refreshing an invoke action binding invokes the action.

Determining When to Refresh (continued)

renderModelIfNeeded: Same as ifNeeded, during the Render Model phase

RefreshAfter: Specify that one executable refreshes after another (you also need to set the RefreshAfter property in addition to the Refresh property); used to handle dependencies between executables

never (valid for iterator bindings only): Refreshes only when your own code calls getRowSetIterator() on the iterator binding

always (valid for iterator bindings only): Iterator is always refreshed during both the Prepare Model and Prepare Render phases

Determining Whether to Refresh

Before refreshing any bindings, the ADF run time evaluates the refreshCondition attribute of the executables, which specifies the conditions under which the executable should be refreshed. You can specify the refreshCondition value using a Boolean EL expression (default is true.)

If an iterator binding is not refreshed during the life cycle, it does not point to any row set iterator for that request. This results in the value bindings related to that iterator binding not having any data to display. This can be a desirable result when, for example, you want a page such as a search page to initially show no data. To achieve this, you can use the refreshCondition of: #{adfFacesContext.initialRender}, which evaluates to true when a page is first rendered.

You should set the Refresh property of an executable to renderModel when refreshCondition is dependent on the model. So if you want to use the #{adfFacesContext.initialRender} expression in refreshCondition of an executable, you must set the Refresh property to either renderModel or renderModelIfNeeded, which causes the method to be executed during the prepareRender phase.

Another attribute, which determines whether to refresh the executable is refreshAfter. It specifies the condition after which the page should be refreshed.

Refresh the iterator when the cart already has an ID or if the order status is OPEN.