• Post Reply Bookmark Topic Watch Topic
  • New Topic

DataTable row selection  RSS feed

 
Peter Braun
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I have a simple problem but I'm a beginner in JSF so I couldn't solve it.
I have a DataTable with a link (or a button) on each row. If the user clicks on it, I would like to show the details of the selected row on an other page.

My problem is I can't pass the id of the row to an action. Actually I don't know how to do that, or what is the good solution.

I know it must be a very basic problem, but I didn't find any examples or tutorials which show how to do this particular thing.


Thanks in advance,
Peter
 
Leonardo Rafaeli
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey peter

take a look in this thread

http://www.coderanch.com/t/213290/JSF/java/Why-JSF-calls-method-parameter

This example shows exactly how you can pass the rowIndex or whatever you want to you action/actionListener method
 
Peter Braun
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help!

Recently have I found some good example related to table row selection in this book:
JavaServer Faces By Hans Bergsten: Chapter 10 / Processing Row-Specific Events
http://www.oreilly.com/catalog/jsvrfaces/toc.html

It helped me, so I thought it's worth considering.

Thanks again.
Peter
 
Ian Dunsirn
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to do something similar to the original poster. How would you apply the information in Leonardo's response to get the original poster's intended results?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!