AnsweredAssumed Answered

dojo error with measure tool

Question asked by AndrewPratt on Nov 6, 2013
Latest reply on May 18, 2015 by epfirman
I am trying to build a ERSI webmap using the 3.7 API and dojo and all has been going well until I tried to get the measure tool working. I have an accordion content view on the left side and I'm trying to push the measure tool into that DIV but I'm getting the following dojo error

Error: Tried to register widget with id==dijit_layout_ContentPane_1 but that id is already registered
Line 1396

If I place the measure div outside the Accordion section it works fine but that's not ideal. I think it is the way this tool is natively set to be wrapped in its own container and by default builds a Contentpane for it...but how do I get around that?

var measurement = new esri.dijit.Measurement({
          }, dojo.byId('measurement'));

      <div data-dojo-type="dijit.layout.ContentPane" id="leftPane" data-dojo-props="region:'left'">
            <!-- start AccordionContainer -->
            <div data-dojo-type="dijit/layout/AccordionContainer" data-dojo-props="minSize:20, region:'leading', splitter:true" style="width: 300px;" id="leftAccordion">
                <div data-dojo-type="dijit/layout/AccordionPane" title="Layers">
                    <div id="layerToggle"  selected="true">
                  Toggle Layers: <br />
                <div data-dojo-type="dijit/layout/AccordionPane" title="Legend">
                   <div id="legendDiv"></div>
                <div data-dojo-type="dijit/layout/AccordionPane" title="Query">
                <div data-dojo-type="dijit/layout/AccordionPane" title="Print">
                   <div>Select a print template.</div>
                    <div id="print_button"></div>
                <div data-dojo-type="dijit/layout/AccordionPane" title="Measurement">
                   <div id="measurement"></div>
            <!-- end AccordionContainer -->