aspose file tools*
The moose likes JSF and the fly likes how to display line break in browser using h:inputTextarea? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "how to display line break in browser using h:inputTextarea?" Watch "how to display line break in browser using h:inputTextarea?" New topic
Author

how to display line break in browser using h:inputTextarea?

peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
I want to display something like
ab
def

I try the following code


but the output is
ac<br/>de<br>/

so how to let the browser output
ab
def
using <h:inputTextarea>??
a phil
Greenhorn

Joined: Nov 11, 2008
Posts: 9
Hi,

interrupt the rendering of the value of the inputtextArea - you can do this using a javascript function by getting hold of the id ( handler of the tag on the form), and then manipulate the value attribute of the inputTextArea value. You can also achieve the new - line feature as desired using a javascript array. First get the value of the inputTextArea and then create a js array of strings that you want them to render... and then display this array structure as the value... you can do this by updating the value using str1, and javascript's new line and repeating this until last string is updating on the value attribute and then finally render the value. Please remember you need to do all this before the form is rendered... (i think you need to use a hidden variable on the form that holds the value tht the inputtextarea must be updated with.. you can update hidden var from the backing bean... )..hope this helped.. gud luck !
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

"java seeker", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to display line break in browser using h:inputTextarea?