Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#18595 closed defect (fixed)

[regression] StackContainer: children's getNextSibling() methods return null

Reported by: srikanth_desu Owned by: bill
Priority: undecided Milestone: 1.9.8
Component: Dijit Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:

Description

Hi,

We have upgraded dojo version from 1.7.3 to 1.10.4 in our application.After upgrade getNextSibling method of _Contained retuning null instead of resulting next sibling.

Below is the code example which is working fine in 1.7.3 and not working in 1.10.4.

code:

var wizard = new widget.wizard.Wizard({}, “some Div in template”);
             wizard.addWizard(); 
             wizard.startup();

Wizard.js code:

dojo.provide("widget.wizard.Wizard");

dojo.require("dojo.parser");
dojo.require("dijit.layout.StackContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit._Contained");
dojo.require("dijit._Container");

dojo.declare("widget.wizard.Wizard", [dijit.layout.StackContainer], {

    doLayout: false,

    startup: function () {
       
        if (this._started) { return; }
        this.inherited(arguments);
        
        var selected = this.selectedChildWidget.getNextSibling();        
        alert(selected); //Returning null after upgrade

    },

    addWizard: function () {
        this.addStep("one");
        this.addStep("two");
        this.addStep("three");
    },

    addStep: function (wizardStep) {
       
        var pane = new widget.wizard.WizardPane({ content: wizardStep });
        this.addChild(pane);
    }

});

dojo.declare("widget.wizard.WizardPane",
	[dijit.layout.ContentPane, dijit._Contained, dijit._Container], {

	 doLayout: false,
	  
         startup: function () {
            if (this._started) { return; }
            this.inherited(arguments);
        }	   

});

Attachments (1)

wizard.html (728 bytes) - added by bill 5 years ago.
reduced test case

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by bill

Milestone: tbd1.9.8
Status: newassigned
Summary: getNextSibling method of _Contained returning null after dojo upgrade[regression] StackContainer: children's getNextSibling() methods return null

I see. Starting from c7b1d29e31e2b209966ee902f3d5c5f0e6299c60, each StackContainer? child is put inside of its own <div.dijitStackContainerChildWrapper>, and _Contained#_getNextSibling() is not set up to handle that.

Note that _Container.getChildren() ignores the <div.dijitStackContainerChildWrapper> wrapper because the wrapper is not a widget, and thus _Container._getSiblingOfChild() works correctly.

Changed 5 years ago by bill

Attachment: wizard.html added

reduced test case

comment:2 in reply to:  1 Changed 5 years ago by srikanth_desu

Thanks for your prompt response. Is there any workaround (code patch/customization) can be done to make these methods(getNextSibling/getPreviousSibling) work with my current version of Dojo (1.10.4)?

Replying to bill:

I see. Starting from c7b1d29e31e2b209966ee902f3d5c5f0e6299c60, each StackContainer? child is put inside of its own <div.dijitStackContainerChildWrapper>, and _Contained#_getNextSibling() is not set up to handle that.

Note that _Container.getChildren() ignores the <div.dijitStackContainerChildWrapper> wrapper because the wrapper is not a widget, and thus _Container._getSiblingOfChild() works correctly.

comment:3 Changed 5 years ago by bill

I'm working on a patch now. I just rewrote _Contained#_getSibling() as:

_getSibling: function(/*String*/ which){
	var p = this.getParent();
	return (p && p._getSiblingOfChild && p._getSiblingOfChild(this, which == "previous" ? -1 : 1)) || null;
},

And then removed the deprecation warning from _Container#_getSiblingOfChild().

comment:4 Changed 5 years ago by Bill Keese <bill@…>

Resolution: fixed
Status: assignedclosed

In 1f08211d612c5a7b6082486c23dc2b5d765941fe/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:5 Changed 5 years ago by Bill Keese <bill@…>

In 806359ba57461277f234048ac52a977b7240d503/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:6 Changed 5 years ago by Bill Keese <bill@…>

In 70d3d1212c37850226f18fdbc72f8ad8e4c36393/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.