how to display line break in browser using h:inputTextarea?
peter tong
Ranch Hand
Joined: Mar 15, 2008
Posts: 234
posted
0
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
posted
0
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 !