You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-dev@incubator.apache.org by "Turyn, Michael (JIRA)" <xa...@incubator.apache.org> on 2007/03/04 17:28:50 UTC
[jira] Closed: (XAP-80) setupClassAsSubclassOf() has some
unexpected behavior
[ https://issues.apache.org/jira/browse/XAP-80?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Turyn, Michael closed XAP-80.
-----------------------------
Resolution: Fixed
Implemented changes as described in comment:
prototype.superclass--->constructor.superclass
and --> prototype.superclass() .
> setupClassAsSubclassOf() has some unexpected behavior
> -----------------------------------------------------
>
> Key: XAP-80
> URL: https://issues.apache.org/jira/browse/XAP-80
> Project: XAP
> Issue Type: Bug
> Reporter: James Margaris
>
> In TableBridge I have the following:
> xap.bridges.dojo.TableBridge.prototype.init = function() {
> this.superclass.init.call(this);
> //add listener last so we don't fire for the initial set
> dojo.event.connect(this.getPeer(), "onActivateRow",this,"onActivateRow");
> dojo.event.connect(this.getPeer(), "onSelectRow",this,"onSelectRow");
> dojo.event.connect(this.getPeer(), "onDeselectRow",this,"onDeselectRow");
> dojo.event.connect(this.getPeer(), "onExpandRow",this,"onExpandRow");
> }
> Now I set up a subclass of table bridge that does NOT override init.:
> /**
> * @fileoverview
> *
> * A bridge class with dojo toolkit box panel peer.
> */
>
> xap.bridges.dojo.TreeBridge= function() {
> xap.bridges.dojo.TableBridge.call(this);
> }
> Xap.setupClassAsSubclassOf(
> "xap.bridges.dojo.TreeBridge",
> "xap.bridges.dojo.TableBridge"
> );
> When you map a tag to treeBridge and run, you get an infinite recursion.
> If I change the init call in TableBridge to do:
> xap.bridges.dojo.DojoWidgetBridge.prototype.init.call(this);
> It works fine.
> It seems to me that what is happening here:
> We look for an init() and find one in TreeBridge that is actually the version from TableBridge
> We run that init
> The this.superclass call, since we are technically in TreeBridge, maps to the TableBridge (?) method
> Some recursion occurs ??
> We should look at how dojo works, there instead of:
> this.superclass
> You do:
> xap.bridges.TreeBridge.superclass
> Avoiding the use of "this" which has some context issues..
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.