Yes, basically you'll need to do this.

You want the code for such a thing from me?

You'll have to nicely ask for a christmas present if you really want it ;)

regards,

Martin

On 12/22/05, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> So I have to write my own renderer for the Outputtext?
>
> Regards,
> Andy
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Marinschek [mailto:[EMAIL PROTECTED]
> Gesendet: Donnerstag, 22. Dezember 2005 16:30
> An: MyFaces Discussion
> Betreff: Re: AW: How to display Line breaks in Outputtext?
>
>
> What you usually do is to replace the renderer of the output-text
> component - and replace all occurrences of \n with <br/> there.
>
> Plus: you need to make sure that escape="false".
>
> regards,
>
> Martin
>
> On 12/22/05, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> > How can I replace the \n with a <br/> on the output? By javascript?
> > Because when I write <h:outputText value="Hello<br/>World"/> It doesn't 
> > work.
> >
> > If I use the pre Tag, what can happen with the layout?
> >
> > Regards
> > Andy
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Luiz Carlos Geron [mailto:[EMAIL PROTECTED]
> > Gesendet: Mittwoch, 21. Dezember 2005 14:13
> > An: MyFaces Discussion
> > Betreff: Re: AW: How to display Line breaks in Outputtext?
> >
> >
> > > So the user has to write \n hardcoded into the textarea? Isn't there a way
> > > to recognize a Carriage Return, when the user presses the CR Key?
> > No. When you submit a form that contains a textarea, if you have typed:
> >
> > line
> > other line
> >
> > Then if you make:
> >
> > String str1 = this.getInputTextarea1
> > ().getValue().toString().replace("\n","<br>");
> >
> > You'll get "line<br>other line". Don't do this replace, since maybe you want
> > to put the value in a textarea again.
> >
> > > And I don't unterstand what you mean with the <pre> tag.
> > > Do you mean just: <pre><h:outputText value="Hello/nWorld"/></pre> and the
> > > Text is shown as Hello
> > > World
> > >
> > > ??
> > Yes, you can also replace (on the output) the "\n" with <br>. I recommend 
> > this
> > last option, since it don't use the <pre> html tag, wich can break you
> > layout.
> >
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
> ______________________________________________________________________
>
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> your system manager.
>
> This footnote also confirms that this email message has been swept
> for the presence of computer viruses.
> ______________________________________________________________________
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to