Reputation: 332
Difference between ADF initContext and prepareModel,since both preparing data by executing buisness service making it available through binding container which is a Map object.
Upvotes: 2
Views: 4687
Reputation: 2496
The ADF model life cycle phases:
Note that in some situations (such as a modal dialog), the following code will not necessarily fire after the page has been rendered:
public void afterPhase(PagePhaseEvent pagePhaseEvent) {
if (pagePhaseEvent.getPhaseId() == Lifecycle.PREPARE_RENDER_ID) {
injectRedirect();
}
}
This prevents the server code from being able to examine the af:document immediately after the document is rendered. For example the following will fail because there is no document available:
return context.getViewRoot().getChildren().get(0).getClientId().equals("doc0");
Upvotes: 3
Reputation: 711
ADF initContext and prepareModel,since both preparing data by executing buisness service
This is not quite correct. The initContext
sets up the BindingContext, which ensures the content of DataBindings.cpx
is initialized and the binding container for the page to be prepared. The prepareModel
is an execution point for data queries.
The other execution point, as Timo's answer shows, is PrepareRender
. Recommendation though is to keep the iterator default setting, which is "deferred" in which case only those iterators are refreshed and queried that have UI dependency.
Upvotes: 3