Select to view content in your preferred language

EditorWidget - can't to save data  to the geodatabase

1783
2
12-04-2013 02:19 AM
AnatoliiTerentiev
Deactivated User
I try to use EditorWidget control to edit layers with feature access. I can delete items from geodatabase (sql server express), but can't to save result of feature editing. If I try to edit existing feature after click "OK" button - this button becomes not active and data not saved even on the Map. If I try to edit new added feature - it normally saved on the map, but not saved in geodatabase.
    If I try use this layer in arcgis.com map , then all operation are performed normally and data properly saved in geodatabase.
XAML:
       <esri:Map x:Name="MyMap" Background="White" WrapAround="true" Extent="6095000,6810000,6900000,7258000">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseEnter">
                    <ei:ChangePropertyAction TargetName="myMenuItems" PropertyName="Visibility">
                        <ei:ChangePropertyAction.Value>
                            <Visibility>Collapsed</Visibility>
                        </ei:ChangePropertyAction.Value>
                    </ei:ChangePropertyAction>
                </i:EventTrigger>
            </i:Interaction.Triggers>
            <esri:ArcGISDynamicMapServiceLayer ID="BaseLayer" 
              Url="http://terentievai:6080/ArcGIS/rest/services/rk/MapServer" />

            <esri:ArcGISDynamicMapServiceLayer ID="chsLayer" 
              Url="http://terentievai:6080/ArcGIS/rest/services/chs/MapServer" />

            <esri:FeatureLayer ID="myEvents" DisableClientCaching="True" 
                               AutoSave="False"
                               Url="http://terentievai:6080/ArcGIS/rest/services/chs/FeatureServer/0" 
                               OutFields="*"
                               Mode="OnDemand" />
        </esri:Map>
        <StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="0,80,224,0"   VerticalAlignment="Top" >
            <esri:EditorWidget x:Name="MyEditorWidget"
                             Map="{Binding ElementName=MyMap}" 
                                      Width="300" 
                                      AutoSelect="False"
                                      AlwaysDisplayDefaultTemplates="True" 
                                      GeometryServiceUrl="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
                                      ShowAttributesOnAdd="True"  
                                      Loaded="EditorWidget_Loaded"/>
        </StackPanel>

and code behind:
namespace Module2
{
    public partial class MapControl : UserControl
    {
        public MapControl()
        {
            InitializeComponent();
        }

        private void ArcGISDynamicMapServiceLayer_Initialized(object sender, EventArgs e)
        {
            ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer myArcGISDynamicMapServiceLayer =
                  MyMap.Layers["chsLayer"] as ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer;
            int[] myVisibleLayers = {0};
            myArcGISDynamicMapServiceLayer.VisibleLayers = myVisibleLayers;
        }

        private void EditorWidget_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            string[] myLayerIDs = { "myEvents" };
            MyEditorWidget.LayerIDs = myLayerIDs;
        }
    }
}

And service details:
[HTML]Layer: events (ID: 0)

View In:   ArcGIS.com Map

Name: events

Display Field: name

Type: Feature Layer

Geometry Type: esriGeometryPoint

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

Extent:
XMin: 6351082.909999
YMin: 6816741.669999
XMax: 6686624.070001001
YMax: 7331495.690001001
Spatial Reference: 28406  (28406)


Drawing Info:
Renderer:
Simple Renderer:
Symbol:

Label:
Description:
Transparency: 0
Labeling Info:

HasZ: false

HasM: false

Has Attachments: false

HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText

Type ID Field:

