[Dojo-interest] Widget startup() called twice

K.L. coviex at gmail.com
Sun Sep 27 07:03:27 EDT 2009


Of course I can set a flag, but I was wondering if it's dojo's
intended behaviour to call startup() twice and if there is other
methods I can hook to find out that child widgets have been
constructed.

On Sat, Sep 26, 2009 at 5:28 PM, Bill Keese <wkeese at gmail.com> wrote:

> Yah, that's likely that we call startup() twice in some situations because
> we aren't sure if it's already been called or not.
> Why not just set a flag (this._myStartupWasRun = true) so you can just
> return the second time?
>
> On Fri, Sep 25, 2009 at 2:07 AM, K.L. <coviex at gmail.com> wrote:
>>
>> I have a script which loads content via xhrGet() and inserts loaded
>> data into dojox.layout.ContentPane via oPaneInstance.attr('content',
>> data).
>>
>> Data loaded contains markup widgets (form widgets, tabs etc).
>> Widget of major interest is dijit.form.form. Right after openning tag
>> it has code like this:
>>
>>        --script type="dojo/connect" event="startup"--
>>            console.log(this.id);
>>            // real func which adds interactivity to child comboboxes goes
>> here
>>        --/script--
>>
>> And the problem is that console.log() called twice. (Debugger says it
>> is called once on openning tag and once on closing tag). This ruins my
>> real function and I don't understand why it is called twice.
>>
>> I tried to use "oPaneInstance.containerNode.innerHTML = data;
>> dojo.parser.parse();" instead of "oPaneInstance.attr('content',
>> data)". This makes console.log()  to be called only once, and
>> everything's ok with other contentpanes and comboxes, but TabContainer
>> is not started. oPaneInstance.startup() doesn't help.
>> I'm stuck. Help!

Regards,
Kostia


More information about the Dojo-interest mailing list