html tags in code-behind

UI Components for JSF
Post Reply
autobots
Posts: 2
Joined: 09 Sep 2011, 17:43

05 Oct 2011, 05:54

Hi,.. I want to know how to add the <br/> code in behind.. This is my sample code :

Code: Select all

        CommandLink link = new CommandLink();
        link.setOnclick("dialog.show()");
        GraphicImage imgLink = new GraphicImage();
        imgLink.setUrl(imgLocation);
        
        HtmlOutputText outputText = new HtmlOutputText();
        outputText.setValue("Coba");
        link.getChildren().add(imgLink);
        
        link.getChildren().add(outputText);
between the link.getChildren().add(imgLink); and link.getChildren().add(outputText); I want to add space by using tag <br/>.. Anyone could tell me how to do it in code-behind??? :D
I'm using Primefaces 2.2.1 :D

TD_Knies
Posts: 8
Joined: 26 Sep 2011, 14:15
Location: Germany

05 Oct 2011, 08:37

There is a setEscape - function in HtmlOutputText.
So you can try this one:

Code: Select all

HtmlOutputText br = new HtmlOutputText();
br.setEscape(false);
br.setValue("<br/>");

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 66 guests