Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSF and the fly likes dataTable that each row links to a different page that displays information related to selected row Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "dataTable that each row links to a different page that displays information related to selected row" Watch "dataTable that each row links to a different page that displays information related to selected row" New topic
Author

dataTable that each row links to a different page that displays information related to selected row

Elico Av
Greenhorn

Joined: Dec 19, 2010
Posts: 6
Hi All,

I am looking for a way to achieve page navigation on request scope to display information on user.

I want to display on one page (backing bean 'BeanA' - page request) - this page displays a list of users (their name and email and a link row), I want that when clicking on a link a new page opens that has it's own bean (BeanB - request scope) and to tell this bean that user_id X was selected - something similar to /user.jsp?userid=X

If I register the bean (BeanB) on session scope I can always set the user id and then return the action string that navigates to my page.
The problem starts when the bean is a page request.
Assume that each link on each row return the action string that navigates to the other page,how can I forward the user-id parameter?

I am breaking my head with this, and currently I made it old fashion, I am using a link with the parameter in the query string, and then I read it from the request on the constructor of BeanB - but I would like to use the h:commandLink and the JSF navigation.

Thanks in advance for your kind answers.

Best Regards,
Elico.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14487
    
    7

Welcome to the JavaRanch, Elico!

I can't stand apps that pop up new windows myself, so I don't have a lot of practice doing this, and for simpler apps, there's no need to provide a parameter, since the commandLink already can tell which item you wanted based on what row in the table you selected. However, what I think you want is to place an <f:param> sub-element under the commandLink.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
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 that each row links to a different page that displays information related to selected row
 
Similar Threads
Get the action value from a commandButton in a managed bean
Passing values b/w beans through navigation
Providing anchor to columns in a datatable
h:commandLink will not work inside a h:dataTable
navigation problem from main menu