Cannot render a label in HTML

Hi, I’m just trying out vaadin.

I’ve modified the initial sample a little bit:

public class MyUI extends UI {

@Override
protected void init(VaadinRequest request) {
	final VerticalLayout layout = new VerticalLayout();
	layout.setMargin(true);
	setContent(layout);

	Button button = new Button("Click Me");
	button.addClickListener(new Button.ClickListener() {
		public void buttonClick(ClickEvent event) {
			Label myLabel = new Label();
			myLabel.setContentMode(ContentMode.HTML);
			myLabel.setCaption("<b>Thank you</b> for clicking");
			layout.addComponent(myLabel);
		}
	});
	layout.addComponent(button);
}

I.e. I’ve added a setContentMode(ContentMode.HTML) and then inserted a html tag.

It doesn’t rended, either in J2EE preview, or on Tomcat 7.

What am I doing wrong?

Thanks

Hi Francesco
Your current code only renders the captions of the labels.
You should be using myLabel.setValue(…) instead

Tomi

Yeah, you’re right.

Thanks