Setting InfoWindow content disables Editor Widget attributes display

4159
3
04-10-2013 10:01 PM
BryanBaker
Occasional Contributor
I'm having the same issue this user posted about a year ago, which apparently didn't get a resolution:
http://forums.arcgis.com/threads/56331-Custom-infoTemplate-conflicts-with-default-editor-widget-info...

My application has both an editor widget and a custom identify tool. The identify uses the standard map.infoWindow.setContent() to display the information about features clicked. The application uses the Popup dijit for the InfoWindow.

If I only interact with the editor widget in displaying/editing attributes, it works fine. However if I use the identify tool to display information in the infoWindow, and then go back to the editor to select and display attributes, the infoWindow still shows the content last set by the identify tool. Oddly enough, the infowindow's title does get set properly - but not the content.

I used Chrome debugger's pretty-print function and it appears that the editor widget calls _onEditFeature when displaying the attributes. I see that function calls infoWindow.setTitle, but not .setContent. I know that if I don't use the identify and go to edit different features, the infoWindow content does get updated with each feature's attributes. So I suspect the code is calling individual elements within the form that it has created, but of course that form no longer exists if another tool has replaced the infoWindow contents. In any event, it seems that this is a problem for any application that uses the editor widget and any other function with the InfoWindow.

I'm going to try to do a destroy on the editor whenever the identify tool is used (then recreate when reopening the editor), but that is either going to introduce dependencies I don't want or more complex code. If anyone has a better solution please share.

BTW I haven't worked for Esri for over 4 years, but haven't been able to get the Forum folks to remove the icon from my posts!
0 Kudos
3 Replies
DavideLimosani
Occasional Contributor II
I had exactly the same problem. The only solution I have found is to destroy the editor widget every time.
0 Kudos
abdelabdel
New Contributor II

Davide,

I have exactly the same problem. Could you please post how did you implement the solution.

Thank you.

0 Kudos
BryanBaker
Occasional Contributor
I ended up not using the Editor Widget. Instead I implemented custom editing using the TemplatePicker and AttributeInspector, and placed the AttributeInspector in a separate dialog. It would be helpful if ESRI would modify the EditorWidget to support this scenario, or at least document this issue.

BTW, I also noticed that the templates in the TemplatePicker do not draw if the div that contains them is set to display:none. So either I have to delay initializing the template picker until the user clicks to display it (which was suggested in another post), or use visibility:hidden instead of display:none.
0 Kudos