Saturday 12 November 2011

Submiting the form with partial page refresh by using alloy-ui

Well i was looking out to submit the form without refreshing the page in Liferay 6. I used Alloy to submit the form
Here is the code that i wrote in jsp file
<portlet:actionURL var=”ajaxURL” windowState=”<%= LiferayWindowState.EXCLUSIVE.toString()%>” />
<aui:script use=”aui-io-request,aui-node” >
Liferay.provide(
window,
‘submitForm’,
function() {
var A = AUI();
A.io.request(‘<%= ajaxURL %>’,{
method: ‘POST’,
form: { id: ‘<portlet:namespace />fm’ },
on: {
success: function(){
alert(“succefully submitted”);
}
}
});
});
</aui:script >
<form action=”<portlet:actionURL/>” method=”POST” id=”<portlet:namespace />fm” name=”<portlet:namespace />fm” >
<input type=”text” name=”<portlet:namespace />companyName”/>
<input type=”submit” value=”submit form”/>

No comments:

Post a Comment