Fórum
How to submit poll without page refresh using ajax
Dhandapani S, modificado 8 Anos atrás.
How to submit poll without page refresh using ajax
Regular Member Postagens: 176 Data de Entrada: 24/03/09 Postagens Recentes
Dear all,
I want to submit poll without page refresh. Can someone help on this? Currently, In OOTB polls portlet, when you submit poll answer, the whole page is refreshing.
I want to submit poll without page refresh. Can someone help on this? Currently, In OOTB polls portlet, when you submit poll answer, the whole page is refreshing.
David H Nebinger, modificado 8 Anos atrás.
RE: How to submit poll without page refresh using ajax
Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
You'll have to code it up yourself.
Dhandapani S, modificado 8 Anos atrás.
RE: How to submit poll without page refresh using ajax
Regular Member Postagens: 176 Data de Entrada: 24/03/09 Postagens Recentes
Dear David,
in my custom portlet i can do it very well, but i want to know how can i customize the OOTB Polls portlet to achieve the same.
in my custom portlet i can do it very well, but i want to know how can i customize the OOTB Polls portlet to achieve the same.
David H Nebinger, modificado 8 Anos atrás.
RE: How to submit poll without page refresh using ajax
Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
There's no switch in there that is labeled "Turn on for AJAX submission". It's simply not there. You'd have to roll it all yourself.
Dhandapani S, modificado 8 Anos atrás.
RE: How to submit poll without page refresh using ajax (Resposta)
Regular Member Postagens: 176 Data de Entrada: 24/03/09 Postagens Recentes
I have achieved using AUI like below.
<portlet:actionURL var="formsubmissionURL" />
<aui:script use="aui-io-request,aui-node" >
Liferay.provide(window,'submitForm',
function() {
var A = AUI();
A.io.request('${formsubmissionURL}',{
method: 'POST',
form: { id: '<portlet:namespace />fm' },
on: {
success: function(){
}
}
});
});
</aui:script >
<aui:form action="#" method="POST" id="fm" name="fm" >
<aui:input type="text" name="name"/>
<aui:button type="submit" value="Save" />
</aui:form>
<portlet:actionURL var="formsubmissionURL" />
<aui:script use="aui-io-request,aui-node" >
Liferay.provide(window,'submitForm',
function() {
var A = AUI();
A.io.request('${formsubmissionURL}',{
method: 'POST',
form: { id: '<portlet:namespace />fm' },
on: {
success: function(){
}
}
});
});
</aui:script >
<aui:form action="#" method="POST" id="fm" name="fm" >
<aui:input type="text" name="name"/>
<aui:button type="submit" value="Save" />
</aui:form>