Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

adf faces missing simple text editor component?

685296Mar 6 2009 — edited Mar 6 2009
My requirement is: I want to use a text component that allows me to:
1. Edit a text fragment containing ascii characters.
2. The text component should be able to programatically accept(insert) any text fragment inside it on click of say a command button, link....
3. Undo/redo should be available by means of hot keys (like CTRL+z, CTRL+y) and also by explicit undo/redo controls (available as toolbar items or command links or buttons...).
Pretty basic and simple.

Now I know that many of you might say that any of 'af:inputText' or 'af:richTextEditor' could be the answer but that's not true. Here is why:

As per requirement no. 1: I should be able to edit a text fragment with ascii characters. This includes the <, >, & and other symbols that cannot be edited inside RichTextEditor without converting them to &lt;, &gt;, &amp; and like. This leaves my text fragment malformed. But yes af:inputText handles this without any problem. Let's move on.

As per requirement no. 2: I should be able to programmatically insert text fragments on click of command links, buttons etc. Ok af:insertTextBehavior and af:richTextEditorInsertBehavior can do that for inputText and richTextEditor respectively but before you give any verdict let's move on to requirement no. 3.

As per requirement no. 3: Undo/Redo should be available by means of hot keys as well as explicit controls (toolbar items etc.). Now if we are using af:inputText and inserted text programmatically using af:insertTextBehavior then undo/redo doesn't work using hot keys for the inserted fragment. In addition there is no means to undo/redo by use of explicit controls (tollbar items, command links/buttons etc,) for af:inputText. If we use richTextEditorInsertBehavior then undo/redo using hot keys is not a problem but if we want to do it using explicit controls then that is not available when editing in source mode (I don't want to edit in rich mode as that unnecessarily returns my text as an xhtml and changes my raw text. Also I do not need any rich text capabilities, all I need to edit is plain simple text).


So the conclusion is none of the af:inputText and af:richTextEditor can handle all of my requirements (1, 2 and 3 listed out at the beginning).
Can anyone suggest a workaround for af:inputText or af:richTextEditor to achieve all of 1,2 and 3? If not, can you suggest any other component that I can use to achieve 1,2 and 3.

It's a bit urgent.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 3 2009
Added on Mar 6 2009
5 comments
520 views