Select to view content in your preferred language

Not all items in EditorWidget are visible

2292
5
12-03-2013 12:54 AM
AnatoliiTerentiev
Deactivated User
Dear Gurus!
I have the feature service, and try to use EditorWidget from  Live sample:
            <esri:EditorWidget x:Name="MyEditorWidget"
                             Map="{Binding ElementName=Map}" 
                                      Width="300" 
                                      AutoSelect="False"
                                      AlwaysDisplayDefaultTemplates="True" 
                                      GeometryServiceUrl="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
                                      ShowAttributesOnAdd="True"  
                                      Loaded="EditorWidget_Loaded"/>

When I try to run example I see only 5 elements: New selection, Add To Selection, remove from selection, clear selection and display attributes. All works fine, but
1. There are now such items as "Delete selected items" "Save edits" and I can't edit in attributes window. (In design mode I see all items).
2. And I don't see items of the legend in editorWidget , only editor items. Layer with feature access has only 1 element.

I  checked the properties of the service in arcgis desktop - deleting and editing allowed.



What may be the reason?
0 Kudos
5 Replies
AnatoliiTerentiev
Deactivated User
The problem is:
When I look at service properties in arcgis desktop I see in the window Feature Access checked next :
     
Create , Delete, Query, Update.

But when I look at feature layer properties in service endpoint http://terentievai:6080/ArcGIS/rest/services/chs/MapServer/0
I see only next :
    
Supported Operations:   Query   Generate Renderer   Return Updates

Why?
0 Kudos
SubaKrishnan
Esri Contributor
You will have to see the feature server for the layer to see the operations like create, delete etc. The rest endpoint link posted is for the mapserver which doesn't have those operations on it. Take a look at the sample services for reference

http://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/MapServer

http://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer
0 Kudos
AnatoliiTerentiev
Deactivated User
Thank you very much!!!
Now for url http://terentievai:6080/arcgis/rest/services/chs/FeatureServer/0 I see
Supported Operations:   Query   Apply Edits   Add Features   Update Features   Delete Features   Generate Renderer   Return Updates

But
1. When I add or edit features the data is not saved.
2. When editing newly added data editor window closes and disappears, data not saved.
    When editing data existing  in the geodatabase - changes are not saved and the window closes. OK button - becomes inactive, the Delete button - active
What could be wrong?
0 Kudos
AnatoliiTerentiev
Deactivated User
Delete  operation is performed normally (in geodatabase too).
But if I view my feature layer in  ArcGIS.com Map - all works normally,
edited changes are saved in my geodatabase.
0 Kudos
AnatoliiTerentiev
Deactivated User
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;
        }
    }
}
0 Kudos