the following code I use gets the rowid and then uses this to get keys
the rowkey is the object that does the work..
public String btnEditVisit_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
String ID="";
int pID=0;
//Get the selected row
RowKey rowkey = this.getTblVisitsRows().getRowKey();
//Get selected row for highlighting
getCurrentSearch().setSelectedRow(rowkey.getRowId());
//Get VisitID
ID=getSessionBean1().getVisitsDataProvider().getValue("visitID", rowkey).toString();
pID=new Integer(ID).intValue();
String buildingID=getSessionBean1().getVisitsDataProvider().getValue("buildingID", rowkey).toString();
int bID=new Integer(buildingID).intValue();
getSessionBean1().refreshListsByBuilding(bID);
//Get visit and guests based on visitid
getSessionBean1().setGuest(new CurrentGuest());
getSessionBean1().getVisit().setVisitID(pID);
VMSApplicationService.getInstance().getVisitByID(pID);
VMSApplicationService.getInstance().getGuestsForCurrentVisit(pID);
return "Browser_Visit";
}
Some other code examples can be found at:
Code sample 5 in http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/ins erts_updates_deletes.html
http://blogs.sun.com/roller/page/divas?entry=radio_buttons_in_tables
http://blogs.sun.com/roller/page/divas?entry=iterating_through_table_data
http://blogs.sun.com/roller/page/divas?entry=links_in_tables