Meaningless Drivel is fun!*
The moose likes Portals and Portlets and the fly likes JavaScript and Css conflict in Liferay and plugin questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "JavaScript and Css conflict in Liferay and plugin questions" Watch "JavaScript and Css conflict in Liferay and plugin questions" New topic
Author

JavaScript and Css conflict in Liferay and plugin questions

Tony suankularb
Greenhorn

Joined: Aug 10, 2009
Posts: 19
I'm a newbie to Portal and Portlets (also, javascript and css).

When I create a portlet, I put css files and javascripts files in a folder of the portlet project.

So, I configure liferay-portlet.xml like this

<header-portlet-css>/MyJavaScript/jmodal.css</header-portlet-css>
<header-portlet-javascript>/MyJavaScript/myscript.js</header-portlet-javascript>



My question,
1. I've heard that it's not a good idea to put my own javascript to the project's folder. For example, other porlets cannot reuse the script.
So, where should I put my Javascript and also CSS files?

2. Sometime, the CSS of a Portlet affects the Portal theme's CSS when selector names of them are duplicate such as body{} of portlet css and body{} of theme css. How can I avoid this problem?

3. Also, when I add some new portlet, I cannot click on the liferay menu or the browser get minimized. I thinks it's because of Javascripts of portlet affects the liferay portlal. Do you know how to avoid this problem.


4. Now, I'm developing portlets on eclipse and use Ant to export War Files to the Deployt folder of the liferay. Then, I manually add portles to the page and test if they work.

This really is a time-consuming method and I cannot debug my portlets. I've not found any way to run and test portlets on Eclipse. Is there a plugin or a ways that allow me to do that?

Thank you
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

The Liferay plugin SDK will solve a lot of your problems. http://www.liferay.com/downloads/liferay-portal/additional-files
These provide tools for automatically creating and deploying portlets, themes, templates and hooks.

Tony suankularb
Greenhorn

Joined: Aug 10, 2009
Posts: 19
Thanks a lot, Tim
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaScript and Css conflict in Liferay and plugin questions
 
Similar Threads
How to become expert at liferay
build failed - liferay-plugins-sdk-5.2.1
mastering liferay
How to put portlet on JSP pages?
Any tutorial for developing portlets with liferay-ide-eclipse 1.0.1