问题
I am having some confusion about some terminology used in ADF mainly in regards to the Iterator Binding.
- What is the purpose of the Refresh flag on an Iterator Binding in ADF?
- When(In which phase of the Lifecycle) is it recommended to do the refresh and why?
- What is the difference between refreshing an iterator and querying an iterator in ADF-speak?
回答1:
- Refresh means to rebind the Binding Layer iterator to the VO rowset iterator. This happens when the Page is rebuilt and the binding layer is recreated when a page request is received. Querying causes the VO to re-query the data source and rebuild the rowset iterator. Refresh does not cause a (re)query unless the VO rowset has not been created yet.
- Refresh can be done at different points in the lifecycle depending on need. The normal setting "deferred" is usually fine (see docs below).
- Refresh indicates when to rebind the iterator.
From the Docs: ADF Docs At runtime, executable bindings are refreshed based on the value of their Refresh attribute. Refreshing an iterator binding reconnects it with its underlying RowSetIterator object. Refreshing an invoke action binding invokes the action. Before refreshing any bindings, the ADF runtime evaluates any Refresh and RefreshCondition attributes specified in the executables. The Refresh attribute specifies the ADF lifecycle phase within which the executable should be invoked. The RefreshCondition attribute specifies the conditions under which the executable should be invoked. You can specify the RefreshCondition value using a boolean EL expression. If you leave the RefreshCondition attribute blank, it evaluates to true. By default, the Refresh value is set to deferred. This means the binding will not be executed unless its value is accessed (for example by an EL expression on a JSF page). Once called, it will not reexecute unless any parameter values for the binding have changed, or if the binding itself has changed. Using ADF Model in a Fusion Web Application 12-29 Creating ADF Data Binding EL Expressions For more information about how bindings are refreshed and how to set the Refresh and RefreshCondition attributes, see Section 21.2, "The JSF and ADF Page Lifecycles."
来源:https://stackoverflow.com/questions/15574019/what-does-the-terms-refresh-and-query-mean-for-an-iterator-binding-mean-in-a