Wednesday, December 12, 2012

How to create new Liferay portlet in existing portlet project

It is possible to create multiple portlet in the same portlet project.
Therefore, all the library and resources, e.g. jars, css, js, etc can be shared among portlet in the same project.

in this post, I will use JSF2 portlet as the sample.
for more information, please refer How to create JSF2 Portlet in Liferay

Prerequisites:
1. make sure Liferay development environment is properly setup

Steps:
Create New Portlet
1. R-click on existing portlet > New > Other
2. Expand Liferay > select JSF Portlet > Next > Next
    p/s: if your target portlet is not JSF Portlet, then select Liferay Portlet
3. Fill in new portlet details > Next > Finish

Verify the new portlet
1. open portlet.xml, check the new portlet entry

2. open liferay-display.xml and liferay-portlet.xml as well, to confirm the new portlet entry created.

Test the portlet
1. Login to Liferay
2. Add > More... > Sample > NewJSFPortlet > Add
3. If a new portlet successfully added to the page like below, you are done

Done!!

2 comments:

  1. i just to what u said and work fine but when iam using some action to fire some method did not work cn u help

    ReplyDelete
    Replies
    1. Please make sure <h:head /> in your xhtml instead of the html <head />

      Delete

LinkWithin

Related Posts Plugin for WordPress, Blogger...