Select to view content in your preferred language

Editor add features only - don't allow attribute edits on existing features

3563
11
07-05-2011 08:07 PM
deleted-user-NnRwwd8ols89
Deactivated User
Hi, i'm using the edit widget to allow users to add point features to a feature service and it's working really well, however at the moment everyone can edit all the features within the database.

i want to allow that either:

  • users can only modify their own created features OR

  • features can only be added to the database, not modified once added

if it's the latter i can then use the pop-ups to allow viewing of the data

any help is much appreciated!
thanks
Ben
Tags (2)
0 Kudos
11 Replies
deleted-user-NnRwwd8ols89
Deactivated User
i'm looking to replicate the funcitonality here:
http://tmapps.esri.com/PIM/index.html

where users can add but not edit content
0 Kudos
deleted-user-NnRwwd8ols89
Deactivated User
it appears in the edit widget help page

http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/Edit_widget/01m30000000v000000/

that this functionality should be able to be toggled using the <updateattributes> tag, but there is no reference to this in the editwidget.mxml file so is this not implemented?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ben,

   There is a <updateattributes>true</updateattributes> element in the EditWidget.xml.... At least there is in Flex Viewer 2.3.1.
0 Kudos
deleted-user-NnRwwd8ols89
Deactivated User
Hi Rob thanks for your help on this, i've seen that tag but it doesn't seem to make any difference when i set it to false, my editwidget.xml is shown below:

<?xml version="1.0" ?>
<!-- If compiling this widget, make sure to add -keep-all-type-selectors=true to your compiler arguments in the FB project properties. -->
<configuration>
    <createoptions>
        <polygondrawtools>polygon,freehandpolygon,extent,autoComplete</polygondrawtools>
        <polylinedrawtools>polyline,freehandpolyline,line</polylinedrawtools>
    </createoptions>
    <deletefeatures>false</deletefeatures>
    <geometryservice>http://175.41.137.150/ArcGIS/rest/services/Invisible_Landscapes_edits/FeatureServer</geometryservice>
    <toolbarvisible>false</toolbarvisible>
    <toolbarcutvisible>false</toolbarcutvisible>
    <toolbarmergevisible>false</toolbarmergevisible>
    <toolbarreshapevisible>false</toolbarreshapevisible>
    <updateattributes>false</updateattributes>
    <updategeometry>false</updategeometry>
<labels>
  <attributeslabel>Your comments</attributeslabel>
  <attachmentslabel>Images</attachmentslabel>
</labels>
</configuration>
0 Kudos
IvanBespalov
Frequent Contributor
Ben, is this editwidget.xml works fine?

Looks like:
<!-- Not a geometry service -->
<geometryservice>
      http://175.41.137.150/ArcGIS/rest/services/Invisible_Landscapes_edits/FeatureServer
</geometryservice>

<!-- sample geometry service -->
<geometryservice>
     http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer
</geometryservice>
0 Kudos
JHayes
by
Frequent Contributor
Ben,

I'm trying to enable the same functionality in the Flex API - I'm using the Editor Component Class for gathering comments, but don't want the attributes to be "editable" once the comment has been saved.  If I use the updateAttributesEnabled="false" property under the Editor Component Class the user can't comment whatsoever.

Robert - you seem to be a master, do you have any suggestions?

Thanks,
Joe
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Joseph,

   You would have to look into changing updateAttributesEnabled to false after the editsComplete event is fired from the FeatureLayer (I don't have any specifics for you just this idea of where I would begin to look).
0 Kudos
JHayes
by
Frequent Contributor
Thanks Robert.  It appears that I just stepped into the deep end of the pool.  However, your suggestion has definitely pointed me in the right direction.  I'll look into how to manipulate the editsComplete event with the updateAttibuteEnable and get back to you when I have something.

Cheers,
Joe
GIS Tech II
Washington County
Long Range Planning
0 Kudos
JHayes
by
Frequent Contributor
Joseph,

   You would have to look into changing updateAttributesEnabled to false after the editsComplete event is fired from the FeatureLayer (I don't have any specifics for you just this idea of where I would begin to look).


I forgot to get back to you about this.  I've made some really good stride in OOP since then. 

I created 2 event handlers to create the functionality I was looking for.  One for new comments and one for reviewing existing comments.

For creating new comments this ActionScript code works:
               private function newCommentHandler():void 
   {
    myEditor.updateAttributesEnabled = true;
    myEditor.deleteEnabled = true;
   }


For reviewing existing comments:
               private function stopEditsHandler():void 
   {
    myEditor.updateAttributesEnabled = false;
    sidewalkComments.selectedFeatures.valueOf();
    bikelaneComments.selectedFeatures.valueOf();
    myEditor.deleteEnabled = false;
                         }


When using them in the feature layer mxml:
               <esri:FeatureLayer id="sidewalkComments"
          mode="snapshot"
          outFields="[Comment, entered]"
          visible="false"
          url="http://...."
          click="stopEditsHandler()"/>
   
   <esri:FeatureLayer id="bikelaneComments"
          mode="snapshot"
          visible="false"
          outFields="[Comment, entered]"
          url=http://...."
          click="stopEditsHandler()"/>


Success!!

Thanks,
Joe
GIS Tech II
Washington County|Long Range Planning
0 Kudos