PDA

View Full Version : UpdateManager.refresh not performing POST with params



Domitian
23 May 2007, 10:47 AM
Hey All, I was wondering if anyone else ran into this problem. I have an element that had the update method from UpdateManager performed on it. It updated correctly. I added a refresh button that retrieves the updateManager from the element and calls refresh. When stepping through the update method in firebug, the params parameter appears to be there when I hover, but in the watch list it's null. This affects my refresh, b/c it should be passing those params. Has anyone else experienced the same issue?

tryanDLS
23 May 2007, 11:14 AM
What does your call look like? Are you passing params as part of an object in the 1st arg or as a standalone object in the 2nd arg?

Domitian
23 May 2007, 1:34 PM
I'm passing in parameters standalone in the second argument, like so:



mgr.update(cgi, parameters, '', false);

tryanDLS
23 May 2007, 2:08 PM
Try taking a look at the buf array after it calls encodeURIComponent. Is there a problem that's maybe causing the subsequent join call to return a null?

Domitian
24 May 2007, 8:55 AM
It looks like the problem is in the refresh method.



refresh : function(callback){
if(this.defaultUrl == null){
return;
}
his.update(this.defaultUrl, null, callback, true);
}


The second parameter of the update is the passed params, but the method passes null. Is it supposed to be like that? Shouldn't be something to the equivalent of this.params?

tryanDLS
24 May 2007, 9:42 AM
I'm not sure why that works that way. But I thought you were just calling update directly??

Domitian
24 May 2007, 10:20 AM
I am initially, but I put a refresh button in my interface and I wanted to use the mgr.refresh method. As a workaround I reconstructed a refresh myself, but I think there's a bug in the code. I tried passing in params as a second parameter in the refresh method and it worked correctly. Would you know why he would pass null in as the second param?

tryanDLS
24 May 2007, 12:00 PM
The intent of refresh was that it would reuse the last set of params, not pass new ones. However, I think that may process may be broken right now. In any case, if you need to pass new params, you should be calling update, not refresh.

Domitian
24 May 2007, 12:59 PM
Well, I don't need to pass another set of params. I just wanted to reuse the value that was initially set when the first update occurred. According to the code, I don't see how refresh is going to pass any parameters. It appears that when refresh is calling update it is explicitly setting params to null even though I set it initially when I made my first call. It looks as if the update call inside refresh shouldn't pass null.

tryanDLS
24 May 2007, 1:52 PM
That's what I have Jack looking at. Refresh shouldn't pass parms in any case, but update should be able to reuse the existing ones - it's just not saving them right now as far as I can tell.

Domitian
24 May 2007, 2:02 PM
I've also run into this problem in startAutoRefresh. It appears like there is something inherently wrong with the UpdateManager. Here's what I'm doing to set the autoRefresh.



el = Ext.get(showDiv);
manager = el.getUpdateManager();
manager.startAutoRefresh(10);


I'm using this in the meantime


manager.startAutoRefresh(10, _cgi, _params);

tryanDLS
24 May 2007, 2:10 PM
autoRefresh doesn't call refresh - it calls update, so you have to pass the params (assuming that a fix goes in to keep the old params that won't be necessary). Also, if you don't pass url, it uses the previous url - however this implies that you called update once passing an url or called setDefaultUrl.

Domitian
24 May 2007, 2:16 PM
Yeah, when I looked at the code, it looked like that's the way it worked. The URL passed okay, but the params issue still existed. I just wanted to let you know the problem was affecting the the autoRefresh as well.