I see where my error was, thank you :)
Thank you, Paulo Delgado Senior Developer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A I S M e d i a , I n c . - "We Build eBusinesses" 7000 Central Parkway, Suite 1700 Atlanta, GA 30328 Tel: 770.350.7998 / Fax: 770.350.9409 http://www.aismedia.com / [EMAIL PROTECTED] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, June 05, 2006 11:09 PM To: Discuss the newest development of qooxdoo Subject: Re: [qooxdoo-devel] Extending QxWindow and using the elements in it. "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 _______________________________________________ Qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
