jQuery in Action, 2nd edition
The moose likes JSF and the fly likes DataTable row selection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "DataTable row selection" Watch "DataTable row selection" New topic
Author

DataTable row selection

Peter Braun
Ranch Hand

Joined: Feb 09, 2005
Posts: 57
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

Joined: Dec 12, 2005
Posts: 58
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


SCJP 1.4, SCWCD 1.4, SCBCD 5, OCUP, SCEA 5 (I), Oracle SOA Implementation Specialist, IBM Websphere Lombardi 7.1 Fundamentals
Blog: [url]http://www.leozin.com.br/blog[/url]
Peter Braun
Ranch Hand

Joined: Feb 09, 2005
Posts: 57
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

Joined: May 25, 2006
Posts: 36
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?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: DataTable row selection
 
Similar Threads
datatable contents not updating
how to get index value of datatable
Problem with selecting checkboxes in subTable
How to show a panel or any other GUI object in OpenFaces 3.00 Datatable upon row selection?
Adding a Datatable as a row in another Datatable