Dimitri Dewaele
Dimitri Dewaele

Reputation: 10699

How do I set the value of HtmlOutputText in JSF?

I want to dynamically create a form with my bean. I am using JSF 2.0

HtmlOutputText htmlOutputText = new HtmlOutputText();

How should I set the content of HtmlOutputText?

Upvotes: 0

Views: 685

Answers (1)

perissf
perissf

Reputation: 16273

HtmlOutputText extends javax.faces.component.UIOutput.

UIOutput#setValue() is the method you are looking for:

String value;
HtmlOutputText htmlOutputText = new HtmlOutputText();
htmlOutputText.setValue(value);

Links:

Upvotes: 1

Related Questions