Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Vaadin Grails Plugin

Daniel Z
1 decade ago Aug 10, 2009 7:20am

Hi All,
I finally tried integrating Vaadin with Grails to see if it was possible to develop a Vaadin application without having to constantly redeploy in order to see my progress. The result is a new Vaadin Grails plugin, and I was very impressed with the increase in productivity. For details, check out the plugin here, or install the it in your Grails app like this:

grails install-plugin vaadin

Have fun!

Daniel

Henry Hagnäs
1 decade ago Aug 10, 2009 8:55am
Henry Hagnäs
1 decade ago Aug 10, 2009 9:03am
Daniel Z
1 decade ago Aug 10, 2009 9:21am
Joe Terry
1 decade ago Sep 14, 2009 3:59pm
Daniel Z
1 decade ago Sep 27, 2009 8:11am
Michael Carl
1 decade ago Oct 04, 2009 11:50am
Daniel Z
1 decade ago Oct 05, 2009 10:52am
Daniel Z
1 decade ago Oct 05, 2009 10:56am
Lars Hundebøl
1 decade ago Dec 03, 2009 11:34am
Peter Hägg
1 decade ago Feb 14, 2010 1:00pm
Peter Hägg
1 decade ago Feb 15, 2010 7:29pm

Nevermind, I found a solution for this. I'll share it, as this might save someone a minute or two.

You can get a handle to your service, for example, by using a factory class like this:

import org.codehaus.groovy.grails.commons.ApplicationHolder

class ServiceFactory {

    def getSomeService() {
        return this.getBean('someService')
    }

    private def getBean(beanName) {
        return ApplicationHolder.getApplication().getMainContext().getBean(beanName)
    }

}

Then you would use this class in a vaadin component, like this:

...
def serviceFactory = new ServiceFactory()
def service = serviceFactory.getSomeService()
...
Last updated on Feb, 15th 2010
nat-nat banzon
1 decade ago Feb 26, 2010 5:04am
nat-nat banzon
1 decade ago Mar 02, 2010 5:55am
Drew McAuliffe
1 decade ago Mar 13, 2010 4:47am
nat-nat banzon
1 decade ago Mar 15, 2010 6:53am
Abiel Hakeem
1 decade ago Apr 19, 2010 4:39am

Thank you very much Daniel,
VGrails framework uses your plugin in a very intensive way :)

http://vaadin.com/forum/-/message_boards/message/146536

Abiel
@West Java, Indonesia

Drew McAuliffe
1 decade ago Apr 21, 2010 6:07am
krishvaadin krish
1 decade ago May 03, 2010 10:40am
Daniel Z
1 decade ago May 18, 2010 2:55pm
Les Hazlewood
1 decade ago Jun 03, 2010 11:17pm

Hi All,

Based on Daniel's work, I've released a new (version 1.1) Grails Vaadin plugin. It now supports:

  1. Latest stable Vaadin version (6.3.3 at this time)
  2. Paths to your Vaadin UI other than the context root (e.g. http://www.somehost.com/myapp/vaadinUI)
  3. Per-environment configuration (Vaadin's 'production mode' = true for Grails production environment only. Can be overridden for any environment). Custom environments are also supported (e.g. 'beta', 'uat', etc)

A *huge* benefit to Grails 1.3 users is that because Grails 1.3 supports Groovy 1.7, which can use nested and anonymous inner classes, you can program all of your Vaadin UI in Groovy with natural Rich UI paradigms. For example, button listener registration and nested logic:

// Remove a contact from a list:
def removalCount = 0
contactRemovalButton = new Button("-", new Button.ClickListener() {
   void buttonClick(ClickEvent event) {
       contactList.removeItem(contactList.value)
       //reference a non-final attribute inside an anonymous inner class!
       removalCount++;
    }
})

To install in your grails app:

> grails install-plugin vaadin

Happy coding!

Les Hazlewood
http://www.katasoft.com

Last updated on Jun, 4th 2010
Rajesh h
1 decade ago Jun 19, 2010 1:20pm
Vyacheslav Rusakov
1 decade ago Jun 20, 2010 12:17pm
Fedor Shubin
1 decade ago Oct 23, 2010 8:46pm
Bogdan G
1 decade ago Oct 24, 2010 11:15pm
ilkay a
1 decade ago Nov 25, 2010 3:21pm
Frik S
1 decade ago Nov 30, 2010 10:52am
Henri Muurimaa
1 decade ago Dec 01, 2010 8:11am
Frik S
1 decade ago Dec 01, 2010 9:52am
Frik S
1 decade ago Dec 04, 2010 9:02am
Chris Friedline
1 decade ago Mar 28, 2011 8:58pm

Michael Carl:
java.lang.RuntimeException: javax.servlet.ServletException: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
...

This is an old post, but didn't see an answer on here regarding this problem. I recently ran into this myself, and though, cause is unknown (something between Vaadin, Grails, and Hibernate - helpful, huh?), I was able to get around this by only showing relevant data fields in the container I was populating and ignoring those put in by GORM/Vaadin using setVisibleColumns().

Seems simple enough. Like I said, exact cause unknown, but this works in my case. Freakishly, this problem led me to start developing my Grails view layer in Zk (gasp!), but now I'm back to Vaadin and very, very relieved.

Chris

Last updated on Mar, 28th 2011
Robert La Ferla
1 decade ago Apr 21, 2011 11:49pm
Henri Sara
1 decade ago Apr 27, 2011 11:14am
Tomasz Przybysz
1 decade ago May 19, 2011 9:36am
Joonas Lehtinen
1 decade ago May 20, 2011 2:54pm
Fredrik Nordin
1 decade ago Aug 19, 2011 9:29am
Alain Fernandez
1 decade ago Oct 17, 2011 6:47pm
Kirk Stork
1 decade ago Dec 03, 2011 2:40am
Ondrej Kvasnovsky
1 decade ago Jan 06, 2012 9:32am
Nicolas Martinez
1 decade ago Jan 25, 2012 8:56pm