ADF Faces 11g – Rich Text Editor: editing WYSIWYG HTML text in JSF Web Applications

4

For one of my current ADF projects, the customer has asked for a Rich Text Editor – to allow the end user to easily edit Email-messages that are sent from the system. Currently that is done in plain text using a simple HTML Textarea – but their application is going through a major overhaul, trying to exploit many benefits of Web 2.0, AJAX and modern CSS based layout. We originally intended to embed the MyFaces Tomahawk Rich Text Editor component in the application, but then I very fortunately – among the rather long list of component – ran into the JDeveloper 11g Technology Preview 2 and encountered its Rich Text Editor component:

 

Since the application is scheduled to go live only deep into 2008, we will switch from the current JDeveloper 10.1.3.3 stack to 11g somewhere early next year and we can make use of the new 11g features. This Rich Text Editor can be dragged to the page in the same way as any other component, like for example a simple inputText component. The value of a Rich Text Editor component is a " well formed XHTML-fragment".

When the page is run with the Rich Text Editor, it looks like this:

The supported editor features are:

Font Name

  • Font Size
  • Link/Unlink
  • Clear Styling
  • Undo/Redo
  • Bold
  • Italics
  • Underline
  • Subscript/Superscript
  • Justify (Left, Middle, Right, Full)
  • Ordered Lists/Unordered Lists
  • Indentation
  • Text color
  • Background color

It does not support embedding images!

The rich text editor value can for example be used to programmatically compose an Email and sent it onwards. Or to (XSLT) transform the rich text into XSL_FO and PDF or RTF formats. Or to just store the text in the database.

Share.

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director for Fusion Middleware. Consultant, trainer and instructor on diverse areas including Oracle Database (SQL & PLSQL), Service Oriented Architecture, BPM, ADF, Java in various shapes and forms and many other things. Author of the Oracle Press book: Oracle SOA Suite 11g Handbook. Frequent presenter on conferences such as JavaOne, Oracle OpenWorld, ODTUG Kaleidoscope, Devoxx and OBUG. Presenter for Oracle University Celebrity specials.

4 Comments

  1. i am trying to implement character counter on richtexteditor using java script, but javascript is not getting fired in wysiwyg mode. And in source mode its getting fired but i loose the formatted text. Is there something else i can do to implement a character count on richtexteditor?

  2. hii,
    i am using richtexteditor in adf in building my application. i need to disable some features(outdent,indent,numbering etc..) of the richtext editor programatically is that possible? if so.. hw can i achieve it?

    thanks and regards,
    vamsi