Hi,
as you didn't give very detailed information about your circumstances (which version of qooxdoo) and the exact kind of error you're getting, I can only assume, what's not working.

Am 25.01.2006 22:44, Michael Wilson schrieb:
<snip file="myTree.js">
function myTree(vLable)
{
  QxTree.call(this, vLable);
this.setBackgroundColor("white");
  this.setBorder(QxBorderObject.presets.inset);
  this.setOverflow("scrollY");
this._ajax = new QxXmlHttpLoader(); this._ajax.addEventListener('complete', function(e) {
      // get result value
      var xml = e.getNewValue();
var n_pk_search = xml.selectNodes("//pk_search");
      var n_str_name = xml.selectNodes("//str_name");
      var n_str_description = xml.selectNodes("//str_description");
      var n_str_where = xml.selectNodes("//str_where");
      var n_str_notes = xml.selectNodes("//str_notes");
      var n_n_last_count = xml.selectNodes("//n_last_count");
for (var i=0; i < n_str_name.length; i++) {
        alert(n_str_name[i].text);  // I can see that I get data back
var folder = new QxTreeFolder(n_str_name[i].text); QxTree.prototype.add.call(this.folder); // folders never show
up

I assume this is your problematic area.

Why are you referencing the "folder" variable by "this.folder" here, while declaring it as a local variable via "var"? And why don't you call "add()" on your instance of QxTree but instead via the prototype? If you want to keep this coding style and use a closure as event listener, then do something like

<code>
var currentTree = this;
</code>

before adding the eventlistener, and then make the call to add() like this:

<code>
currentTree.add(folder);
</code>

But I recommend refactoring the event listener into an instance method of your tree class and adding the event listener like this:

<code>
this._ajax.addEventListener('complete', this.<yourMethodName>, this);
</code>

If this doesn't help, or I miss your point ;) then please post more details of your case, along with exact error messages.

Cheers

Benjamin


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
Qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to