Select to view content in your preferred language

Stop infoWindow appearing when editing

1927
17
03-27-2011 04:22 AM
MarkSmith
New Contributor III
Hi,

Hopefully a simple one, but I can't crack it.
I'm using the editor and template picker to allow editing of a layer through the API and this works great.  However in this instance there is no need for the infoWindow to appear when a user clicks a shape to edit, i.e. I don't want it to pop-up, I just want to be able to edit the shape, not the attributes.  So how do you prevent the infoWindow appearing?

Thank you,

Mark.
0 Kudos
17 Replies
MarkSmith
New Contributor III
This example does not use the editor to edit the feature shapes.  If I load my feature layer in my application but disable the editor then sure enough I can customise the infoTemplate and even stop the infoWindow appearing as you suggest in an earlier post, but with the editor and template picker in use on the feature layer I cannot control the infoTemplate and cannot prevent the infoWindow appearing.  Do you have any more suggestions?
Thanks again.
0 Kudos
HemingZhu
Occasional Contributor III
This example does not use the editor to edit the feature shapes.  If I load my feature layer in my application but disable the editor then sure enough I can customise the infoTemplate and even stop the infoWindow appearing as you suggest in an earlier post, but with the editor and template picker in use on the feature layer I cannot control the infoTemplate and cannot prevent the infoWindow appearing.  Do you have any more suggestions?
Thanks again.


To my understanding, if you use template picker, the editor itself will use the infowindow to display attributes. So how to use editor without showing infowindow is tricky. I have not done this so i really could say much any more on this. Perhaps you might want to think about other options such as update your feature without using editor...
0 Kudos
Kathleen_Crombez
Occasional Contributor III
I was just experiencing this same problem using the editor dijit with the attribute inspector displaying in a div instead of the info window.
An empty info window kept popping up on screen.
My solution was to set the following styles in my css stylesheet.

#map_infowindow {
    display:none;
    visibility:hidden;
}

.window {
    display:none;
    visibility:hidden;
}


Hope this helps! 🙂
0 Kudos
MarkSmith
New Contributor III
Kathleen,

Thank you for your post.  I tried your solution but for some reason it didn't have any effect on my window.  My only solution was to reduce the size of the info window and hide it a split second after it appears.

Thanks again,

Mark.
0 Kudos
NicholasFloersch
New Contributor III
Dear ESRI,

I think there are people who would appreciate the option of using the editor widget without using the infowindow. The whole "hide() it after the click event fires" thing is a poor solution... yes it works, but it is a wasteful approach. It would be like me ordering a happy meal when I don't want the free toy. Instead of always getting the toy and tossing it out, can I just get the meal without the toy? I understand that the editor is a widget, and so it is a package-deal... and so I get why it is the way it is. I'm just suggesting that an extra config option to totally disable the infowindow functionality would be nice.
0 Kudos
JohnGravois
Frequent Contributor
is our published sample for sketching in new features without adding attributes (not using the editor widget) not helpful for those attempting to support this use case?
0 Kudos
BrettGreenfield__DNR_
Occasional Contributor II
This may be a crude solution, but whenever I have to do something like this, I create a variable called counter and set it equal to 0.  For the identify function, I check to see if counter = 0 before it does anything else.  When the user clicks a button to begin editing, the edit function immediately sets counter = 1, so whenever the user clicks on a feature, though the identify function is still called, it doesn't actually do anything since it fails the if statement.  When the edits are finished, I set counter equal to zero again so they can resume identifying features.
0 Kudos
danbecker
Regular Contributor
I think you can stop the infoWindow from displaying if you call dojo.stopEvent()
right after your onClick that enables the editToolbar

dojo.forEach(layers, function(layer) {
      dojo.connect(layer, "onClick", function(evt) {
            dojo.stopEvent(evt);
            editToolbar.activate(esri.toolbars.Edit.EDIT_VERTICES , evt.graphic);
      });
});


ive also had issues with infoWindow showing when you click a new point with template picker over existing featLayer graphics.
That issue was fixed using featLayer.disableMouseEvents(); after the template was selected

dojo.connect(templatePicker, "onSelectionChange", function() {
      if(templatePicker.getSelected()){
            //template selected disable non-editable featLayers onClick event
            dojo.forEach(nonEditFeatLayers, function(layer){
                    layer.disableMouseEvents();
            });
      }
       else{
             //template selection cleared, enable onClick
            dojo.forEach(nonEditFeatLayers, function(layer){
                    layer.enableMouseEvents();
            });
        }
});
0 Kudos