1

I need to make TextArea Wicket read-only. Is it possible to do this?

Best
  • 2,200
  • 9
  • 30
  • 49

2 Answers2

3

Why not just output the readonly attribute in the <textarea>, like in this fiddle?

If you need to do this inconditionally, just type it in your HTML, if it is conditional, add a SimpleAttributeModifier to the TextArea.

Xavi López
  • 27,550
  • 11
  • 97
  • 161
2

Read this http://wicket.apache.org/apidocs/1.4/org/apache/wicket/Component.html#setEnabled(boolean)

Snap
  • 21
  • 2
  • it does work but the textarea has been grayed out. How can we make the text clearer? – Best Jan 09 '12 at 13:49
  • @Best you can style it with CSS, see http://stackoverflow.com/questions/5485642/how-do-you-style-disabled-textarea-in-ie8 – Sam Hasler Jan 09 '12 at 20:56