留言板

Ajax load only working once

Robert Reihs,修改在9 年前。

Ajax load only working once

Junior Member 帖子: 29 加入日期: 12-12-14 最近的帖子
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.


<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
thumbnail
Meera Prince,修改在9 年前。

RE: Ajax load only working once

Liferay Legend 帖子: 1111 加入日期: 11-2-8 最近的帖子
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
Robert Reihs,修改在9 年前。

RE: Ajax load only working once

Junior Member 帖子: 29 加入日期: 12-12-14 最近的帖子
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
Robert Reihs,修改在9 年前。

RE: Ajax load only working once

Junior Member 帖子: 29 加入日期: 12-12-14 最近的帖子
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>