Fields:
id ( type: esriFieldTypeInteger , alias: id , editable: false , nullable: false )
status ( type: esriFieldTypeInteger , alias: status , editable: true , nullable: true )
name ( type: esriFieldTypeString , alias: name , editable: true , nullable: true , length: 255 )
dateTime ( type: esriFieldTypeDate , alias: dateTime , editable: true , nullable: true , length: 36 )
punct ( type: esriFieldTypeDouble , alias: punct , editable: true , nullable: true )
event_type ( type: esriFieldTypeInteger , alias: event_type , editable: true , nullable: true )
object ( type: esriFieldTypeInteger , alias: object , editable: true , nullable: true )
description ( type: esriFieldTypeString , alias: description , editable: true , nullable: true , length: 255 )
region ( type: esriFieldTypeDouble , alias: region , editable: true , nullable: true )
settle ( type: esriFieldTypeInteger , alias: settle , editable: true , nullable: true )
control ( type: esriFieldTypeSmallInteger , alias: control , editable: true , nullable: true )
dolgotaGrad ( type: esriFieldTypeInteger , alias: dolgotaGrad , editable: true , nullable: true )
dolgotaMin ( type: esriFieldTypeInteger , alias: dolgotaMin , editable: true , nullable: true )
dolgotaSec ( type: esriFieldTypeDouble , alias: dolgotaSec , editable: true , nullable: true )
dolgP ( type: esriFieldTypeString , alias: dolgP , editable: true , nullable: true , length: 1 )
shirotaGrad ( type: esriFieldTypeInteger , alias: shirotaGrad , editable: true , nullable: true )
shirotaMin ( type: esriFieldTypeInteger , alias: shirotaMin , editable: true , nullable: true )
shirotaSec ( type: esriFieldTypeDouble , alias: shirotaSec , editable: true , nullable: true )
shirP ( type: esriFieldTypeString , alias: shirP , editable: true , nullable: true , length: 1 )
harCHS ( type: esriFieldTypeInteger , alias: harCHS , editable: true , nullable: true )
infSorce ( type: esriFieldTypeString , alias: infSorce , editable: true , nullable: true , length: 255 )
mashtab ( type: esriFieldTypeInteger , alias: mashtab , editable: true , nullable: true )
data_loc ( type: esriFieldTypeDate , alias: data_loc , editable: true , nullable: true , length: 36 )
data_likv ( type: esriFieldTypeDate , alias: data_likv , editable: true , nullable: true , length: 36 )
X ( type: esriFieldTypeDouble , alias: X , editable: true , nullable: true )
Y ( type: esriFieldTypeDouble , alias: Y , editable: true , nullable: true )
ObjectID ( type: esriFieldTypeOID , alias: ObjectID , editable: false , nullable: false )
Templates:
Name: events
Description:
Prototype:
id: 0
Drawing Tool: esriFeatureEditToolPoint

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
[/HTML]

What could be wrong?
0 Kudos
2 Replies
AnatoliiTerentiev
Deactivated User
I try to test EditorWidget example , added  my layer with feature access "myEvents"
XAML:
<UserControl x:Class="Module2.MapControl"
        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">

    <Grid x:Name="LayoutRoot">

        <esri:Map x:Name="MyMap" Background="White" WrapAround="true" Extent="6095000,6810000,6900000,7258000">
            <esri:ArcGISDynamicMapServiceLayer ID="BaseLayer" 
          Url="http://terentievai:6080/ArcGIS/rest/services/rk/MapServer" />

            <esri:FeatureLayer ID="Points of Interest" DisableClientCaching="True" 
                               AutoSave="False"
                               Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0"
                               OutFields="*" 
                               Mode="OnDemand" />
            <esri:FeatureLayer ID="myEvents" DisableClientCaching="True" 
                               AutoSave="False"
                               Url="http://terentievai:6080/ArcGIS/rest/services/chs/FeatureServer/0" 
                               OutFields="*"
                               Mode="OnDemand" />
        </esri:Map>

        <StackPanel  x:Name="EditorToolStrip" Margin="0,5,5,0" >
            <Border Background="#00919191" CornerRadius="5"
               HorizontalAlignment="Right"  VerticalAlignment="Top"
               Padding="5" BorderBrush="Transparent">
                <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" 
                                      AutoSelect="False"
                                      AlwaysDisplayDefaultTemplates="True" 
                                      GeometryServiceUrl="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
                                      ShowAttributesOnAdd="True"  
                                      Loaded="EditorWidget_Loaded"/>
                </StackPanel>
            </Border>
        </StackPanel>

    </Grid>
</UserControl>

and code behind:
namespace Module2
{
    public partial class MapControl : UserControl
    {
        public MapControl()
        {
            InitializeComponent();
        }
        private void EditorWidget_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            string[] myLayerIDs = { "Points of Interest", "Evacuation Perimeter", "myEvents" };
            MyEditorWidget.LayerIDs = myLayerIDs;
        }
    }
}

The result of testing:
1. Layer "Points of interest" works normally. Result of editing saves normally.
2. Layer "myEvents" works as described in previous message.
Thus it can be assumed that the problem  is in the layer or  in  geodatabase. However, confuses that if test service in arcgis.com  MAP, the changes are saved for layer myEvents too.
0 Kudos
AnatoliiTerentiev
Deactivated User
Any ideas how to fix?
1. Can't anybody say what steps can I take to solve the problem?
2. Now I made connection to geodatabase from "sa" , temporarily. This connection I use in the service. Is it correct?
3. May be some checklist - did I all necessary?
0 Kudos