Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strut2 JQuery TinyMCE

 
Harjeet Parmar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all. I am using jquery to display TinyMCE in my Struts2 application. It works well. Now that I am trying to add some javascript to my implementation of a textarea which renders TinyMCE, I find that the 'onclick', 'onselect', 'onkeyup' does not work properly.

To be more specific: I am using an HTML 'select' element to display a set of options to the user. They can select one of these options, click another HTML element 'button' and copy what they selected from the HTML 'select' element into the TinyMCE-enabled 'textarea'. However, the user must set the cursor position in the 'textarea' before they can copy from the 'select' element. I am using javascript to capture the cursor position in the textarea to enable the user to copy from the select element. Here is the javascript:


When I implement this as plain HTML, it works fine. However, when I use this in conjunction with the jquery implementation of TinyMCE in Struts2, the call to 'onclick=storeCaret(this)', 'onselect=storeCaret(this)', 'onkeyup=storeCaret(this)' does not work.

Here is my Struts 2 JSP implementation:



Could someone please advise regarding this issue: why the call to 'storeCaret()' is not being made?

Thanks in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic