Select to view content in your preferred language

How to Update an existing point layer using FLex api 2.5

707
3
02-20-2014 06:01 AM
HectorChapa
Frequent Contributor
This is what I have so far as for coding. I used some of the code from argis resources. But I was expecting to see a form to pop up when I click a particular point in the map to update its information. But here is the problem I am encountering nothing happens when I click the point. Can any one give me an xml file that achieves the same task I am trying to accomplish. I know some one here has done the same.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:esri="http://www.esri.com/2008/ags"
      initialize="application_initializeHandler(event)"
      pageTitle="Editor component with toolbar">
 <!--
 

 <s:layout>
  <s:VerticalLayout gap="0"/>
 </s:layout>
 
 <fx:Style>
  @namespace esri "http://www.esri.com/2008/ags";
  
  esri|InfoWindow
  {
   background-color : #FFFFFF;
   border-thickness : 2;
  }
 </fx:Style>
 
 <fx:Script>
  <![CDATA[
   import com.esri.ags.tasks.GeometryService;
   
   import mx.events.FlexEvent;
   
   protected function application_initializeHandler(event:FlexEvent):void
   {
    myEditor.featureLayers = [ points ];
   }
   
   protected function getFeatureCount(value:Array):int
   {
    return value.length;
   }
  ]]>
 </fx:Script>
 
 <s:BorderContainer width="100%" backgroundColor="#D7D7D7">
  <s:layout>
   <s:VerticalLayout paddingBottom="7"
         paddingLeft="10"
         paddingRight="10"
         paddingTop="7"/>
  </s:layout>
  <s:RichText width="100%">
   This sample demonstrates how to use the editor component with a toolbar.
   By default, the "toolbar" displays below the template picker, but you can change this with the skin parts.
  </s:RichText>
  <s:Label width="100%"
     paddingLeft="3"
     text="Two feature layers with {points.numGraphics} ({getFeatureCount(points.selectedFeatures)}) points (showing selected feature count in parenthesis)."/>
 </s:BorderContainer>
 
 <s:HGroup width="100%" height="100%"
     paddingLeft="5"
     paddingTop="5">
  <esri:Map id="myMap" wrapAround180="true">
   <esri:extent>
    <esri:Extent id="sheepfire"
        xmin="-1.09742216352E7" ymin="3006114.7661000006" xmax="-1.08446320657E7" ymax="3100223.793400001">
     <esri:SpatialReference wkid="102100"/>
    </esri:Extent>
   </esri:extent>
   <esri:ArcGISTiledMapServiceLayer url="http://gis.lrgvdc911.org:8399/arcgis/rest/services/BaseMap/MapServer/"/>
   <esri:FeatureLayer id="points"
          mode="onDemand"
          outFields="[StateID, FirstName, LastName]"
          url="http://gissvr:6080/arcgis/rest/services/STEARWEBMAPTEST/MapServer/0"/>
   
    
   
   <esri:infoWindowContent>
    <esri:AttributeInspector id="attrInsp">
     <esri:FieldInspector featureLayer="{points}" fieldName="activeprod"/>
     
     <esri:FieldInspector featureLayer="{points}" fieldName="StateID"/>
     
     <esri:FieldInspector featureLayer="{points}" fieldName="FirstName"/>
     
     <esri:FieldInspector featureLayer="{points}" fieldName="LastName">
    </esri:FieldInspector>
     <esri:Editor id="myEditor"
         width="266"
         geometryService="{new GeometryService('http://gissvr:6080/arcgis/rest/services/Utilities/Geometry/GeometryServer')}"
         map="{myMap}"
         toolbarVisible="true">
     </esri:Editor>
    </esri:AttributeInspector>
   </esri:infoWindowContent>
   
  </esri:Map>
Tags (2)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Hector,

   You can not update your points when using a MapServer
http://gissvr:6080/arcgis/rest/services/STEARWEBMAPTEST/MapServer/0

You can only update using a FeatureServer
http://gissvr:6080/arcgis/rest/services/STEARWEBMAPTEST/FeatureServer/0


Are you aware of the requirements for editing?

https://developers.arcgis.com/flex/guide/editing.htm
0 Kudos
HectorChapa
Frequent Contributor
Ok I see the problem but I register the database I did everything as the training book I have. How can I make it feature server/.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Hector,

   You have to enable "Feature Access" when you publish the service.

See the "How does editing work?" Section of the link I provided.
0 Kudos