[EMAIL PROTECTED] writes:

> I have a test application (based on example/TreeVirtual_3.html) that works
> fine if the tree is instantiated using
>
>   tree = new qx.ui.treevirtual.TreeVirtual(headings);
>
> It fails, though, if I subclass TreeVirtual like this:
>
> qx.Clazz.define("myclass.widget.tree.Tree",
> {
>   extend : qx.ui.treevirtual.TreeVirtual,
>
>   construct : function(headings)
>   {
>     this.base(arguments, headings);
>   }
> });
>
> and then instantiate the tree using
>
>   tree = new myclass.widget.tree.Tree(headings);
>
> The error produced is:
>
> 002970 ERROR: myclass.widget.tree.Tree[434]: Modification of property 
> "tableModel" failed with exception: Error - Objects of class 
> 'myclass.widget.tree.Tree' do not support the event 'appear' 
>
> It's failing in Target.js:89 due to the event being "unsupported".
>
> Am I doing something wrong, or is this a bug in Clazz.js?

Hmmm...  It looks like I need to list every event that any superclass listens
for in an "events" array.  This means that I need to search through all
superclasses looking for what events are listened for.  I expect that once the
framework gets 0.7-ized, all of the @event hints will get converted somehow,
but it seems that it's the addEventListener() that's important here, not the
dispatchEvents() which are what are associated with the @event hints.  How is
this going to work?

Ok, for the benefit of anyone else trying to extend an existing class, you
need to do something like this (which I've arrived at by trial and error; I'm
sure I'm not done yet. :-) ...

qx.Clazz.define("myclass.widget.tree.Tree",
{
  extend : qx.ui.treevirtual.TreeVirtual,

  construct : function(headings)
  {
    this.base(arguments, headings);
  },

  events :
  [
    "appear",
    "tableWidthChanged",
    "verticalScrollBarChanged"
  ]
});


BTW, "events" is not documented at
<http://qooxdoo.org/documentation/articles/proposed_class_declaration_for_qooxdoo_0.7?s=clazz>
which is the only place I know of that this structure is documented.  Is there
additional documentation, or was "events" inadvertently left out of the docs?

Cheers,

Derrell

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to