View Full Version : XMLReader in IE
I use the dataStore.reload function to get a dynamically generated xml file from server. It works perfectly fine in FF. But IE seems only reload the xml file from cache instead of the server. Refresh the page wouldn't help either, I only can close the current IE window and open a new one to reflect the change in Grid.
On the side note, how the new HttpProxy + XMLDataReader can only read xml data with file ext 'xml'?
I'm using the ext 1.0 alpha 2, IE 7
I realize this is not a Ext library problem. In case you have similar experience please help.
Thanks
jay@moduscreate.com
9 Mar 2007, 11:12 AM
Could it be due to a proxy issue?
tryanDLS
9 Mar 2007, 11:13 AM
This has been discussed a few times in the forum. Basically the solution is to add an everchanging cache-buster parm to url (say a timestamp) to keep IE from caching the request. Do some searches here - this may now be a cofigurable option on the proxy, or you could just add it to the parms collection.
cwells
25 May 2007, 1:56 PM
This is a really common problem and I'm surprised that it isn't handled by the library. So surprised, in fact, that I just spent a goodly portion of my morning debugging this even though I was already aware of IE6's AJAX caching issues (I mistakenly assumed that YUI or Ext would be compensating for this IE bug).
It doesn't appear that there's an option for HttpProxy at this point (1.0.1) for cache-busting, maybe we could at least get a sticky example on the forum to help people not waste time over what's got to be a really common issue? Searching this forum isn't too helpful and the documentation doesn't mention it at all.
tryanDLS
25 May 2007, 2:21 PM
I don't think it that common a problem, b/c in most cases your doing a request with params, so it does a POST, which should never be cached (and you're the only response to my post in 2.5 months :) )
That being said, it would seem to make sense to add the nocache config that's currently in ScriptTagProxy to HttpProxy.
cwells
25 May 2007, 2:41 PM
In my case, there are no params. Rather the information is stored in a cookie. Therefore I request the same URL over and over and expect different results (definition of insanity?) based on the value of the cookie (it's semi-persistent data that would be painful to constantly pass around).
tryanDLS
25 May 2007, 3:18 PM
In the interim, you could do
yourproxy.load({method:'POST'} // this could also be done as config at create
assuming doing a POST instead of GET won't cause you additional issues.
cwells
25 May 2007, 3:24 PM
Thanks for the speedy reply.
However I'm using it (as a data source for a grid) like this:
var ds = new Ext.data.Store ( {
proxy: new Ext.data.HttpProxy ( {
url: '/account/phones_xml'
} ),
reader: new Ext.data.XmlReader ( {
record: 'record'
}, Phone )
} );
I've tried adding method: 'POST' to the proxy parameters to no avail and it's not clear to me how I could affect the load() method at this point since it's called on my behalf by the Store object.
cwells
25 May 2007, 3:32 PM
Okay, I see that setting POST did work, except my webserver throws a 411 (length required) error. I assume this is because there is no actual form associated with the request. Any suggestions?
tryanDLS
25 May 2007, 3:46 PM
var ds = new Ext.data.Store ({
proxy: new Ext.data.HttpProxy ( {
url: '/account/phones_xml', method:'POST'
}),
reader: new Ext.data.XmlReader ( {
record: 'record'
}, Phone )
});
method should end up as property of the Connection object when the proxy ctor fires - do you not see this if you step thru the code?
Alternately, you should be able set it in the baseParams property of the store either in the config or after construction.
cwells
25 May 2007, 3:48 PM
In the sad habit of replying to myself, I found a workaround:
var proxy = new Ext.data.HttpProxy ( {
url: '/account/phones_xml',
method: 'POST'
} );
proxy.on ( 'beforeload', function ( t, p ) { p.nocache = 1; } );
var ds = new Ext.data.Store ( {
proxy: proxy,
reader: new Ext.data.XmlReader ( {
record: 'record'
}, Phone )
} );
Kind of extravagant, but I hope that helps anyone else with this particular issue.
Herm
21 Jul 2007, 12:33 AM
Late to the party but you could do the global Ext.Ajax thang that Jack suggests here http://extjs.com/forum/showthread.php?p=45277#post45277
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.