The moose likes JSF and the fly likes dataTable onclick Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "dataTable onclick" Watch "dataTable onclick" New topic

dataTable onclick

Paolo Pinkel
Ranch Hand

Joined: May 04, 2011
Posts: 35

In a form, I have a dataTable and I have some inputFields that do not belong to the dataTable.

I'm looking for some "onclick" behavior: If the user clicks on a row, the values of that row should be made available in the inputField, preferably using ajax.

I'm using JSF 2 (MyFaces) with Tomahawk. I would prefer a solution that doesn't need additional libs.

Does anyone know if there is some way to achieve this?

Thank you!
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

You could render the text in the data table fields as command links.
Paolo Pinkel
Ranch Hand

Joined: May 04, 2011
Posts: 35
Thank you, that did the trick!
Consider Paul's rocket mass heater.
subject: dataTable onclick
It's not a secret anymore!