Writing html tags on the client side of GWT

I have this code in my gwt client side:

        String out = result.getConsoleOutput().replaceAll("\n", "<br/>");
        transOut.getElement().setInnerText(out);

      

Basically what comes out of consoleoutput () is text from the telnet client and transOut is the HTMLPanel in the UiBinder. I want to display it pretty, so I tried to change all \ n on the html
, but when he shows up in firefox, it looks like on the screen blah blah
blah blah ...
. I am assuming gwt is escaping the text somewhere, how can I get it to write the real tag.

here is the image:

http://www.faciletek.com/errimage.png

+2


a source to share


1 answer


You need:

String out = result.getConsoleOutput().replaceAll("\n", "<br/>");
transOut.getElement().setInnerHTML(out);

      



Note setInnerHTML()

instead ofsetInnerText()

+4


a source







All Articles