Foren

How to develope Generic portlet?

Ashraf habibi, geändert vor 12 Jahren.

How to develope Generic portlet?

Junior Member Beiträge: 32 Beitrittsdatum: 13.05.11 Neueste Beiträge
Hi
I am using Liferay 5.1.2 and liferay is new for me, I want to develop the generic portlet in liferay.
My requirement is first i am on view.jsp but when i return from the action class, i want to navigate to other jsp page.
Only i am not able to navigate the other page, i can return to same view.jsp but not able to navigate to other jsp page.
It seems like very simple but due to this problem my progress is slow.

please any body help me

Thanks
thumbnail
Bijan Vakili, geändert vor 12 Jahren.

RE: How to develope Generic portlet?

Expert Beiträge: 375 Beitrittsdatum: 10.03.09 Neueste Beiträge
Ashraf,

Consider using Spring for the development. Have you tried the Liferay IDE?
thumbnail
jelmer kuperus, geändert vor 12 Jahren.

RE: How to develope Generic portlet?

Liferay Legend Beiträge: 1191 Beitrittsdatum: 10.03.10 Neueste Beiträge
In the action method you set a render parameter, eg. view=myview

then in the render method you look for the view parameter and render some.jsp when the view parameter is myview

The render phase always follows the action phase
thumbnail
Hitoshi Ozawa, geändert vor 12 Jahren.

RE: How to develope Generic portlet?

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
Have you read the following documentation?

http://www.liferay.com/ja/documentation/liferay-portal/6.0/development/-/ai/developing-a-portlet-with-multiple-actions
thumbnail
Ravi Kumar Gupta, geändert vor 12 Jahren.

RE: How to develope Generic portlet?

Liferay Legend Beiträge: 1302 Beitrittsdatum: 24.06.09 Neueste Beiträge
You can download the sample portlet here http://sourceforge.net/projects/allinoneportlet/files/
Ashraf habibi, geändert vor 12 Jahren.

RE: How to develope Generic portlet?

Junior Member Beiträge: 32 Beitrittsdatum: 13.05.11 Neueste Beiträge
Thank to all of you for help specially Ravi Kumar, i got idea from you link....
Ashraf habibi, geändert vor 12 Jahren.

RE: How to develope Generic portlet?

Junior Member Beiträge: 32 Beitrittsdatum: 13.05.11 Neueste Beiträge
I have one more doubt. How to use multiple action class in case of generic portlet. My requirement is first i am using on action class for some jsp page after that i navigate to another jsp page, from this jsp page i am accessing another Action Class. How to do this in case of Generic Portlet.

In portlet-ext.xml we mention like that in case of Generic portlet
<portlet-class>com.ext.portlet.onlineform.action.OnlineApplicationFormAction</portlet-class>

How to mention more than one class file and how to mention in jsp page..
Hope my explanation is easy to under stand you, if not please let me know i will proved more information.

Thanks......
thumbnail
Ravi Kumar Gupta, geändert vor 12 Jahren.

RE: How to develope Generic portlet?

Liferay Legend Beiträge: 1302 Beitrittsdatum: 24.06.09 Neueste Beiträge
no need to go for multiple classes in this case. Just use multiple processAction methods.
In jsp when you are creating actionURL create like this, give it a name
<portlet:actionurl name="addCompany"></portlet:actionurl>


and in your portlet class while create a method with name given above and signature of processAction. Use annotations to make it work.
@ProcessAction(name = "addCompany")
	public void addCompany(ActionRequest actionRequest,
			ActionResponse actionResponse) throws IOException, PortletException { ...


This should solve your problem