Table Model Update without Save button, OSX style...

Hi Vaadin

For the last days I have been trying to make a table application that works without a save button.

I would like to update fields and get an event for each update to each field when the field is left.

This works with simple fields like CheckBox using setImmediate(true)

I just cannot make it work with a table.
I have tried every event, etc, but I get empty for new ideas of how to do it.

I am using BeanItemContainer to produce the content (from JPA)

It works pefect when I use a save button … but I just don’t want this button
Save buttons It is not the way Apple does it …:wink:
Therefore I would like to avoid it.

What can I do?

Best regards
Anders

Did you set the immediate property of the components of the table (not only of the table itself)
and then listen on th events of the vomponents of the table.

I remember seeing save/ok buttons on the fruit desktop…

Agree, I believe this is the way to go… I have in the meantime found a solution where the Tables field factory is changed to use


    /**
     * Custom field factory that sets the fields as immediate.
     */
    public class ImmediateFieldFactory extends DefaultFieldFactory {
        @Override
        public Field createField(Container container, Object itemId,
                                 Object propertyId, Component uiContext) {
            // Let the DefaultFieldFactory create the fields
            Field field = super.createField(container, itemId, propertyId, uiContext);
            // ...and just set them as immediate
            ((AbstractField) field).setImmediate(true);
            return field;
        }
    }

By setting this factory the table starts sending event as wanted…