AnsweredAssumed Answered

"No Features Selected" with Multiple Attribute Inspectors

Question asked by townofsnowflake on May 14, 2014
Latest reply on May 15, 2014 by townofsnowflake
I have a map with a single point layer for which I've assigned an Attribute Inspector with a custom "Edit Button". When the layer is clicked, the Attribute Inspector displays properly:

[ATTACH=CONFIG]33825[/ATTACH]

When the edit button is clicked, I have an "EditMode" function, which should display an Attribute Inspector. This time with editable fields. When the 2nd Attribute Inspector's info window is displayed, "No Features Selected" is displayed in the content rather than a list of editable fields. Any ideas why is this happening?

[ATTACH=CONFIG]33826[/ATTACH]

I'm using the Multiple Attribute Inspectors Sample as a guide.

Once the feature layer (globals.eventsMSL) has been added, initInfoWindow adds the Attribute Inspector to my globals.eventsMSL layer:


 function initInfoWindow(results){       console.log("in the initInfoWindow function: " + globals.map.layerIds.length);      globals.query = new Query();   globals.eventsMSL.on("click", function(evt){    if (globals.map.infoWindow.isShowing) {     globals.map.infoWindow.hide();    };     var layerInfos = [{     'featureLayer': globals.eventsMSL,     'isEditable': false,     'showAttachments': false,     'showDeleteButton':false    }]     var attInspector = new esri.dijit.AttributeInspector({     layerInfos: layerInfos    }, dojo.create("div"));     globals.query.objectIds = [evt.graphic.attributes.OBJECTID];     globals.eventsMSL.selectFeatures(globals.query, FeatureLayer.SELECTION_NEW, function(features){     globals.map.infoWindow.setTitle("");     globals.map.infoWindow.setContent(attInspector.domNode);     globals.map.infoWindow.resize(350, 240);     globals.map.infoWindow.show(evt.screenPoint, globals.map.getInfoWindowAnchor(evt.screenPoint));                           var editButton = new Button({              label: "Edit",              "class": "editButton"             });              domConstruct.place(editButton.domNode, attInspector.deleteBtn.domNode, "after");              editButton.on("click", function() {         editMode(features);    });         });    });   }


The "EditMode" Function should display an Attribute Inspector:
  function editMode(features){      if (globals.map.infoWindow.isShowing) {     globals.map.infoWindow.hide();    }    var layerInfos = [{     'featureLayer': globals.eventsMSL,     'isEditable': true    }];      var attInspector = new esri.dijit.AttributeInspector({     layerInfos: layerInfos    }, dojo.create("div"));         var editScreenPoint = globals.evt.screenPoint;    globals.map.infoWindow.setContent(attInspector.domNode);    globals.map.infoWindow.resize(325, 185);     globals.map.infoWindow.show(editScreenPoint, globals.map.getInfoWindowAnchor(editScreenPoint));      attInspector.on("delete", function(evt) {         globals.map.infoWindow.hide();    });     attInspector.on("attribute-change", function(evt) {        });    }

Attachments

Outcomes