Keep the Table row selected as the table view is selected again

Hi

I have a view which contains a table and a footer. Footer has various buttons to show different view. These buttons act as links to diffrent views.The user is allowed to navigate to different view once a table row is selected(i.e. The Footer buttons are enabled on Table row selection). Now the requirement is that once the user comes back to the Table view i want the table row as is selected earlier to be displayed as it is selected(i.e. with selected background colur for the entire table row). Currently

table.getValue() returns the previously selected item but the colour remains as though the row is not selected.
Is there any vaadin way of achieving this. My Table uses column generators for genrating columns.
I have searched for this in the forums but could not find anything

Any Help 8o

The selected row should be exactly the same as what Table.getValue() returns. Sounds like either you have found some sort of bug, or then you are referring two different instances of a table. Could you try to isolate the problem to a very minimal, separate application. If you can still produce the problem with just a few lines of code, post the code here.

Apologies i was totally off guard with this. Actually we are using the MVP Pattern to render the Table view. The base Application was creating a new instance of the view
every time the view gets changed. So a totally new table was getting created every time view changed.

Now I am Caching the Table inbetween views so that when the table view is called i would retireve the same table from the Cache and display it. Now i am facing a new problem. We also have a refresh button in the page header. when the user clicks the refresh button i would retrive the data again and populate the table so any updates at the backend are visible to the user. The problem is If the Table row is selected and i click the refresh button the same pirticular row that was selected shows as being selected. I am posting a portion of code what i am doing.

refresh button click

if(event.getButton().equals(display.getHeaderComponent().getRefresh())){
Date refreshDate = (Date) display.getHeaderComponent().getDatetime().getValue();
updateView(refreshDate);
}
updateView

public void updateView(Date selectedDate) {
    display.updateDate(selectedDate);
    List<DailyTask> tasksInDate = fetchDailyTasksByDate(selectedDate);
    refreshCache(tasksInDate);
    display.updateTableData(tasksInDate);
}

updateTableData

public void updateTableData(List<DailyTask> tasks) {
	if (tasks != null) {
		dailyTasksTable.enableContentRefreshing(true);
		dailyTasksTable.removeTableData();
		dailyTasksTable.refreshRenderedCells();
		for (final DailyTask task : tasks) {
			dailyTasksTable.addBean(task);
		}
	}
}

I use BeanItemContainer to add beans inside my table class.

public void addBean(final DailyTask taskbean) {
    container.addBean(taskbean);
} 

I think it is because the data is not changed i am getting this issue. So on Refresh the selected row should get deselected.

If you change the container, then the selection should at least be removed, as the same object (memory position) does not exist anymore. If you do minor changes to the used container and the selected item doesn’t get changed, then the selection will remain intact. You can of course always change this behaviour by calling select(null) to remove selection or select(lastSelectionfromGetValue()) to keep the same selection after container change.