Vaadin Grails Plugin

Hi Nicolash,

you might want to upgrade to latest version of plugin here: https://github.com/ondrej-kvasnovsky/grails-vaadin-plugin/downloads

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.

If you have problems with vaadin add-on installation, if yes - here is the tutorial: http://ondrej-kvasnovsky.blogspot.com/2011/08/how-to-add-vaadin-add-on-into-grails.html

Hy,

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

regards

Well,

I restarted from scratch :
1 - Download the tuto project
2 - Create a grails project with your plugin
3 - Adapt the model with a domain class :


package com.vaadin.demo.tutorial.addressbook.data

class PersonModel extends Person{

    static constraints = {
    }
}

Then


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?

Regards

Is anybody already had some persistance problems with grails?
Regards

Hi Thomas,

I wrote a tutorial that could help you. It is about connecting Vaadin with Grails. Could you please go step by step through this one:
http://ondrej-kvasnovsky.blogspot.com/2012/03/vaadin-and-grails-part-i-hello-world.html
and let me know if that helped you? If not, please state what version of grails, vaadin and plugin do you use.

Ondrej Kvasnovsky

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)
 }
}