• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Rich Text Area using TinyMCE in Spring MVC application

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have created an MVC applicaiton using ROO , I am trying to use a rich text area in my creat.jspx page. I am using TinyMCE.

The Java script files are attached correctly but it looks like spring mvc tag for area is not accepting the effects tinyMCE library is trying to apply on it because I still see a normal text area.

I also tried tinyMCE ina separte Web applicaiton (j2ee) and can see the desired rich text area when using it from a jsp page.

I have a feeling that somehow the spring mvc tag is forcign it's own css and java scripts on text area and overriding TinyMCE in this case.

This is now pissing me off , I have no clue why this is happening. Cna any body out there help me to understand whats going on here?


Regards,
Sajjad Ahmed Paracha

My Technical Blogs
J2EE Frameworks : http://comparingexsitingj2eeframeworks.blogspot.com/
Adobe Flex : http://adobeflexandj2ee.blogspot.com/
JAVA : http://javaiscoool.blogspot.com/
Design Pattern : http://designpatterndiscussions.blogspot.com/

“Only as high as I reach can I grow, only as far as I seek can I go, only as deep as I look can I see, only as much as I dream can I be.” Karen Ravn
 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have not given anyone much information to work with, so the amount of help anyone can give is limited. Try viewing the rendered HTML in Firebug and maybe you can tell better what is happening. There are lots of results on a Google search of TinyMCE and Spring MVC below are the first few.


http://www.tinymce.com/forum/viewtopic.php?id=27106
http://blog.benkuhl.com/2012/05/tinymce-spellcheck-implmentation-with-spring-mvc/
http://webknox.com/q/with-tinymce-how-to-make-a-rich-text-editor-coexist-with-another-textarea
 
sajjad ahmad
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bill Gorder wrote:Please BeForthrightWhenCrossPostingToOtherSites
http://forum.springsource.org/showthread.php?132867-Rich-Text-Area-using-TinyMCE-in-Spring-MVC-application&p=432120#post432120

p


Bill gorder, thanks for your reply. I have posted same question on multiple forums hoping i can get quick help. That should not be a problem, If I find a solution on one thread i willupdate the other thread accordingly.
 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sajajad,

If I find a solution on one thread i willupdate the other thread accordingly.



Thanks for doing that. The other part we ask for is just a link to the other cross posted threads. What this allows us to do is look and see what kind of advice (working or not) that has already been given. This way we are not spending our time repeating the same efforts as others. I hope that makes sense.

Did you get a chance to take a look at the outputted HTML? This is often the best way to find out exactly what is causing the problem.
 
sajjad ahmad
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me give you more details about it , I am writing the below code in spring roo generated application to load the desired js file in my application



on run time in html code I can see the js file in being included correctly (the path is correct) , but I don't see the alert messages , however if I remove line


I can see the alert messages , which means there is some problem when spring is trying to load the js file however I don't see any error both on server console or at browser.

I am almost cluless here that whats going wrong at this point.

Below is the code generated for the page where I am including the js file


and the html code for text area where I can't see this whole rich text box thing being applied is


 
sajjad ahmad
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah , finally resolved the problem. It was the most stupid problem I ever had and it watsed my whole weekend :s.

I found the solution from following website
http://stackoverflow.com/questions/8303050/including-js-files-jquery-in-jspx-files

he problem was apparently the way script tag has to be written in application meant to run on IE I was using the below java script include


The solution ws to write it like



Below I am copying some stuff from that web site

JSPX has the quirky behaviour that it auto-collapses tags without body. So effectively
<script type="text/javascript" src="route/to/scripts/jquery.js"></script>
<script type="text/javascript" src="route/to/scripts/jquery.ui.js"></script>
<script type="text/javascript" src="route/to/scripts/something.js"></script>
will end up in browser as
<script type="text/javascript" src="route/to/scripts/jquery.js" />
<script type="text/javascript" src="route/to/scripts/jquery.ui.js" />
<script type="text/javascript" src="route/to/scripts/something.js" />
which is invalid <script> syntax (rightclick page in browser and do View Source to see it yourself). The browser behaviour is undetermined.

You can workaround this by putting a <jsp:text /> between the tags
<script type="text/javascript" src="route/to/scripts/jquery.js"><jsp:text /></script>
<script type="text/javascript" src="route/to/scripts/jquery.ui.js"><jsp:text /></script>
<script type="text/javascript" src="route/to/scripts/something.js"><jsp:text /></script>


Please go to the mentioned website for the details.
 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad you got this resolved. Thanks for posting back with the solution.
 
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic