Vaadin get the table contents into a Map

So I am kinda new to Vaadin, and already went through their book. My question is about an editable table and how to get the values out of it when it is changed.

So basically what I have is a simple table and I fill this with a HashMap as following:

final Table tableMetadata = new Table();
tableMetadata.addContainerProperty(“metadata key”, String.class, null);
tableMetadata.addContainerProperty(“metadata value”, Object.class, null);

for (String k : myHashMap.keySet()) {
Object obj = { k, myHashMap.get(k) };
tableMetadata.addItem(obj, new Integer(i));
i++;
}
And my UI looks as attached.

So edit buttons make the fields editable, and add line button adds a line. The implementation is straightforward. But what I did not manage is to update button, because when I add a line or edit some field I want to get back all the keys and values into my hashmap again and do sth with that. Any ideas on that?
13001.png

I answered my question here: http://stackoverflow.com/questions/16722298/vaadin-get-the-table-contents-into-a-map

In case someone encounters in future…

You could take a look at Map Container (
https://vaadin.com/directory#addon/mapcontainer:vaadin
), an add-on I wrote that serves as an adapter between HashMap and Vaadin’s Container. It is far from perfect, but it should at least get you started. It has not been used by anyone, so I could use some feedback if you find it useful. Feel free to raise any issues you have with it.

Cheers,
Miki.