Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Kiran Kumar Boyini
How to call the my own method directly with our touching the process action
March 5, 2013 6:35 AM
Answer

Kiran Kumar Boyini

Rank: Expert

Posts: 277

Join Date: June 2, 2011

Recent Posts

Hi All,

I want to call the my own method directly with out touching the process action method in mvc portlet.

How it is possible ?

Regards,

Kiran.
David H Nebinger
RE: How to call the my own method directly with our touching the process ac
March 5, 2013 6:41 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 8426

Join Date: September 1, 2006

Recent Posts

Um, magic?

Seriously, how does any method get called? The call must originate somewhere...
Kiran Kumar Boyini
RE: How to call the my own method directly with our touching the process ac
March 6, 2013 10:19 PM
Answer

Kiran Kumar Boyini

Rank: Expert

Posts: 277

Join Date: June 2, 2011

Recent Posts

Hi ,

in jsp code :

1
2<portlet:actionURL  var="edit" name="updateEmployee">
3<portlet:param name="jspPage" value="/updateEmployee.jsp" />
4</portlet:actionURL>


In controller :
1
2public void updateEmployee(ActionRequest request, ActionResponse response){
3               
4                System.out.println("---This is inside the editProduct()-----");
5               
6               
7            }

Is it possible to call updateEmployee() directly using name=updateEmployee property of portlet action url directly or from processAction()
to this method i.e.,updateEmployee().
Regards,
Kiran.
Syed Shabeer Ahmed
RE: How to call the my own method directly with our touching the process ac
March 6, 2013 10:27 PM
Answer

Syed Shabeer Ahmed

Rank: New Member

Posts: 7

Join Date: September 23, 2009

Recent Posts

In view.jsp

<portlet:actionURL var="actionURL" name="updateEmployee"></portlet:actionURL>

<form action="<%=actionURL%>">
// some html here
</form>
---------------------------
In Controller you can write this.

public class EmployeePortlet extends MVCPortlet {

public void updateEmployee(ActionRequest request, ActionResponse response) {
// do some action here
}
}