Problem getting EditorWidget to work with a Feature Service on ArcGIS Server

3683
1
Jump to solution
02-12-2014 05:17 AM
Labels (1)
ThomasIsraelsen
New Contributor III
I am trying to get the ArcGIS Runtime SDK for WPF 10.2 sample named "Editor Widget Online" to work with a Feature Service that I am hosying on my own ArcGIS 10.2 for Server.

What I have done is simply this:

1. Pasted the xaml for the sample into a new "ArcGIS Runtime SDK 10.2 for WPF Application" created in Visual Studio 2012.

2. Edited the xaml to remove the dynamic map service layer and one of the two Feature Layers from the Map and to change the other Feature Layer to point to the url of my own feature service.

When I start the application, there are no errors (and no exception in debug), put the editor widget looks very weird:
[ATTACH=CONFIG]31343[/ATTACH]

Any thoughts?

The feature service works fine with the TemplatePicker and the application works fine if I do not change the xaml form the sample.

xaml:
<Window x:Class="BarrierEditor2.MainWindow"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
        Title="MainWindow" Height="350" Width="525">
<Grid x:Name="LayoutRoot">
  <Grid.Resources>
  </Grid.Resources>
  <esri:Map x:Name="MyMap" WrapAround="True" UseAcceleratedDisplay="True">
   <esri:ArcGISTiledMapServiceLayer ID="BaseLayer"
                                Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
   <!--<esri:ArcGISDynamicMapServiceLayer ID="Fire Perimeter"
                                               Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/MapServer"
                                               VisibleLayers="2"/>-->
   <esri:FeatureLayer ID="Barrier2" DisableClientCaching="True"
                               AutoSave="False"
                               Url="http://ags102test:6080/arcgis/rest/services/BarrierEdit/FeatureServer/0"
                               OutFields="*"                              
                               />
   <!--<esri:FeatureLayer ID="Points of Interest" DisableClientCaching="True"
                               AutoSave="False"
                               Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0"                              
                               OutFields="*" />-->
  </esri:Map>
  <StackPanel  x:Name="EditorToolStrip" Margin="0,5,5,0" >
   <Border Background="White" BorderThickness="1"
                        HorizontalAlignment="Right"  VerticalAlignment="Top"
                        Padding="5" BorderBrush="Black">
    <Border.Effect>
     <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" />
    </Border.Effect>
    <StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="0,5,5,0"    VerticalAlignment="Top" >
     <esri:EditorWidget x:Name="MyEditorWidget" Map="{Binding ElementName=MyMap}"
                                      Width="300"
                                      LayerIDs="Barriers2"
                                      AutoSelect="False"
                                      GeometryServiceUrl="http://ags102test:6080/arcgis/rest/services/Utilities/Geometry/GeometryServer"
                                      ShowAttributesOnAdd="True"  />
    </StackPanel>
   </Border>
  </StackPanel>
  <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,10,10,0" >
   <Rectangle Fill="White" Stroke="Gray"  Margin="0,0,0,5">
    <Rectangle.Effect>
     <DropShadowEffect/>
    </Rectangle.Effect>
   </Rectangle>
   <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" Margin="10,10,10,15" />
   <TextBlock x:Name="ResponseTextBlock" Text="Two editable feature layers represent points of interest and fire evacuation areas.  Use the symbol templates to add new features.  Use the tools to modify or delete existing features. Save your edits when finished to commit any updates to the database."
                       Width="200" TextAlignment="Left" Margin="30,20,20,30" TextWrapping="Wrap" Foreground="Black" />
  </Grid>
</Grid>
</Window>


Feature Service:
Layer: RlpTest.DBO.SoftBarriers (ID: 0)
View In:   ArcGIS.com Map

Name: RlpTest.DBO.SoftBarriers

Display Field: ScaleFactor

Type: Feature Layer

Geometry Type: esriGeometryPolygon

Description:

Definition Expression: N/A

Copyright Text:

Default Visibility: true

MaxRecordCount: 1000

Supported Query Formats: JSON, AMF

Min Scale: 0

Max Scale: 0

Supports Advanced Queries: true

Supports Statistics: true

Use Standardized Queries: true

Extent:
XMin: 335252.9430999998
YMin: 5888684.078400001
XMax: 968397.0930000003
YMax: 6606555.6579
Spatial Reference: 25832  (25832)



Drawing Info:
Renderer:
Unique Value Renderer:
Field 1: ScaleType
Field 2: null
Field 3: null
Field Delimiter: ,
Default Symbol:
Style: esriSFSSolid
Color: [238, 205, 247, 255]
Outline:
Style: esriSLSSolid
Color: [110, 110, 110, 255]
Width: 0
Default Label:
UniqueValueInfos:
Value: 2
Label: High
Description:
Symbol:
Style: esriSFSSolid
Color: [201, 242, 208, 255]
Outline:
Style: esriSLSSolid
Color: [110, 110, 110, 255]
Width: 0
Value: 1
Label: Low
Description:
Symbol:
Style: esriSFSSolid
Color: [205, 233, 247, 255]
Outline:
Style: esriSLSSolid
Color: [110, 110, 110, 255]
Width: 0
Transparency: 0
Labeling Info:

HasZ: false

HasM: false

Has Attachments: false

HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText

Type ID Field: ScaleType

Fields:
OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID , editable: false , nullable: false )
ScaleFactor ( type: esriFieldTypeDouble , alias: ScaleFactor , editable: true , nullable: false )
ScaleType ( type: esriFieldTypeSmallInteger , alias: ScaleType , editable: true , nullable: true )
Types:
ID: 1
Name: Low
Domains:
ScaleFactor:
Range: [0, 0.5]
Templates:
Name: Low
Description:
Prototype:
ScaleFactor: 0.25
ScaleType: 1

Drawing Tool: esriFeatureEditToolPolygon

--------------------------------------------------------------------------------
ID: 2
Name: High
Domains:
ScaleFactor:
Range: [0.5, 1]
Templates:
Name: High
Description:
Prototype:
ScaleFactor: 0.75
ScaleType: 2

Drawing Tool: esriFeatureEditToolPolygon

--------------------------------------------------------------------------------


Capabilities: Create,Delete,Query,Update,Uploads,Editing

Sync Can Return Changes: false

Is Data Versioned: false

Supports Rollback On Failure: true

Supported Operations:   Query   Apply Edits   Add Features   Update Features   Delete Features   Generate Renderer   Return Updates
0 Kudos
1 Solution

Accepted Solutions
ThomasIsraelsen
New Contributor III
Turns out there was an errors in the xaml: Mismatch in layer names.

Feature Request for ArcGIS Runtime SDK: Please have the EditorWidget throw useful exceptions when it it provided with obviously invalid inputs, such as asking it to use a non-existant layer.

View solution in original post

0 Kudos
1 Reply
ThomasIsraelsen
New Contributor III
Turns out there was an errors in the xaml: Mismatch in layer names.

Feature Request for ArcGIS Runtime SDK: Please have the EditorWidget throw useful exceptions when it it provided with obviously invalid inputs, such as asking it to use a non-existant layer.
0 Kudos