I am using Liferay 6 for development.
I have added JQuery support to Liferay this way inside the file liferay-portlet.xml
file
<header-portlet-javascript>https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js</header-portlet-javascript>
<header-portlet-javascript>https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js</header-portlet-javascript>
Now I have a form with Username and password as shown below:
<form>
<div>
<input class="default-value" type="text" name="Name" value="Name" />
<input class="default-value" type="text" name="Password" value="Password" />
</div>
</form>
<div class="fieldgroup">
<input type="submit" value="Register" class="submit">
</div>
<liferay-portlet:actionURL name="registerUser" var="registerUserURL"></liferay-portlet:actionURL>
I have a CustomPortlet as shown below , and added this inside the portlet.xml file as shown
<portlet>
<portlet-name>Second</portlet-name>
<display-name>Second</display-name>
<portlet-class>com.SecondPort</portlet-class>
public class SecondPort extends MVCPortlet {
public void registerUser(ActionRequest request, ActionResponse response)
{
// Some code here with respect to the registerUser .
}
}
Now please tell me on click of the Submit Button on the JSP Page, how can I call this registerUser
method??
<input type="submit" value="Register" class="submit">
Please let me know, thanks in advance .