Instead of populating the data in af:table through model layer (using ViewObject) using buinding layer, in this article we will introduce how to show the data which is in the managed bean to show on UI in tabular format.
First you should know the number and data type of columns in table, suppose I have to populate a table for person details (name, mobile number and salary). To get and set value of columns I have created a java bean class, it has 3 variable for 3 columns.
Next step, create a managed bean for referencing af:table , this managed bean makes use of person java bean class to add data in same format for all table rows. A List data structure is used to pass all values in af:table.
ProgTableBean.java
//ArrayList to poplate data in af:table
List<Person> personList = newArrayList();
//To Populate default row in table (Code in Constructor)