aspose file tools*
The moose likes JSF and the fly likes Highlight part of a text in JSF InputTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Highlight part of a text in JSF InputTextArea" Watch "Highlight part of a text in JSF InputTextArea" New topic
Author

Highlight part of a text in JSF InputTextArea

Cesar Huasupoma
Greenhorn

Joined: Nov 12, 2012
Posts: 8
I have to Highlight part of a text but this text is in InputTextArea. Also I need to Highlight this text in when I push the button which is going to have a parameter that give me the text that is going to Highlight.

I got some kind of idea of highlight the text using this function:



But for this I need to have a change the tag of <ice:inputTextarea> to <div> I a really need to have an inputTextarea because I also need to change the text if it's necessary I got an example page: gskinner.com/RegExr/ Andi hope someone understand me because my english isn't the best
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

The HTML controls that implement the JSF inputText and inputTextArea controls do not support formatted text, only plain text. If you attempt to embed sub-elements for formatting within the element definitions for these controls, it will not work properly.

There are JSF controls available that can allow for the input of text with formatting, but they are not part of the core JSF tag set - you have to use one of the extension tag sets such as the RichFaces Rich Text control.


Customer surveys are for companies who didn't pay proper attention to begin with.
Cesar Huasupoma
Greenhorn

Joined: Nov 12, 2012
Posts: 8
I understand that I use ICEFaces 1.8 because the system that I'm working use it so I was thinking maybe I could use the InputRichText but I consider this kind of the last option
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

IceFaces has the ice:inputRichText control. It's not a "last resort", however. Like I said, the core JSF tags are all limited to what HTML can do, and HTML text controls can't do rich text.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Highlight part of a text in JSF InputTextArea