<portlet:actionURL name="addBook" var="addBookURL" />
<aui:form action="<%= addBookURL.toString() %>" method="post">
I have these two methods inside the MVC Portlet class
public void addBook(ActionRequest request, ActionResponse response) {
}
public void deleteBook(ActionRequest request, ActionResponse response) {
}
In UI , The User can have different actions like Add , Delete Book
Now this is working fine with the method addBook , do i need to write a seperate portlet:actionURL and auiform also in UI for deleteBook Action ??
I am a new to Liferay , so please excuse the silly questions .
If it is so How can there be two forms in one page ??
you’ll need as many methods as you have action names:
If you want to have less methods, but still have the action names, you can also override processAction(ActionRequest request, ActionResponse response) and handle the condition (action name) yourself. If one form does multiple actions, you can handle it in just one action and determine what content you get, e.g. which button has been pushed. Or use Javascript to set the form action URL on submit.