Saturday, June 4, 2011

ADF GUI : Create Page Template for ADF Application

 

When you develop application using any technology whether html , asp , jsp , jsf , ADF our first priority is to have as a many reusable component we can have to maintain the consistency in application.

ADF provide us ADF page Template , ADF Declarative Component to achieve reusability , but here we will focus only on page template. After creating page template , we can create page based on page template to maintain look and feel consistency.

ADF Page Template

1. Create page template

image

2. Create custom layout or use in build layout , I would choose in build layout as it satisfies most of our requirement.

image

When you don’t select layout check box then you have to manually design the page by arranging all ADF layout component as shown in next to next diagram.ADF Layout component for custom layout for page template

image

For in build in layout click browse and select the layout.

image

After selecting build in layout , create facets for various page area like footer , header , content , menu , side , left etc..

It is important to create facet to drop your content to be visible on GUI.

So I created four facet footer , menu , header , content.

image

let say you want to use this template for multiple customer then you have to provide different footer , header that consist of client details.  In that situation you have to go to attribute tab and create as many attribute you required ,so that you can utilize this attribute to pass different client information for personalization.

image

So I gave client name , client address , client phone that will be changed for each client login.

We need to associate facet with facet reference. I dragged the facet reference from component to middle section where I will put my major content  and associated it with facet content.

image

Same way we can associate facet with facet reference.

Now I dragged output text in footer and associated attribute client address with it.same way we can do it for other attribute.

image

If you click the source in page template you can see whole definition.

< af:pageTemplateDef var="attrs"

</af:pageTemplateDef>
</jsp:root>

Create Page based on Template

Now let us create the page based on this template and have a view.So I created jspx page with our template.

image

I created the page based on template and you will notice that we can see facet automatically available in new page where we can put our content.

image

I just dragged my region here.

image

Also for attribute which I mandatory we have to provide the value.

image

So this attribute value will be utilized on page that is using the template.

Let us run the page. I have not done good formatting , but I have tried to give you best technical details about using page template.

I ran the page and it showed me both taskflow and attribute title that I supplied.

image

1 comment:

  1. Hi, I was creating adf page template with data control. then I deploy to adf library jar file with recommended setting. The page template with data control jar worked into same application when use data control page template. But External application import current template jar then didn't work here. I thinks it is because of Data control into page template!!! while weblogic application compile follow message show on log.

    Failed to create connection for {/example/jedi/model/common/}ExampleModuleService


    Failed to create connection for {/example/jedi/model/common/}ExampleModuleService


    What about this error? How to use page template with data control for external application?

    thanks juddi

    ReplyDelete