Getting selected item from IndexedContainer

Firstly I am a complete noob to vaadin. I have read the book of vaadin related to tables, indexedContainer etc but it confuses me more than it helps me. Firstly I create a table and IndexedContainer like so:

Table tbl_searchResults = new Table();
ic = new IndexedContainer();		
ic.addContainerProperty("ID", String.class, null);	
ic.addContainerProperty("Name", String.class, null);
ic.addContainerProperty("Surname", String.class, null);
ic.addContainerProperty("Age", String.class, null);		

I then bind some data to the IndexedContainer like so:

ArrayList<Object[]> searchResult = Site.searchSite(searchTerm);
for (int i = 0; i < searchResult.size(); i++) {
    Object id = ic.addItem();				
    ic.getContainerProperty(id, "Name").setValue(searchResult.get(i)[2]
    ic.getContainerProperty(id, "Surname").setValue(searchResult.get(i)[3]
    ic.getContainerProperty(id, "Age").setValue(searchResult.get(i)[4]

And bind the IndexedContainer to the table like so


So what I want to know now, is when you select a row in the table, e.g. (clicking on a row in the displayed table) how to you get the value of ‘ID’ if it’s been hidden?

Object itemID = tbl_searchResults.getValue(); Item item = tbl_searchResults.getItem(itemID); String IDcolumnvalue = item.getItemProperty("ID").getValue();
API Reference Select.getValue()

Another way would be to use the ItemClickEvent:[code]
table_searchResults.addItemClickListener(new ItemClickListener(){

public void itemclick(ItemClickEvent event){
Item item = event.getItem();
String IDcolumnvalue = item.getItemProperty(“ID”).getValue();

[/code]I wrote this code without an IDE so there might be syntax errors in there.