• Post Reply Bookmark Topic Watch Topic
  • New Topic

h:dataTable - swap rows  RSS feed

 
Jolie Lee
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can i swap rows in dataTable?

for eg this is my datatable:
CheckBox Level User
1 Fanny
2 John
3 Cindy
4 Ken


when i checked on level 1 & 3, it'll automatically swap and become:
CheckBox Level User
1 Cindy
2 John
3 Fanny
4 Ken

is there anyway i can do this? or anybody has any better suggestions to do swapping?
 
g madhava
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it can be done. Have a value change listener attached to your check box component, then rearrange the arraylist holding the reference for the DataTable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!