You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Guy Katz <gk...@allot.com> on 2004/11/10 11:04:08 UTC

new line characers gone?

hi;
i have a forum application.
i use an h:inputText to get the user entered message.
when displaying that entered text with outputText component, the text is
displayed in one continues chunk (see example below). the user newlines
(when the user push enter to goto a new line and then continues writing
text) are gone.

am i missing something here? what did i forget to do?
i am using JSF RI + MYFACES components
thanks,

example:
user enters:
"hi
hello"
output is:
"hi hello"


____________________
Guy Katz
Allot Communications
gkatz@allot.com
tel: +972 9 7619288
fax: +972 9 7443626


Re: new line characers gone?

Posted by Heath Borders-Wing <he...@gmail.com>.
The <h:outputText> is probably writing out the newline, but the
browser doesn't interpret newline characters as line breaks.  You're
going to have to either make your own tag that will automatically do
that substitution for you, or you'll have to replace the newline
characters with a <br> tag before you pass it to the outputText.  This
could be done in the bean getter.


On Wed, 10 Nov 2004 12:04:08 +0200, Guy Katz <gk...@allot.com> wrote:
> hi;
> i have a forum application.
> i use an h:inputText to get the user entered message.
> when displaying that entered text with outputText component, the text is
> displayed in one continues chunk (see example below). the user newlines
> (when the user push enter to goto a new line and then continues writing
> text) are gone.
> 
> am i missing something here? what did i forget to do?
> i am using JSF RI + MYFACES components
> thanks,
> 
> example:
> user enters:
> "hi
> hello"
> output is:
> "hi hello"
> 
> 
> ____________________
> Guy Katz
> Allot Communications
> gkatz@allot.com
> tel: +972 9 7619288
> fax: +972 9 7443626
> 
> 


-- 
If you don't have a GMail account, I probably have 5 invites.  Just ask!
-Heath Borders-Wing
hborders@mail.win.org