Monday, November 2, 2009

How To Make Declarative Component

Declarative Component is used to build a reusable UI component. You can design your own component using ADF Faces Component. To establish declarative component follow this Steps :
1- Make a new ADF Application.
2- In ViewController Project, right click in a web content folder -----> new.
3- In Web tier -->JSF--> JSF Declarative Component.
4- Enter Declarative component name (e.g. UserInfo) and package.
5- Define a tag library name. This tag library name will be the name of the library in which the component will be stored and is the name you will see in the drop down of the component palette when you use the component.
There is a facet Definitions - Attributes – Methods. You can define any of these
depend on your component. Assume we want to make a component for user
Information it contain a three text as name, Address and telephone and one toolbar that
can manage user to add any button to do any action. In this case we need one facet to
add in the toolbar and three attributes then press Ok.
6- Drag and Drop af:panelBox in the page and set its Text to User Information thin in panelBox toolbar facet drag af:facetRef and choose your facet.


7- Drag af:panelFormLayout and insert inside it a three inputText and set its label to Name, Address and Telephone.












8- In the af:inputText (Name) edit the value by choosing Expression Builder then from JSP Object choose attrs then Name.
9- Repeat this Steps to af:inputText (Address) and af:inputText (Telephone).
10- In ViewController Project right click then choose Project Properties.
11- Choose Deployment then press new.


12- In Archive Type choose ADF Library JAR File and Enter the name of Jar as (UserInfoJar) then press Ok.





13- In ViewController Project right click then choose Deploy -->UserInfoJar-->To ADF Library JAR.






14- In Recourse Palette -> New Connection -->File System.

15- Enter A connection name and the path of your JAR file then Press Ok.

16- To use this component at any project open the project and go to Resource Palette and right click on the UserInfoJar.jar file then choose Add To Project then press to Apply Library.




17- Now go to Component Palette you will find your UserInfo Component.

You Can Download the declarative component example from this link :

No comments:

Post a Comment