i liked the Selectable from the Layouts tab.
But I cant get it to work .
Embedded e = new Embedded("Image from a theme resource",
new ThemeResource("../runo/icons/64/document.png"));
this.getLayout().setStyleName(Runo.CSSLAYOUT_SELECTABLE);
OR
Embedded e = new Embedded("Image from a theme resource",
new ThemeResource("../runo/icons/64/document.png"));
e.setStyleName(Runo.CSSLAYOUT_SELECTABLE);
None of the above works.
Am i getting something wrong?
Any help would be appreciated.
The problem is that that specific style name is applicable only to CssLayout (as the name of the constant implies), so you need to wrap the Embedded image inside a CssLayout, and use the style name on the layout.
CssLayout l6 = new CssLayout();
Embedded e = new Embedded("",
new ThemeResource("../runo/icons/64/document.png"));
Embedded e2 = new Embedded("",
new ThemeResource("../runo/icons/64/document.png"));
l6.setStyleName(Runo.CSSLAYOUT_SELECTABLE);
l6.addComponent(e);
l6.addComponent(e2);
..............................
Form f6 = new Form();
f6.getLayout().addComponent(l6);
Stupid question: did you remember to call setTheme(“runo”) in your application init? Otherwise the code looks good to go. Can you verify that the style is applied on the browser (use Firebug/Web Inspector)?
These styles are only available if you use the Runo theme. Reindeer doesn’t provide similar styles. It probably should, but that’s another topic.
I tried that now but with no result again. I am not very familiar with Firebug yet but i am sure i saw that style somewhere.
I’m sure it must be something small but I’ll find it in a later stage as i get deeper in Vaadin.
I’ll post it here when i find it.
Until then thank you very much for your time.