Wednesday, September 15, 2010

HTML Widget and Firefox

I have a need to provide a TextArea in my application for a user to
enter text, but the text needs to be converted to HTML format when
using it. For example, I need the following text "foo\n\nbar" to
convert to "foo<br><br>bar".

The solution I've implemented is to use a HTML widget as an
intermediary, using the following code:

TextArea textArea;
HTML translator;

...

translator.setText(textArea.getText().trim());
String htmlString = translator.getHTML();

The code works fine on IE, but totally fails to do the conversion in
Firefox.

Help?

For the record, I'm using GWT 1.7.1 running in both IE8 and FF 3.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment