210 total views, 1 views today

Create an ADF TreeTable Programmatically

Using the class ChildPropertyTreeModel, we could create ADF treetable programmatically . The constructor of this class expects two parameters, first is a ‘list’ and later is a child property of the list. In the following section, I have shown an example of creating a treatable from a bean class. I have used dog breeds by the country of origin to show the hierarchy of tree table


Dog Breed

Dog Breed

>> Country

Dog Breed

Dog Breed

IDE Used: JDeveloper 12C


1. Create a Fusion Web Application: Click File >> New >> Application >> ‘ADF
Fusion Web Application’ > > Ok >> Input Application name >> Click Finish

2. Create a JSF File with a Managed Bean: Expand the View Controller >> Right click on the Web Content >>
Select Page >> Input a file name index.jsf , Select the Managed Bean tab and enableAutomatically Expose UI Components in a Managed beans >> Click Ok

3. Create a country bean class to hold the country wise dog breeds under the Application sources

4. in the bean class, create an arraylist to store the dog breeds and save the list in ChildPropertTreeModel.  The bean class is below

5. Drop a treetable from component inside the form elemenr in index.jsf. Refer the bean ChildPropertyTreeModel object as a value in treetable.

6. To add a column to the treetable, Go to the structure panel, Right click on the treetable and select Column as shown below. Drop the component OutputText inside the column. Refer any bean property as value

062516_1909_Programatic1 create an ADF TreeTable Programmatically

7. The final TreeTable element is like below

Deploy & Run the Application

1. Right click on the index.jsf and click Run

2. The Page loaded in browser and looked like below

062516_1909_Programatic2 create an ADF TreeTable Programmatically


Download the Project: TreeTabke

govindan create an ADF TreeTable Programmatically
Connect me


Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

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

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply šŸ™‚
govindan create an ADF TreeTable Programmatically
Connect me
Like us on Facebook.