Monday, February 20, 2017

Creating Editable Table in ADF


Creating Editable Table in ADF


In this article, we will learn how to create editable table in ADF. We will be using HR Schema’s Employees table.

STEP-1 : CREATING APPLICATION AND PROJECT
     
1.Create an application, by clicking File->New->Application



2.    Select “ADF Fusion Web Application”



3.    Complete the wizard by giving application name as “EditableTblAppln”, let defaults remain for project details. Enter desired default package name.

STEP 2: CREATING MODEL AND VIEW OBJECTS

1.    Right click on “Model” project, select New->Business Components from Tables…


2. Create new Database connection, by entering details



3.    Select “Employees” table in the wizard



4.    Create “Entity-based View Object” as “EmployeesView”, as shown below, do not change default values in further steps :-

STEP 3:  CREATING PAGE

1.    Right click on “View Controller” project and click New->Page…



2.    Give page name and select required layout
3.    Drag “EmployeeViews1” from “Data Control” and drop on to the page, Select “Table/List View->ADF Table…”





4.    Select “Selection” as “Multiple Rows” as shown in below screenshot:-


5.    Select the table in JSF page and edit the properties as shown in below screenshot for enabling page navigation in the table and for displaying 10 rows in one page.

6.    Change ScrollPolicy to “Page”



7.    Range Size to 10, for displaying 10 rows in one page, default is 25


8.    Create 3 buttons for “Create Employee”, “Delete Employee” and “Save Changes”

9.    Set binding for each of this buttons, click on “binding” button in button properties



10. Select “CreateInsert” under “EmployeesViews1”



Similarly repeat the steps by defining the binding for “Delete” button.
Similarly repeat the steps by defining the binding for “Save Changes” button, select “Commit” available under “AppModuleDataControl->Operations”


11. Run the page and see the output.







1 comment: