Table getValue return always null

Hi forks,
I encounter a situation when click to a row in the table component, then a Property.ValueChange event is trigger and catch by the Property.ValueChangeListener .
In the event handler function, I use Object rowId =event.getProperty().getValue(); to obtain the rowId however, it always return me the null value.
I have tried and searched the forum, I need help, any suggestion will be appreciated.
Best regards,

The code of the table is list as following:
babyList = new Table();
babyList.setCellStyleGenerator(new Table.CellStyleGenerator(){

		public String getStyle(Object itemId, Object propertyId) {
			Item item = babyList.getItem(itemId);
			int event = (Integer)item.getItemProperty(ORDER_BABY_EVENT_PROPERTY_ID).getValue();
				case 1:
					return "red";
				case 2:
					return "red";
				case 3:
					return "red";
				case 4:
					return "red";
				case 7:
					return "yellow";
				case 8:
					return "yellow";
				case 9:
					return "blue";
					return "white";						
	babyList.addListener(new Property.ValueChangeListener() {
	    public void valueChange(ValueChangeEvent event) {
	    	 //Object rowId = babyList.getValue();
	    	Object rowId =event.getProperty().getValue(); 
	    	if(rowId == null)
	    		 System.out.println("rowId == null");
	    	if(babyList.getContainerProperty(rowId,ORDER_BABY_OBJID_PROPERTY_ID) != null)
	    		Long objid = (Long)babyList.getContainerProperty(rowId,ORDER_BABY_OBJID_PROPERTY_ID).getValue();
	    		String name = (String)babyList.getContainerProperty(rowId,ORDER_BABY_NAME_PROPERTY_ID).getValue();                
	    		JSONObject output = new JSONObject();
            	output.put("objid", objid);
            	output.put("name", name);                
            	BabySelectedEvent _event = new BabySelectedEvent(output.toString());
	    		System.out.println("babyList.getContainerProperty(rowId,ORDER_BABY_OBJID_PROPERTY_ID) == null");


I did not fully understand your code but i think you mixed some things. A ValueChangeListener do not react on table click - use ClickListener instead. Furthermore event.getProperty().getValue() may not return the rowId - it returns a cell value.

Thanks for your reply,
In Vaadin table, when I set the table is select-able, every click on the cell will highlight the whole row.
And in theory, I can use the getValue method of the Table to obtain the rowId (I learn from the book of vaadin []
In the Vaadin book, it said we can handler the select event by using the Property.ValueChangeListener.
But I just can get the rowId from table getValue method.
Best regards,

It should work and in fact a simple example I tried with Vaadin 6.7.2 works just fine. What version are you using?

6.7.2 in liferay