Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Behzad Gadimi
Admin Actions Handle
February 27, 2013 12:36 AM
Answer

Behzad Gadimi

Rank: Junior Member

Posts: 31

Join Date: March 8, 2011

Recent Posts

Hi,
I have an actions menu in each row of my search container :

<liferay-ui:icon-menu>
<portlet:actionURL name="add" var="add">
<portlet:param name="action" value="add" />
</portlet:actionURL>
<liferay-ui:icon image="add" message="Add" url="<%=add.toString() %>" />

<portlet:actionURL name="delete" var="delete">
<portlet:param name="action" value="delete" />
</portlet:actionURL>
<liferay-ui:icon image="delete" message="Delete"
url="<%= delete.toString() %>" />
</liferay-ui:icon-menu>


How can I handle those actions in my portlet class ?
Below code isn't working :

@ProcessAction(name = "delete")
public void delete() {
System.out.println("<<<< Controller delete() method has been called >>>>>>>>>");
}


please help ...
Kowbathullah Gnaniyar
RE: Admin Actions Handle
February 27, 2013 12:53 AM
Answer

Kowbathullah Gnaniyar

Rank: Liferay Master

Posts: 603

Join Date: December 19, 2007

Recent Posts

Pass the id parameters for each actions and receive it in delete method of your process action.

<portlet:param name="id" value="<%=String.valueOf(id)%>" />


1@ProcessAction(name = "delete")
2public void delete(ActionRequest actionRequest,ActionResponse actionResponse) {
3String idValue = actionRequest.getParameter("id");
4
5// do your logic here based on this idValue
6}


HTH
Behzad Gadimi
RE: Admin Actions Handle
February 27, 2013 7:13 AM
Answer

Behzad Gadimi

Rank: Junior Member

Posts: 31

Join Date: March 8, 2011

Recent Posts

It says : wrong number of arguments emoticon
Behzad Gadimi
RE: Admin Actions Handle
February 27, 2013 7:40 AM
Answer

Behzad Gadimi

Rank: Junior Member

Posts: 31

Join Date: March 8, 2011

Recent Posts

oh my god,
I've forgot these :
ActionRequest request, ActionResponse response
that would be the problem,


thanks ...
yasin badur
RE: Admin Actions Handle
November 8, 2013 6:52 AM
Answer

yasin badur

Rank: New Member

Posts: 1

Join Date: November 8, 2013

Recent Posts

Behzad Gadimi:
oh my god,
I've forgot these :
ActionRequest request, ActionResponse response
that would be the problem,

hi,

How can I handle action from user edit menu actions on Control Panel.

Can you help me.

thanks ...
Kowbathullah Gnaniyar
RE: Admin Actions Handle
December 17, 2013 12:49 AM
Answer

Kowbathullah Gnaniyar

Rank: Liferay Master

Posts: 603

Join Date: December 19, 2007

Recent Posts

You have to override through Struts Action / Service Hook