newbie question on datatable value binding

This just cannot be this difficult.

I'm a little new to JSF and am still learning the the ins and outs of using a datatable to hook into a database. Thus far I've connected to the DB, selected a range of values, and displayed them. Now I want to set something up where the user clicks on one of the returned values and sees details about it. This will involve passing that item's value back to the bean and hitting the database again to get additional details. The data is just returning the "name" and "id" fields from a table, and I want to go back and show all of the details for that "id". Do I need to do a bind on the datatable? Is it necessary to set up a datamodel? I'd be happy to get an RTFM response here if someone can just point me to the right info.

Here's the datatable:

<h:dataTable value="#{fieldview.all}" var="farm">

<h:column>

<f:facet name="header">

<f:verbatim>Farm ID</f:verbatim>

</f:facet>

<h:outputText value="#{farm.farmid}"/>

</h:column>

<h:column>

<f:facet name="header">

<f:verbatim>Farm Name</f:verbatim>

</f:facet>

<h:outputText value="#{farm.farmname}"/>

</h:column>

</h:dataTable>

And here's the method that is populating the table:

public Result getAll()throws SQLException, NamingException{

ResultSet result =null;

try{

open();

Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,

ResultSet.CONCUR_READ_ONLY);

result = stmt.executeQuery("SELECT username, farm.id as \"farmid\", name as \"farmname\" from farm");

return ResultSupport.toResult(result);

}finally{

close();

}

}

I'm afraid I'm a little stuck on where to go from here, any help would be much appreciated.

Thanks a lot,

Alex

[2481 byte] By [bitterhoneya] at [2007-10-3 9:16:51]
# 1
If i understood correct, you want to have a link on every record returned and that link displays details page?
amitteva at 2007-7-15 4:29:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Yes, that's exactly what I'm after. Is there a Right Way to set that up?> If i understood correct, you want to have a link on> every record returned and that link displays details> page?
bonemachinea at 2007-7-15 4:29:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Check http://balusc.xs4all.nl/srv/dev-jep-dat.html how to use datatables :)
BalusCa at 2007-7-15 4:29:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
This looks like just what I need, thanks a lot.
bonemachinea at 2007-7-15 4:29:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...