• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>??
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"java seeker", please check your private messages for an important administrative matter.
 
reply
    Bookmark Topic Watch Topic
  • New Topic