You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Steve Torrefranca <st...@branders.com> on 2007/02/22 19:58:20 UTC

wrapping text

Hi,

How do we wrap texts with "\n"?  I have tried t:div but did not work.

Thank you

-Steve

Re: wrapping text

Posted by Jeff Bischoff <jb...@klkurz.com>.
That will wrap the text to some arbitrary width...

Rereading your message, you are expected the \n in your String to be 
treated as the line end.

Have you tried CSS like:

white-space: pre

Jeff Bischoff wrote:
> You mean you tried:
> 
> <t:div style="width: 25px;"/>
>    <h:outputText ... />
> </t:div>
> 
> That didn't work?
> 
> Steve Torrefranca wrote:
>> Hi,
>>
>> How do we wrap texts with "\n"?  I have tried t:div but did not work.
>>
>> Thank you
>>
>> -Steve
>>
>>
>>
> 
> 
> 
> 
> 



Re: wrapping text

Posted by Jeff Bischoff <jb...@klkurz.com>.
I would go with the CSS then. :)

Steve Torrefranca wrote:
> Hi Jeff,
> 
> sorry for not being clear.
> 
> what i need is for the text to keep follow line breaks without using 
> replaceAll "\n" with <br/> .  the reason for that is some texts are 
> stored in the db as pure text with escape char while others are saved in 
> html format.
> 
> -Steve
> 
> 
> Jeff Bischoff wrote:
>> You mean you tried:
>>
>> <t:div style="width: 25px;"/>
>>    <h:outputText ... />
>> </t:div>
>>
>> That didn't work?
>>
>> Steve Torrefranca wrote:
>>> Hi,
>>>
>>> How do we wrap texts with "\n"?  I have tried t:div but did not work.
>>>
>>> Thank you
>>>
>>> -Steve
>>>
>>>
>>>
>>
>>
>>
> 
> 
> 
> 



Re: wrapping text

Posted by Steve Torrefranca <st...@branders.com>.
Hi Jeff

Worked like charm!

                 <t:outputText escape="false" style="white-space: pre;" 
value="#{communication.body}" />


Many Thanks!

-Steve



Steve Torrefranca wrote:
> Hi Jeff,
>
> sorry for not being clear.
>
> what i need is for the text to keep follow line breaks without using 
> replaceAll "\n" with <br/> .  the reason for that is some texts are 
> stored in the db as pure text with escape char while others are saved 
> in html format.
>
> -Steve
>
>
> Jeff Bischoff wrote:
>> You mean you tried:
>>
>> <t:div style="width: 25px;"/>
>>    <h:outputText ... />
>> </t:div>
>>
>> That didn't work?
>>
>> Steve Torrefranca wrote:
>>> Hi,
>>>
>>> How do we wrap texts with "\n"?  I have tried t:div but did not work.
>>>
>>> Thank you
>>>
>>> -Steve
>>>
>>>
>>>
>>
>>
>>
>
>


Re: wrapping text

Posted by Steve Torrefranca <st...@branders.com>.
Hi Jeff,

sorry for not being clear.

what i need is for the text to keep follow line breaks without using 
replaceAll "\n" with <br/> .  the reason for that is some texts are 
stored in the db as pure text with escape char while others are saved in 
html format.

-Steve


Jeff Bischoff wrote:
> You mean you tried:
>
> <t:div style="width: 25px;"/>
>    <h:outputText ... />
> </t:div>
>
> That didn't work?
>
> Steve Torrefranca wrote:
>> Hi,
>>
>> How do we wrap texts with "\n"?  I have tried t:div but did not work.
>>
>> Thank you
>>
>> -Steve
>>
>>
>>
>
>
>


Re: wrapping text

Posted by Jeff Bischoff <jb...@klkurz.com>.
You mean you tried:

<t:div style="width: 25px;"/>
    <h:outputText ... />
</t:div>

That didn't work?

Steve Torrefranca wrote:
> Hi,
> 
> How do we wrap texts with "\n"?  I have tried t:div but did not work.
> 
> Thank you
> 
> -Steve
> 
> 
>