[dojo-contributors] Re: stripped id tags

Andy Smith andyster at gmail.com
Wed Apr 12 09:34:41 EDT 2006


My understanding was that you should be referring to the widget via
dojo.widget.byId() anyway, and that the code above functions as a
safe-guard to prevent somebody from assigning the same ID to multiple
instantiations of the widget (i.e. they hardcoded an id in the widget
template).

I personally would feel mildly worried if I saw <div
id="${this.widgetId}">....</div> in a template because I would then
expect a developer to be relying on something that changes shape
somewhere in the middle of the page load.

On 4/8/06, Bill Keese <bill at dojotoolkit.org> wrote:
> The widget instantiation code strips out any id tags in the template,
> making templates like this impossible:
>
> <div id="${this.widgetId}">....</div>
>
> The culprit is this code from DomWidget.js:
>
> // strip IDs to prevent dupes. removeAttribute() doesnt care if
> attribute doesnt exist
> baseNode.removeAttribute('id');
>
> This must be referring to the source domnode vs. the target domnode, but
> the code seems to do more harm than good, since in the typical case the
> source domnode gets dropped anyway.
>
> Any objections if I remove that line?
>
> --
>
> Bill
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors
>



More information about the dojo-contributors mailing list