Attribute Inspector inside Content Pane Issue (widget id already registered)

967
2
Jump to solution
02-27-2013 06:12 AM
KellyBoyd
New Contributor III
Hello,
I adapted the following sample to put the attribute inspector in the right pane of the page:
http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/widget_attributeinspectorpane
(When I watched users try to use the attribute inspector in the info window, I noticed they had to pan the map and make adjustments in order to see all of the fields they needed to edit.)

Anyway, I'm working with floor plans so before I can enable editing, the user queries a building and the first floor is loaded. The selected floor is used in a definition expression on the feature layer used for editing. The layerInfos and attribute inspector are set up in the initSelectToolbar function.

attInspector = new esri.dijit.AttributeInspector({               layerInfos: layerInfos             }, "attributesDiv");


<div data-dojo-type="dijit.layout.ContentPane"                 data-dojo-props="title:'Enter/Edit Room'">            <div id="attributesDiv"></div>           </div>


I get this error in firebug "Tried to register widget with id==attributesDiv but that id is already registered".

I've tried using different variations from to put the attribute inspector in a new div inside attributesDiv but they haven't worked. I'm thinking I may not have have the right require statement.

Any help would be greatly appreciated.
Take care,
Kelly
0 Kudos
1 Solution

Accepted Solutions
SamirGambhir
Occasional Contributor III
Hello,
I adapted the following sample to put the attribute inspector in the right pane of the page:
http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/widget_attributeinspectorpane
(When I watched users try to use the attribute inspector in the info window, I noticed they had to pan the map and make adjustments in order to see all of the fields they needed to edit.)

Anyway, I'm working with floor plans so before I can enable editing, the user queries a building and the first floor is loaded. The selected floor is used in a definition expression on the feature layer used for editing. The layerInfos and attribute inspector are set up in the initSelectToolbar function.

attInspector = new esri.dijit.AttributeInspector({               layerInfos: layerInfos             }, "attributesDiv");



<div data-dojo-type="dijit.layout.ContentPane"                 data-dojo-props="title:'Enter/Edit Room'">            <div id="attributesDiv"></div>           </div>


I get this error in firebug "Tried to register widget with id==attributesDiv but that id is already registered".

I've tried using different variations from to put the attribute inspector in a new div inside attributesDiv but they haven't worked. I'm thinking I may not have have the right require statement.

Any help would be greatly appreciated.
Take care,
Kelly


Hi Kelly,
I have encountered this issue with some other variables I used in my application. I figured that I encountered this problem with my global variables. I suspect your variable 'attInspector' might be a global variable. Also, you might need to 'destroy' this variable after use each time.
I hope this is helpful,
Samir

View solution in original post

0 Kudos
2 Replies
SamirGambhir
Occasional Contributor III
Hello,
I adapted the following sample to put the attribute inspector in the right pane of the page:
http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/widget_attributeinspectorpane
(When I watched users try to use the attribute inspector in the info window, I noticed they had to pan the map and make adjustments in order to see all of the fields they needed to edit.)

Anyway, I'm working with floor plans so before I can enable editing, the user queries a building and the first floor is loaded. The selected floor is used in a definition expression on the feature layer used for editing. The layerInfos and attribute inspector are set up in the initSelectToolbar function.

attInspector = new esri.dijit.AttributeInspector({               layerInfos: layerInfos             }, "attributesDiv");



<div data-dojo-type="dijit.layout.ContentPane"                 data-dojo-props="title:'Enter/Edit Room'">            <div id="attributesDiv"></div>           </div>


I get this error in firebug "Tried to register widget with id==attributesDiv but that id is already registered".

I've tried using different variations from to put the attribute inspector in a new div inside attributesDiv but they haven't worked. I'm thinking I may not have have the right require statement.

Any help would be greatly appreciated.
Take care,
Kelly


Hi Kelly,
I have encountered this issue with some other variables I used in my application. I figured that I encountered this problem with my global variables. I suspect your variable 'attInspector' might be a global variable. Also, you might need to 'destroy' this variable after use each time.
I hope this is helpful,
Samir
0 Kudos
KellyBoyd
New Contributor III
Samir,
Thanks so much for your reply. I realized I was creating the Attribute Inspector within a loop that selects features from multiple FeatureLayers. I moved it out of the loop and that resolved the issue. I do plan on using dojo.destroy() when the user switches to another floor so thank you for the suggestion.
Take care,
Kelly
0 Kudos