puki
puki

Reputation: 33

In which moment a widget is added to the dijit registry

I'm a dojo newbie and i'm receiving

TypeError: registry.byId("aDojoView") is undefined

when i'm looking for a dojo view using registry.byId()

I put some logs on DOM ready and load, and appear before the error. So the DOM is already parsed by that time.

I tried to look in dijit's documentation but i haven't found how and when the widgets are added to the dijit's registry. I wonder if there is some kind of event triggered too

Upvotes: 0

Views: 84

Answers (1)

GibboK
GibboK

Reputation: 73908

Please look at source code of _WidgetBase.js at line 428, visible here. It looks like that a widget object is being added to registry in the create function, so after execution of postMixInProperties and postMixInProperties.

Here below dijit life-cycle:

postMixInProperties
buildRendering
-- widget instance added to the registry here
postCreate
create
postscript
startup

Upvotes: 1

Related Questions