"Paulo Delgado" <[EMAIL PROTECTED]> writes:
> So I extended QxWindow and added some elements to it, one of the items in my
> window is a QxList. Then I built two functions, one of them to set up the
> layout of my QxWindow and another to update the content of the QxList ..
>
> And this is where I have my problem, I can't access my QxList from within
> another function. How do I do this?
This the following instead. Note the variable 'o' set to 'this' and then 'o'
used in your onreadystatechange event handler...
proto.updateHeaders = function() {
xmlhttp = initXMLHTTP();
xmlhttp.open("GET","?function=blah",true);
var o = this; // ADD
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4) {
o.l1.removeAll(); // CHANGE
alert('ok');
var headers =
xmlhttp.responseXML.getElementsByTagName('data');
for(var idx =0 ; idx < headers.length ; idx++) {
var article = headers[idx];
var title =
article.getElementsByTagName('title')[0].firstChild.nodeValue;
var aid =
article.getElementsByTagName('id')[0].firstChild.nodeValue;
var tmpItem = new QxListItem(title, '', aid);
o.l1.add(tmpItem); // CHANGE
}
}
}
xmlhttp.send(null);
return false;
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel