Use attributeInspector to create new entity

3029
2
Jump to solution
03-12-2014 08:02 AM
MathieuVILLEMONT1
Occasional Contributor
Hi,

I would like to use the attributeInspector to create a new entity in a layer/table.
This attributeInspector would be placed in a pop-up or outside the map.

So far I was thinking to do something like this:

var attrInspector:AttributeInspector  = new AttributeInspector(); ... attrInspector.featureLayers = [featLayer]; var g:Graphic = new Graphic(); attrInspector.showFeature(g, featLayer);


Is it a good approach ?

Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MathieuVILLEMONT1
Occasional Contributor
Update :

I have tried to add it to the InfoWindow :

var attr:AttributeInspector  = new AttributeInspector(); attr.featureLayers = [featLayer]; var g:Graphic = new Graphic(); var attributes:Object = {}; attributes["OBJECTID"] = ""; g.attributes = attributes; attr.showFeature(g, featLayer); map.infoWindow.visible = true; map.infoWindow.anchorX = 15; map.infoWindow.anchorY = 200; map.infoWindow.content = attr;


but the infoWindow is displayed empty.


The problem with this was that the layer was not loaded and therefore did not have any featureDetails.
I found the solution on this thread.

Thank you Robert and Walt!

View solution in original post

0 Kudos
2 Replies
MathieuVILLEMONT1
Occasional Contributor
Update :

I have tried to add it to the InfoWindow :

var attr:AttributeInspector  = new AttributeInspector();
attr.featureLayers = [featLayer];
var g:Graphic = new Graphic();
var attributes:Object = {};
attributes["OBJECTID"] = "";
g.attributes = attributes;
attr.showFeature(g, featLayer);
map.infoWindow.visible = true;
map.infoWindow.anchorX = 15;
map.infoWindow.anchorY = 200;
map.infoWindow.content = attr;


but the infoWindow is displayed empty.
0 Kudos
MathieuVILLEMONT1
Occasional Contributor
Update :

I have tried to add it to the InfoWindow :

var attr:AttributeInspector  = new AttributeInspector(); attr.featureLayers = [featLayer]; var g:Graphic = new Graphic(); var attributes:Object = {}; attributes["OBJECTID"] = ""; g.attributes = attributes; attr.showFeature(g, featLayer); map.infoWindow.visible = true; map.infoWindow.anchorX = 15; map.infoWindow.anchorY = 200; map.infoWindow.content = attr;


but the infoWindow is displayed empty.


The problem with this was that the layer was not loaded and therefore did not have any featureDetails.
I found the solution on this thread.

Thank you Robert and Walt!
0 Kudos