PDA

View Full Version : Data Store using HttpProxy request cancelled by ContentPanel .refresh()



watrboy00
26 Sep 2007, 6:31 PM
To give a little context around my problem I will try to explain what I am doing. I have a drop down menu of departments and when one is clicked it loads the department page in a Content Panel. After the Content Panel url is set using .setURL(), I refresh the Content Panel using .refresh(). Once that is complete I use a Data Store and HttpProxy to retrieve a xml list from my server that returns a list of applications I want to append to a toolbar. My problem is that if I call .refresh() the Data Store fails on the callback (sucess always = false). If I comment out the .refresh() line in my code the Data Store works properly.

I have also notice that if I have the .refresh() line commented out but set a default url to load when I create the Content Panel the Data Store fails in the same way.

Now here is another kicker. It works perfectly in IE6 but does not work in FF2. Firebug shows that it made a request to getDepartmentApplicationsXML.asp and returns a valid xml file. (I can also view getDepartmentApplicationsXML.asp in a separate window and pass it the correct params and it works too). I don't get any scripting errors in FireBug either.

I am pulling my hair out on this one. Anyone have any idea? Thanks.



var DepartmentApplications = function() {
var ds;

return {
init: function() {
/*
*
* DEPARTMENTS MENU DEFAULT APPLICATION LIST
*
*/

ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
method: 'GET',
url: 'getDepartmentApplicationsXML.asp'
}),
reader: new Ext.data.XmlReader({
record: 'item'
}, [
{name: 'id', mapping: 'id'},
{name: 'name', mapping: 'name'},
{name: 'shortname', mapping: 'shortname'},
{name: 'url', mapping: 'url'},
{name: 'description', mapping: 'description'}
]
)
});
},

load: function( options ) {
ds.load({
params: {d: options.department },
callback: function(r, options, success) {
if (success == true) {
ds.each(function(r) {
//alert('add');
}, this);
} else if (success == false) {
Ext.Msg.alert("ERROR", "There was an error parsing the departments toolbar data.");
}
},
scope: this,
add: false
});
}
};
}();

watrboy00
27 Sep 2007, 8:54 PM
Okay after figuring out what signature gets passed to my HttpProxy loadException event I discovered that it errors out because "Permission denied to get property XMLDocument.documentElement".

Doing some more research on this but if anyone has any ideas please let me know.

Thanks.

watrboy00
27 Sep 2007, 8:58 PM
BTW... the page that calls the Data Store and the getDepartmentApplicationsXML.asp file are on the same domain/server. I know that you cannot call a page not on your domain in FF without enabling netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');.

BTW (x2) I should also add that the content type of the returning xml file is text/xml.

watrboy00
28 Sep 2007, 9:33 PM
After looking more at the loadexception return it seems that I am getting a status of 200 but still I get the Permission denied to get property XMLDocument.documentElement error.



Object events=Object conn=Object useAjax=true Object params=Object request=Object reader=Object
Object tId=2 status=200 statusText=OK
Permission denied to get property XMLDocument.documentElement

Animal
28 Sep 2007, 11:10 PM
That is weird that its enforcing some kind of security around the document element. Are there any different headers in the HTTP response which FF might read?

Is your page being served through HTTPS?

watrboy00
29 Sep 2007, 8:15 PM
No extra headers and is using standard http protocol. Tried returning the xml structure via ASP & ASP.Net 2.0 and same results.

What is also is weird is I have 2 other data stores that are feed a very similar xml structure and the only real difference between those 2 and the one that doesn't work is the url and params that are sent along with the request. They on the other hand work perfectly without any errors.

I am at a lost. Any other ideas?

Animal
29 Sep 2007, 10:49 PM
Are you setting the Content-Type header to "text/xml"?

watrboy00
30 Sep 2007, 6:58 AM
BTW (x2) I should also add that the content type of the returning xml file is text/xml.


Yes I am.

watrboy00
4 Oct 2007, 9:13 AM
BUMP

Animal
4 Oct 2007, 10:59 PM
Which adapter are you using?

It could be some kind of collision in the Ajax infrastructure with this refresh() call walking on the XHR that's being used by the HttpProxy's Connection.

watrboy00
5 Oct 2007, 11:11 AM
ext-base.js