Friday 10 June 2011

JSF datatable: component binding or value binding?

If you just need to show rows of eg links..where you don't want to know which row you access use value binding.

If you want to know the row you have selected then use component binding. This way you don't have to declare one more property in the backing bean for the selected entity (row).

Eg component binding:


#{user.id}



private UIData usersData; //getters/setters
User user = (User) usersData.getRowData(); //get selected entity (row)

Eg value binding:


#{user.id}



No comments:

Post a Comment