aspose file tools*
The moose likes Struts and the fly likes Hyperlinks in text area Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Hyperlinks in text area" Watch "Hyperlinks in text area" New topic
Author

Hyperlinks in text area

Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
We want to show some hyper links in the text area (which is basically user comment area in the application).
User should be able to click on that link which is inside the text area.

Any suggestions on this.

Thank you
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

"Vani", please check your private messages for an important administrative matter.
Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
I have learned from googling that html text area do not recognize hyperlinks.
I am using stuts html:textarea in my code which eventually render the regular html text area to the browser.
Is this correct to use ruch text area for this ?
Please correct me if I am correct.
[ October 10, 2008: Message edited by: Vani Bandargal ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8910
    
    8

Unless you want your users to be editing HTML source, use a rich text editor like FCKeditor instead of a plain text editor like textarea.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
Thank you very much Joe Ess.

I just learned from the url mentioned below that FCKeditor is the solution.
I came back to this website and you confirmed it too. I am glad that I am heading in right direction.
http://www.oreillynet.com/onjava/blog/2006/02/integrating_a_richtext_widget.html

I do have few more questions on this.
1. I downloaded the FCKeditor 2.6.3 and not the FCKeditor.Java. Is this correct?
2. Is this OK only to copy the js file to my project or do I need to copy all the files available in that zip on to my project?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8910
    
    8

No idea. I just know that's what pebble uses.
Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
I solved my problem using TinyMCE

I could have done the same using FCKEditor too and felt that TinyMCE is easier to integrate.

Basically I needed to achieve 2 things in our text area
1. Allow some basic formatting features(like bold, underline...)
2. Render a Clickabale links.

#1 is resolved since with TinyMCE, the normal text area we had before is now a rich text area whih allows all formatting.
#2 is not completely resolved but still OK with some work around
It is not possible to have clickable links directly in any editor(rich text editor) be it be using FCKeditor or TinyMCE or some other tool.
One has to hold Ctl key + click in order for a link to work.

Other way for clickable links would be through preview option available in rich text editor. We are OK with this now

[ October 15, 2008: Message edited by: Vani Bandargal ]

[ October 15, 2008: Message edited by: Vani Bandargal ]
[ October 15, 2008: Message edited by: Vani Bandargal ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hyperlinks in text area