You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by John Mani <jm...@comverge.com> on 2006/06/07 09:16:24 UTC

Selections in DataTable help

I am using a Datatable to display a list of items. I also have a set of textfields in a panel below
to display details about the selected item.
 
I want to populate the textfields when the user clicks on an item in the datatable. Any suggestions
on how to do this? I am assuming I need to install a rowClickHandler javascript on the
datatable, but am not sure about the details.
 
Any help appreciated.
-jm

Re: Selections in DataTable help

Posted by Jeff Bischoff <jb...@klkurz.com>.
First, please see [1] my post on this archive thread so I don't have to 
repost my example code:

[1] http://www.mail-archive.com/users@myfaces.apache.org/msg22166.html

Now, where I have in the example:
	
	<h:commandLink action="">

In my actual application, this is really:

	<h:commandLink action="#{navigation.reload}">

I use that to reload the bottom portion of the page (which contains 
details about that particular row). This works becauuse the 
<t:updateActionListener> has already updated the current row value in 
the relevant backing bean.

No need to write your own javascript for this one, let JSF handle the 
heavy lifting! :)

Regards,

Jeff Bischoff
Kenneth L Kurz & Assoc, Inc.

John Mani wrote:
> I am using a Datatable to display a list of items. I also have a set of 
> textfields in a panel below
> to display details about the selected item.
>  
> I want to populate the textfields when the user clicks on an item in the 
> datatable. Any suggestions
> on how to do this? I am assuming I need to install a rowClickHandler 
> javascript on the
> datatable, but am not sure about the details.
>  
> Any help appreciated.
> -jm