We have several tables in an application that have buttons in rows. In Vaadin 6 we did that by using TableFieldFactory, but since Button is no longer a Field we cannot use a Button to return in getField() method.
We are investigating to solve that. If anyone had the same problem and has found a solution we will like to know.
Here is a sample of what we do:
TableFieldFactory chkFF = new TableFieldFactory() {
@Override
public Field createField(Container container, Object itemId, Object propertyId, Component uiContext) {
Field f;
if ("buttonField".equals(propertyId)) {
Button bt = new Button();
bt.addClickListener(new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
// Do something
}
});
f = bt;
} else {
f = DefaultFieldFactory.get().createField(container, itemId, propertyId, uiContext);
}
return f;
}
};
Thank you in advance.