Passing data from table to form in subwindow and update table

Hello
I have very litlle time to finish my project and from week i struggle with passing data between table and form in subwindow.
I set data in table with


setContainerDataSource(ProducerContainer.getProducerList());

now when i double click on row i want subwindow come out with form with selected data in it, then i want modify data and update table when changes approved.
I can try pass selected data with


addListener(new ItemClickListener(){
	public void itemClick(ItemClickEvent event) {
		if(event.isDoubleClick()){
 

to subwindow with


getWindow().addWindow(new ProducerSubwindow(event.getItem()));

and from subwindow to form, but then how can i update table when changes made changes?

Personaly i think binding data to components and passing and updating it between components in vaadin is pure nightmare and should been alot more documented :confused:

It should be quite easy. You should have a callback or you could just pass your application as a parameter to your subwindow.

Example:
getWindow().addWindow(new ProducerSubwindow( Application app, event.getItem()));

And in your ProducerSubwindow you have a method like



 onSaveBtnClick(){
   app.update( obj);
}

I hope this is clear. You could check http://www.javaworld.com/javaworld/javatips/jw-javatip10.html to see how you could implement a callback.