0

I've tried putting them in the web-app/VAADIN/themes/images folder and tried accessing the web-app/images folder and several others. No luck.

Using new ThemeResource(null, "VAADIN/themes/images/mypic.png") and many many variations but no luck.

Please let me know what I'm missing? I'm have to resort to new ExternalResource("http:\...mypic.png") to get my images. Unable to figure out how to access locally. Hopefully it's something simple I'm missing.

Vaadin 7.1.11 and Grails 2.3.5

Thanks Dana

  • Mistyped in my question... Shouldn't be a null in the parameters for ThemeResource. Sorry for the confusion but still having the issue. Thanks – user3399958 Mar 10 '14 at 01:29

1 Answers1

0

Your images should be located in VAADIN/themes.[YOUR_THEME]/img Then to access them you can use:

Link l = new Link("Download introduction source", fr)
            l.setTargetName("_blank")
            l.setStyleName("link-pdf")
            l.setIcon(new ThemeResource("img/pdf.png"))

or, from any scss by 'url(img/notes-bg.png)' for instance.

Don't forget to declare your theme in VaadinConfig.groovy:

themes = ['your_theme']

ludo_rj
  • 3,877
  • 1
  • 18
  • 37
  • That did it. I was using the theme chameleon and not a custom one. I created a custom theme and used the @Theme([YOUR_THEME]) annotation in the UI that matches the new [YOUR_THEME] directory in the /themes directory. Thanks – user3399958 Mar 11 '14 at 01:51