Discussion:
[Dojo-interest] data-dojo-type not removed after parse
allnamesrtaken
2011-11-03 11:35:06 UTC
Permalink
Problem:
I have 2 widgets, one containing a dijit.form.TextBox and the other
containing a dijit.layout.BorderContainer with a dijit.layout.ContentPane in
the center region.

If I only place them in the body and run parser.parse(), both get rendered
BUT: the TextBox looses its data-dojo-type attribute, while the
BorderContainer and the ContentPane dont.

if I run parse again on the page with the textbox it just passes and all is
good but on the bordercontainer page i get:
Error: Tried to register widget with id==dijit_layout_BorderContainer_0 but
that id is already registered

Id can of course be exchanged to whatever you want.

Rendered HTML for the container widget is

<div id="page1" class="Page" style="position: relative; display:
inline-block; height: 100%; width: 800px; " widgetid="page1">
<div data-dojo-type="dijit.layout.BorderContainer"
data-dojo-props="design: 'headline', gutters: true " style="width: 100%;
height: 100%; padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
padding-left: 0px; " class="dijitBorderContainer dijitContainer
dijitLayoutContainer" id="dijit_layout_BorderContainer_0"
widgetid="dijit_layout_BorderContainer_0">
page1
<div data-dojo-type="dijit.layout.ContentPane"
data-dojo-props="region: 'center'" data-dojo-attach-point="_center"
class="dijitContentPane dijitBorderContainer-child
dijitBorderContainer-dijitContentPane dijitBorderContainerPane
dijitAlignCenter" title="" role="group" id="dijit_layout_ContentPane_0"
widgetid="dijit_layout_ContentPane_0" style="position: absolute; left: 5px;
top: 5px; width: 772px; height: 99px; ">
</div>

</div>
</div>

Here you see that the data-dojo-type is still there and dojo tries to parse
again.

Is this a bug or is it intended???

Thanks,
Jeoel

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/data-dojo-type-not-removed-after-parse-tp3476854p3476854.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
Bill Keese
2011-11-06 10:47:26 UTC
Permalink
Sounds like the data-dojo-type isn't getting removed on widgets that don't
have a template. This is expected (although I guess it would avoid
confusion if the data-dojo-type was always removed). The solution is to
only run the parser once.
Post by allnamesrtaken
I have 2 widgets, one containing a dijit.form.TextBox and the other
containing a dijit.layout.BorderContainer with a dijit.layout.ContentPane in
the center region.
If I only place them in the body and run parser.parse(), both get rendered
BUT: the TextBox looses its data-dojo-type attribute, while the
BorderContainer and the ContentPane dont.
if I run parse again on the page with the textbox it just passes and all is
Error: Tried to register widget with id==dijit_layout_BorderContainer_0 but
that id is already registered
Id can of course be exchanged to whatever you want.
Rendered HTML for the container widget is
inline-block; height: 100%; width: 800px; " widgetid="page1">
<div data-dojo-type="dijit.layout.BorderContainer"
data-dojo-props="design: 'headline', gutters: true " style="width: 100%;
height: 100%; padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
padding-left: 0px; " class="dijitBorderContainer dijitContainer
dijitLayoutContainer" id="dijit_layout_BorderContainer_0"
widgetid="dijit_layout_BorderContainer_0">
page1
<div data-dojo-type="dijit.layout.ContentPane"
data-dojo-props="region: 'center'" data-dojo-attach-point="_center"
class="dijitContentPane dijitBorderContainer-child
dijitBorderContainer-dijitContentPane dijitBorderContainerPane
dijitAlignCenter" title="" role="group" id="dijit_layout_ContentPane_0"
widgetid="dijit_layout_ContentPane_0" style="position: absolute; left: 5px;
top: 5px; width: 772px; height: 99px; ">
</div>
</div>
</div>
Here you see that the data-dojo-type is still there and dojo tries to parse
again.
Is this a bug or is it intended???
Thanks,
Jeoel
--
http://dojo-toolkit.33424.n3.nabble.com/data-dojo-type-not-removed-after-parse-tp3476854p3476854.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...