PDA

View Full Version : Repeated to open web page after pollProvider



volcom721
24 Jul 2012, 2:05 AM
Hello sencha:
I has a problem here. In normal, if i execute function1 and browser will open the web page "test1.html" once. But if i add a poll provider like execute function2, and then execute function1 after function2 finish, browser will open the web page "test1.html" twice. If i execute function2 tree time then execute function1, the browser will open the web page tree time. Why happen this?:-/ is there has some parameter i am not setting? or i didn't close the provider correct? please help me, i am so confused here:((, thanks.



#Function1:
window.open('../web/test1.html');

#Function2:
Ext.direct.Manager.addProvider({
type:'polling',
url: '../Svr.php',
interval: 3000,
id: "provider1",
baseParams:{ 'func':'homeMgr', 'op':'getProcessStatus', 'proId': 'provider1' },
listeners: {
data: function(provider, event){
var proResult = event.proResult;
if( proResult == "finish" ){
Ext.direct.Manager.getProvider( proId ).disconnect();
Ext.direct.Manager.removeProvider( proId );
Ext.getCmp(pbWinvId).close();
}
}
}
});

volcom721
25 Jul 2012, 3:38 AM
I still can't solve this problem now. Does any one can help me, i will so thank.

volcom721
26 Jul 2012, 5:52 AM
I just know why happen this problem, because i execute init() before add provider, like this:


var homeCol = me.getController('home.HomeCol');
homeCol.init();

So every time i execute it, browser will open web page more once.
But why? i was read the document, but i still don't know why?:-/