留言板
Ajax load only working once
Hi,
I have a List of elements and I would like the information of every element and display it in a area. The loading of the information workes ones and than I only get the loading indicator and not the content.
Do I need to somehow terminate the function? Or is there a problem that I can only load the informatione once?
Thanks
Robert
I have a List of elements and I would like the information of every element and display it in a area. The loading of the information workes ones and than I only get the loading indicator and not the content.
<aui:script use="aui-base,aui-io-request">
window.patientselected = function (patientid) {
AUI().use('aui-io-request', function(A){
var contentNode = A.one('#contentNode');
if(contentNode) {
contentNode.html('<div class="loading-animation"></div>');
A.one('#contentNode').load('/web/guest/iris/-/iris/' + patientid);
}
});}
</aui:script>
Do I need to somehow terminate the function? Or is there a problem that I can only load the informatione once?
Thanks
Robert
Hi
Which version of Liferay are you using .. follow the article it may help you or give some idea
http://www.liferaysavvy.com/2014/06/liferay-62-aui-dialog-liferay-popup.html
Regards,
Meera Prince
Which version of Liferay are you using .. follow the article it may help you or give some idea
http://www.liferaysavvy.com/2014/06/liferay-62-aui-dialog-liferay-popup.html
Regards,
Meera Prince
Thank you for the link, I am using Liferay 6.2 CE. I think it is a caching problem. It loads the list time but it dose not load the next load attemt. I tried to add an random string to the url but the same problem.
Best
Robert
Best
Robert
I have solved the problem. I am using now the request methode and not the load function.
<aui:script use="aui-base,aui-io-request">
AUI().ready(
'aui-base',
'aui-io-request',
function(A) {
A.all('.testlink').each(function() {
this.on('click', function(event){
var url = event.currentTarget.getAttribute('testtmp');
A.io.request(url,{
on: {
failure: function() { alert('Unable to Load Data'); },
success: function() { A.one('#contentNode').setHTML(this.get('responseData')) }
}
});
});
});
});
</aui:script>