Create ADF tree table programmatically with checkbox selection

Home/ADF/Create ADF tree table programmatically with checkbox selection

Create ADF Tree Table programmatically with checkbox selection

The following lines are detailed in this following section

1. Create ADF tree table programmatically

2. Adding checkbox to the ADF Tree table

3. Style ADF Tree table

4. Access the selected row data in ADF Tree table

Download the ADF TreeTableApp.

IDE Used:

JDeveloper 12.1.3

Create ADF Tree Table Programmatically

  • Create ADF Fusion web application: Go to File >> New >> Gallery >> ADF Fusion Web Application
  • Create a JSF page in the view controller with a backing bean: Right click on the view controller > >Select page >>Enter index.jsf

    072216_0412_CreateADFtr1 Create ADF tree table programmatically with checkbox selection

  • Create an Employee bean like below, Notice the below code, I have added a Boolean variable called status. This variable acts as a check box in the treatable. Default value of the Boolean variables is false, so all the check boxes remain disabled by default

  • Construct the backing bean like below. Here I have constructed the Tree table hierarchy like Manager >> Lead >> Employee

 

  • Open the JSF page and drop a tree table component from the component palette. In the popup select ‘Bind Later’, value as 2 and Click Finish

 

072216_0412_CreateADFtr2 Create ADF tree table programmatically with checkbox selection

ADF Treetable programatically

  • Add inlineStyle property like below to all the column element. The inlinestyel property tells the ADF that when the role is Manager, then background color is thick yellow (#ffff99), if the role is ‘Lead’ then the background color is yellow (#ffffcc). Otherwise, it will be light yellow (#ffffe6)

  • Let’s create a checkbox column with little customization. Drop a selectBooleanCheckbox to one of the columns and add the following render property. The render property tells the ADF that don’t display checkbox for manager and lead

 

  • Add a command button to the JSF page.
  • The final JSF page will look like below

 

  • Double-click on the command button to create an Action method. Input the following lines of code in the action method to access the selected rows

 

  • Run the application in WebLogic server. The JSF page will display like below
072216_0412_CreateADFtr3 Create ADF tree table programmatically with checkbox selection

ADF Treetable programatically

Now select come checkboxes and click the submit button.

072216_0412_CreateADFtr4 Create ADF tree table programmatically with checkbox selection

ADF Treetable programatically

Console displays the following output

072216_0412_CreateADFtr5 Create ADF tree table programmatically with checkbox selection

ADF Treetable programatically

govindan Create ADF tree table programmatically with checkbox selection
Connect me

Govind

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 ADF tree table programmatically with checkbox selection
Connect me
  • ram katakam

    good post your blog is very useful to learn on ADF.. bookmarked this blog

    • Govindan Padmanaban

      Thankyou.

Like us on Facebook.
Connect!