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

Friday, April 1, 2011

Design standard for Page Templates and Sub flow calls in ADF 11g

ADF 11g provides effective ways of reducing development time by allowing to create page templates. So, a typical example of a page template is say your organization app has 20 pages and all having same header and footer (or at least same layout). Now to avoid repetition of designing or copy/pasting manually in all 20 pages you can simply create a page template and use it while creating your pages. Page templates are much more powerful than what I said above as it allows you to keep dynamic data as well. But lets understand it this way as the focus of this post is different.

When a Task Flow call is made from a page fragment which is inside a task flow then the Task flow being invoked is referred as Sub-flow. The design diagram usually represent it by a task flow call activity. So, one of the most typical mistake I have seen people doing in ADF world is wrong way of using the page template in the sub-flows.  You must make sure that if the parent flow is using a page Template A (say with two areas header and content area) then you must not use the same template Template A in any of the page fragment of the sub-flow. The simple obvious reason is: in that case the page fragment of subflow having Template A will be embedded in the parent task flow page fragment. Visually, It is like:
So, what is the right way? Well in case of sub flows you should only use the page Template A in the parent task flow's page fragments. For the subflow page fragments there should not be any page template or there should be another page Template B which is only the content part of the template A.

So, in other words you should create a page Template B with only content part of Template A. And then you should create another Template A with only header part and in the content area including template B. So, for parent flow page fragments Template A should be used and for sub flow page fragment's Template B should be used.

No comments: