The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Tuesday, February 16, 2010

A point about Bookmarking view activity in ADF 11g

Few days back I was trying to implement bookmarkeble view activities in my ADF 11g app. This is quite easy. The only condition is you can bookmark only the view activities of a unbounded task flow. To enable bookmarking you can select the bookmark property to true of a view activity in the unbounded task flow.

One interesting thing to note down is the method attribute with the bookmark property. You create a method in a managed bean and provide it here. So, whenever someone pastes/types the url in browser this method gets invoked giving you the opportunity to update model or set values in pageflowScope or other scopes which might be needed to render the page properly.

But, remember this method will not be called when user navigates to this page from another page by adfc navigation. So, a question arises is how to do the required stuff in such cases which happens through the initializer method. What you can do to resolve this is you can expose your bean as a Data Control and then drop the same method in the unbounded task flow as a method activity. So, instead of directly navigating to the bookmarked activity, navigate to the method call. This way it will be ensured that desired page parameters/model is initialized.
Post a Comment