Can anyone helpout on how to bind a List object to a datatable
843844Jan 20 2008 — edited Mar 17 2008I've have used 4-5 days to search and tried different ways to add rows to a table without using a litteral database table. There have been examples but with old versions of JSF or some other points not clearly pointed out. The closest I've got is to.
I use one class that keep values;
package Users;
public class UserNames {
private String name;
private int uid;
public UserNames(int UIDx,String namex){ //Instance of the class
name = namex;
uid= UIDx;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
}
I use a Bean call it UserBean to save values and references the UserName class.
private List<UserNames> unames;
then in a function with a for, I fill them
unames.add(new UserNames(Integer.parseInt(val1),val2);// i fill instances of the UserBean with different values.
I know how to bind the table object to each other. example table.getChildren.add(rowGroup); etc Many examples using ValueBinding that is out of date.
Then, how to make a simple reference for this dataprovider and instance method to bind rows and fields.???