tutorials doesn’t exist, but I might write one this or next week - if yes, I will keep you updated.
related to your issue, you can’t fetch data from DB like that, for it will cause big performance problems. Please have a look at https://vaadin.com/directory#addon/lazy-query-container. I am sure this is what you are looking for.
First I would like to thanks Vaadin team for their work and also ondrej who seems to maintain the grails vaadin plugin.
I’m studying the vaadin offcial tutorial and almost everything is working well.
My problem is that I didn’t succeed in storing my changes into the database.
in this step : https://vaadin.com/tutorial/-/chapter/interaction.form.html the commit method is required to persist the container.
My problem is that I have ConcurrentModificationException on commit https://vaadin.com/forum/-/message_boards/view_message/1164562
I’m a little bit lost and any help would be appreciated
public class PersonContainer extends BeanItemContainer<PersonModel> implements
Serializable {
public PersonContainer() throws InstantiationException,
IllegalAccessException {
super(PersonModel.class);
addAll(PersonModel.list());
}
}
As I run the app, I can see all my persons created in the bootstrap.
I can create a user from the interface without any bug and it is updated in the List (One bug corrected)
BUT
The new line is not stored into the database. Must I made a kind of flush? Override the commit() method?
Data from container are not automatically saved into the database. You have handle that event manually. So, you have to create a listener and add this listener to a button. It might look like this:
class SaveListener implements ClickListener {
void buttonClick(Button.ClickEvent event)
// TODO: create your instance of person.. e.g. Person p = new Person(....)
// TODO: p.save(flush:true, failOnError: true)
}
}