Packagecom.esri.ags.components
Classpublic class AttributeInspector
InheritanceAttributeInspector Inheritance spark.components.supportClasses.SkinnableComponent

Since : ArcGIS API for Flex 2.0

The attribute inspector shows attributes of selected features in a form showing one feature at a time. If the layer is editable, the feature attributes will be editable. The AttributeInspector component is associated with the selection set of one or more feature layers and honors the domains and subtypes as defined by the Feature Service. The component is used by the Editor component, but can also be used directly in both editing and "show attributes" scenarios. While commonly put into an InfoWindow, you can also put it into other containers, for example outside of the map or even without even using a map.

Default MXML PropertyfieldInspectors

See also

com.esri.ags.layers.FeatureLayer
com.esri.ags.components.supportClasses.FormItemsOrder
Live sample - AttributeInspector (view)
Live sample - AttributeInspector (edit)
Live sample - Attribute Inspector outside of the map


Public Properties
 PropertyDefined By
  activeFeature : Graphic
[read-only] The feature currently shown in the AttributeInspector.
AttributeInspector
  activeFeatureIndex : int
The index of the selected feature.
AttributeInspector
  deleteButtonVisible : Boolean
If true, displays the "delete" button.
AttributeInspector
  featureLayers : Array
Array of FeatureLayer instances.
AttributeInspector
  fieldInspectors : Array
Array of FieldInspector instances.
AttributeInspector
  formItemsOrder : String
The order of the form items.
AttributeInspector
  infoWindowLabel : String
Set the label on the info window.
AttributeInspector
  numFeatures : int
[read-only] The number of features.
AttributeInspector
  showGlobalID : Boolean
Flag to show or hide the global id field.
AttributeInspector
  showObjectID : Boolean
Flag to show or hide the object id field.
AttributeInspector
  singleToMultilineThreshold : Number
The maximum number of characters to display as a single line text input component, otherwise display as a multiline text area.
AttributeInspector
  updateEnabled : Boolean
If true, allows updating the attribute values.
AttributeInspector
Public Methods
 MethodDefined By
  
AttributeInspector(featureLayers:Array = null)
Creates a new AttributeInspector.
AttributeInspector
  
Delete the selected feature.
AttributeInspector
  
next():void
Show the next available feature.
AttributeInspector
  
previous():void
Show the previous available feature.
AttributeInspector
  
refresh():void
Load all selected features from all defined feature layers.
AttributeInspector
  
Refresh the form to show the attributes of the currently selected feature.
AttributeInspector
Protected Methods
 MethodDefined By
  
createFormItemComponent(featureLayer:FeatureLayer, field:Field, fieldInspector:FieldInspector, fieldValue:Object):UIComponent
Create a UI component to render a field value in the selected feature.
AttributeInspector
  
getFormItemLabel(featureLayer:FeatureLayer, field:Field, fieldInspector:FieldInspector):String
Gets the form item label.
AttributeInspector
  
setFormItemValue(formItem:FormItem, feature:Graphic):void
Set the form item value.
AttributeInspector
Events
 Event Summary Defined By
  Fires when a feature is deleted.AttributeInspector
  Fires when a feature attribute is shown.AttributeInspector
  Fires when a feature attribute is updated.AttributeInspector
Styles
 Style Description Defined By
  
formMaxHeight
Type: Number Format: Length CSS Inheritance: no
The form max height in pixels. The default value is 400 pixels.
AttributeInspector
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
  
deleteButton:spark.components.supportClasses.ButtonBase
Required: false Part Type: Static
An optional skin part for the delete button.
AttributeInspector
  
form:mx.containers.Form
Required: true Part Type: Static
A required skin part for the form.
AttributeInspector
  
nextButton:spark.components.supportClasses.ButtonBase
Required: false Part Type: Static
An optional skin part for the next button.
AttributeInspector
  
previousButton:spark.components.supportClasses.ButtonBase
Required: false Part Type: Static
An optional skin part for the previous button.
AttributeInspector
Skin States

To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.


 Skin State Description Defined By
  
disabled
The disabled state of the AttributeInspector component. AttributeInspector
  
invalid
One of the attributes is invalid. AttributeInspector
  
normal
The default (i.e., "normal ") state of the AttributeInspector component. AttributeInspector
Property Detail
activeFeatureproperty
activeFeature:Graphic  [read-only]

The feature currently shown in the AttributeInspector.

This property can be used as the source for data binding.


Implementation
    public function get activeFeature():Graphic
activeFeatureIndexproperty 
activeFeatureIndex:int

The index of the selected feature.

This property can be used as the source for data binding.


Implementation
    public function get activeFeatureIndex():int
    public function set activeFeatureIndex(value:int):void
deleteButtonVisibleproperty 
deleteButtonVisible:Boolean

Since : ArcGIS API for Flex 2.1

If true, displays the "delete" button.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get deleteButtonVisible():Boolean
    public function set deleteButtonVisible(value:Boolean):void
