Foren

A.plugin.io substitude in Alloyui 2+

Johan de jong, geändert vor 8 Jahren.

A.plugin.io substitude in Alloyui 2+

Junior Member Beiträge: 41 Beitrittsdatum: 06.02.12 Neueste Beiträge
In Liferay 6.1 I use A.plugin.io for a tabbed view ( aui-tabs) where each tab contains refresh-able information.

On my move to 6.2+ i see that the A.plugin.io is not available. So i can not plug every tab to an io periodic refresh anymore.
Does anyone know a substitute for this?

old code example:

AUI().use('aui-tabview','aui-io-request',function (A) {
	var myCounter=0;
	var target1 = A.one('#tab1');
	target1.plug(A.Plugin.IO, {
		failureMessage: 'loading section.',
		autoLoad: true,
		hideLoading:true,
		cache: false,
		uri: 'some_uri'
	});	
	var bax;
	bax=setInterval(function() {target1.io.start();myCounter++; if (myCounter>20) { location.reload(true);} },8000);
// above line is needed when the loaded file was large and some browser accidentally keep caching the page after every refresh// 
});
thumbnail
Julien Mourad, geändert vor 8 Jahren.

RE: A.plugin.io substitude in Alloyui 2+

Junior Member Beiträge: 78 Beitrittsdatum: 22.01.15 Neueste Beiträge

AUI().use(
	'aui-tabview',
	'aui-io-request',
	'io-plugin',
	function (A) {
		var myCounter=0;
		var target1 = A.one('#tab1');

		target1.plug( A.Plugin.IO, { uri: 'test.html' } );
	}
);


As an alternative, you can use:


AUI().use(
	'aui-tabview',
	'aui-io-request',
	function (A) {
		var myCounter=0;
		var target1 = A.one('#tab1');

		target1.html('<div class="loading-animation"></div>');

		A.io.request( 'test.html' , {
		    on: {
		    	success: function(event, id, xhr) {
		    		target1.html( this.get('responseData') );
		    	}
		    }
		});
	}
);