• 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

HTMLEditor - How to set its editable property to false

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a way to disable an HTMLEditor so that the user cant perform inputs to it?
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The Javadoc for setHtmlText() reads thus:

Note that if the contentEditable property on the tag of the provided HTML is not set to true, the HTMLEditor will become read-only.



So, you can try: <body contentEditable="false">
 
Rancher
Posts: 387
30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Call htmlEditor.setDisable(true) to disable the html editor.
 
Rancher
Posts: 517
15
Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HtmlEditor's setDisable(true) makes the editor's content read-only. I had tried <body contentEditable="false"> in the HTML itself and the display in the editor - it didn't work.
 
Prasad Saya
Rancher
Posts: 517
15
Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Prasad Saya wrote:HtmlEditor's setDisable(true) makes the editor's content read-only. I had tried <body contentEditable="false"> in the HTML itself and the display in the editor - it didn't work.



The setDisable(true) also disables the the scrollbar that's associated with the HtmlEditor. To view HTML content as read-only one has to use WebView.
 
reply
    Bookmark Topic Watch Topic
  • New Topic