featureLayersproperty 
featureLayers:Array

Array of FeatureLayer instances.

This property can be used as the source for data binding.


Implementation
    public function get featureLayers():Array
    public function set featureLayers(value:Array):void
fieldInspectorsproperty 
fieldInspectors:Array

Array of FieldInspector instances.

This property can be used as the source for data binding.


Implementation
    public function get fieldInspectors():Array
    public function set fieldInspectors(value:Array):void

See also

formItemsOrderproperty 
formItemsOrder:String

The order of the form items. Possible values are "none" (no order), "label" (order by label value) and "fieldInspector" (order by the field inspector definition sequence).

The default value is label.

This property can be used as the source for data binding.


Implementation
    public function get formItemsOrder():String
    public function set formItemsOrder(value:String):void

See also

infoWindowLabelproperty 
infoWindowLabel:String

Since : ArcGIS API for Flex 2.3

Set the label on the info window.

The default value is null.

This property can be used as the source for data binding.


Implementation
    public function get infoWindowLabel():String
    public function set infoWindowLabel(value:String):void
numFeaturesproperty 
numFeatures:int  [read-only]

The number of features.

This property can be used as the source for data binding.


Implementation
    public function get numFeatures():int
showGlobalIDproperty 
showGlobalID:Boolean

Flag to show or hide the global id field.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get showGlobalID():Boolean
    public function set showGlobalID(value:Boolean):void
showObjectIDproperty 
showObjectID:Boolean

Flag to show or hide the object id field.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get showObjectID():Boolean
    public function set showObjectID(value:Boolean):void
singleToMultilineThresholdproperty 
singleToMultilineThreshold:Number

Since : ArcGIS API for Flex 2.1

The maximum number of characters to display as a single line text input component, otherwise display as a multiline text area. This number is compared to the length of the string field.

The default value is 40.

This property can be used as the source for data binding.


Implementation
    public function get singleToMultilineThreshold():Number
    public function set singleToMultilineThreshold(value:Number):void
updateEnabledproperty 
updateEnabled:Boolean

Since : ArcGIS API for Flex 2.3

If true, allows updating the attribute values.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get updateEnabled():Boolean
    public function set updateEnabled(value:Boolean):void
Constructor Detail
AttributeInspector()Constructor
public function AttributeInspector(featureLayers:Array = null)

Creates a new AttributeInspector.

Parameters
featureLayers:Array (default = null) — Array of feature layers.
Method Detail
createFormItemComponent()method
protected function createFormItemComponent(featureLayer:FeatureLayer, field:Field, fieldInspector:FieldInspector, fieldValue:Object):UIComponent

Create a UI component to render a field value in the selected feature.

Parameters

featureLayer:FeatureLayer — The selected feature layer.
 
field:Field — The Field associated with this attribute.
 
fieldInspector:FieldInspector — The associated field inspector - could be null.
 
fieldValue:Object — The field value to render.

Returns
UIComponent
deleteActiveFeature()method 
public function deleteActiveFeature():void

Delete the selected feature.

getFormItemLabel()method 
protected function getFormItemLabel(featureLayer:FeatureLayer, field:Field, fieldInspector:FieldInspector):String

Gets the form item label. If the field has an alias then it will be used as a label, otherwise the field name will be used.

Parameters

featureLayer:FeatureLayer — The selected feature layer.
 
field:Field — The selected field.
 
fieldInspector:FieldInspector — An associated field inspector - could be null.

Returns
String
next()method 
public function next():void

Show the next available feature.

previous()method 
public function previous():void

Show the previous available feature.

refresh()method 
public function refresh():void

Load all selected features from all defined feature layers. Normally, you will not need to use this method as the AttributeInspector tries to be smart enough.

refreshActiveFeature()method 
public function refreshActiveFeature():void

Refresh the form to show the attributes of the currently selected feature.

setFormItemValue()method 
protected function setFormItemValue(formItem:FormItem, feature:Graphic):void

Set the form item value.

Parameters

formItem:FormItem — The form item to set.
 
feature:Graphic — The selected feature.

Event Detail
deleteFeature Event
Event Object Type: com.esri.ags.events.AttributeInspectorEvent
AttributeInspectorEvent.type property = com.esri.ags.events.AttributeInspectorEvent.DELETE_FEATURE

Fires when a feature is deleted.

Defines the value of the type property of the event object for a deleteFeature event.
showFeature Event  
Event Object Type: com.esri.ags.events.AttributeInspectorEvent
AttributeInspectorEvent.type property = com.esri.ags.events.AttributeInspectorEvent.SHOW_FEATURE

Fires when a feature attribute is shown.

Defines the value of the type property of the event object for a showFeature event.
updateFeature Event  
Event Object Type: com.esri.ags.events.AttributeInspectorEvent
AttributeInspectorEvent.type property = com.esri.ags.events.AttributeInspectorEvent.UPDATE_FEATURE

Fires when a feature attribute is updated.

Defines the value of the type property of the event object for a updateFeature event.