Help!how to obtain the row-index in talbe component

how to obtain the row-index which i selected from the talbe component
[76 byte] By [wtuwfnh] at [2007-11-26 9:20:41]
# 1

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";

}

LuckOfTheIrish at 2007-7-6 23:52:08 > top of Java-index,Development Tools,Java Tools...
# 2

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

jetsons at 2007-7-6 23:52:08 > top of Java-index,Development Tools,Java Tools...