Question about editwidget

1055
8
Jump to solution
10-26-2012 02:00 AM
DanielLewis
New Contributor II
Is this possible with the editwidget or some other widget:  Allow users via the webviewer to click on a feature in a featurelayer and have a popup show the value for a particular field for that featuer and allow the user to edit that value (from a dropdown of selections)?  I don't see how to do this.  Any help is appreciated.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RhettZufelt
MVP Frequent Contributor
Well, I don't work with secure services, so can't really do much testing.

Curious, if you make the change below, do you actually see your features on the map? That would be the first place, if you can't see it, it's probably not loading properly.

<operationallayers>
  
<layer label="XYZ Test of Edit" type="dynamic" visible="false" alpha="1.0" url="https://url.com/ArcGIS/rest/services/XYZ/FeatureServer"/> 
<layer label="Editable Features" type="feature" visible="true"
info="widgets/InfoTemplates/SimpleInfoWinWidget.swf"
infoconfig="widgets/InfoTemplates/test.xml"
url="https://url.com/ArcGIS/rest/services/XYZ/FeatureServer/0"/> 
</operationallayers>


Also, you may need to delete/re-publish your service, or try it with a different name as you say you created the templates, but I don't see them in your REST services. Here is the info for a line layer that I have that works in the edit widget. Notice the Templates: section which is missing from yours.

Feature Layer: EditLines (ID: 0)
View In:   ArcGIS.com Map 

Display Field: SITECODE

Type: Feature Layer

Geometry Type: esriGeometryPolyline

Description: 

Copyright Text: 

Min. Scale: 0

Max. Scale: 0

Extent: 

XMin: 559357.9375
YMin: 114810.068100002
XMax: 594669.064499997
YMax: 153591.5735
Spatial Reference: 32149

Drawing Info: 

Renderer: 

Simple Renderer: 
Symbol: 

Simple Line Symbol:
Style: esriSLSSolid, Color: [161, 0, 56, 255], Width: 1
Label: Lines
Description: 

Transparency: 0
Labeling Info: N/A

Has Attachments: False

HTML Popup Type: esriServerHTMLPopupTypeNone

Object ID Field: OBJECTID

Global ID Field: 

Type ID Field: 

Fields: 

OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID, Editable: False)
DEC_UNIT (Type: esriFieldTypeString, Alias: DEC_UNIT, Length: 15, Editable: True, Domain: Coded Values: [100-B/C: 100-B/C], [100-D/H: 100-D/H], [100-F/IU-2/IU-6: 100-F/IU-2/IU-6], ...5 more...)

Templates: 

Name: EditLines
Description: 
Drawing Tool: esriFeatureEditToolLine
Prototype: 
    Attributes: 
          DEC_UNIT: 

Supported Interfaces:   REST 

Supported Operations:   Query   Add Features   Update Features   Delete Features   Apply Edits 



R_

View solution in original post

0 Kudos
8 Replies
BjornSvensson
Esri Regular Contributor
Is this possible with the editwidget or some other widget:  Allow users via the webviewer to click on a feature in a featurelayer and have a popup show the value for a particular field for that featuer and allow the user to edit that value (from a dropdown of selections)?  I don't see how to do this.  Any help is appreciated.


Yes, that is possible with the Edit widget.  Your data needs to be coming from an ArcGIS Server Feature Service (and be editable).

See http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Edit_widget/01m30000003v000000/
Live sample: http://resources.arcgis.com/en/help/flex-viewer/live/index.html?config=apps/config-edit.xml
0 Kudos
DanielLewis
New Contributor II
Yes, that is possible with the Edit widget.  Your data needs to be coming from an ArcGIS Server Feature Service (and be editable).

See http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Edit_widget/01m30000003v000000/
Live sample: http://resources.arcgis.com/en/help/flex-viewer/live/index.html?config=apps/config-edit.xml


Is there a walk-through example of creating template?  I only have one attribute I want to be updatable (click on the existing feature and have a drop down selection of 1,2,3 or 4), no drawing/adding features. 

Also, I read in another post that the feature layer should be a mxd, not a msd.  Is this correct?

Thanks,

Wayne
0 Kudos
BjornSvensson
Esri Regular Contributor
Is there a walk-through example of creating template?  I only have one attribute I want to be updatable (click on the existing feature and have a drop down selection of 1,2,3 or 4), no drawing/adding features.


Wayne/Davis,
The ArcGIS Desktop help have more information on Editing
http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_editing/01m500000003000000/
And creating feature services (including a link to a tutorial):
http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_a_feature_service/0154000002w80000...

The part about only allowing people to update, not add/delete, is a functionality you can either set up in the service, or in the Flex Viewer.
0 Kudos
RhettZufelt
MVP Frequent Contributor
I only have one attribute I want to be updatable (click on the existing feature and have a drop down selection of 1,2,3 or 4), no drawing/adding features. 


You might want to look at using a Domain on the dataset.  That will allow you to click/select the feature with the edit widget and the attribute window pops up.  If you have a domain, there is a dropdown list with the available values.

If you un-check all the other fields in the mxd (not including OBJECTID and Shape), then only the "desired" field will even be available to edit.

R_
0 Kudos
DanielLewis
New Contributor II
Thanks to all for your pointers and links.  I've read through them, and this is what I have right now.  At this point, I can't get anything to display in the edit widget, and I'm assuming I should see the template I setup in arcmap.

In the rest services, I see (extra lines removed): 
Feature Layer: XYZ.PavementBranch (ID: 0)
View In:   ArcGIS.com Map 

Display Field: FEATURENAME

Type: Feature Layer

Geometry Type: esriGeometryPolygon

Description: 

Copyright Text: 

Min. Scale: 0

Max. Scale: 0

Extent: 

XMin: -5.63324851099998
YMin: 36.984785175
XMax: 35.456580847
YMax: 56.174739496
Spatial Reference: 4326

Drawing Info: 

Renderer: 

Unique Value Renderer: 

Field 1: PCI
Field 2: 
Field 3: 
Field Delimiter: , 
Default Symbol: 

Unsupported Symbol

Default Label: 
Unique Value Infos: 

Value: 0
Label: CLEAR
Description: 
Symbol: 

Simple Fill Symbol:
Style: esriSFSSolid, Color: [182, 252, 184, 255]
Outline: 

Simple Line Symbol:
Style: esriSLSSolid, Color: [110, 110, 110, 255], Width: 0.4
Value: 1
Label: Test
Description: 
Symbol: 

Simple Fill Symbol:
Style: esriSFSSolid, Color: [255, 190, 190, 255]
Outline: 

Simple Line Symbol:
Style: esriSLSSolid, Color: [0, 0, 0, 255], Width: 0.4
Value: 2
Label: Test2
Description: 
Symbol: 

Simple Fill Symbol:
Style: esriSFSSolid, Color: [190, 232, 255, 255]
Outline: 

...

Simple Line Symbol:
Style: esriSLSSolid, Color: [0, 0, 0, 255], Width: 0.4
Transparency: 0
Labeling Info: N/A

Has Attachments: False

HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText

Object ID Field: OBJECTID

Global ID Field: GLOBALID

Type ID Field: PCI

Fields: 

...
PCI (Type: esriFieldTypeInteger, Alias: PavementConditionIndex, Editable: True)
...
Types: 

...
...
--------------------------------------------------------------------------------

Supported Interfaces:   REST 

Supported Operations:   Query   Add Features   Update Features   Delete Features   Apply Edits 


In the config.xml, I have:

<operationallayers>
  
<layer label="XYZ Test of Edit" type="dynamic" visible="false" alpha="1.0" url="https://url.com/ArcGIS/rest/services/XYZ/FeatureServer"/> 
<layer label="Editable Features" type="feature" visible="false"
info="widgets/InfoTemplates/SimpleInfoWinWidget.swf"
infoconfig="widgets/InfoTemplates/test.xml"
url="https://url.com/ArcGIS/rest/services/XYZ/FeatureServer/0"/> 
</operationallayers>

<widget label="Edit Test"
icon="assets/images/i_edit.png"
config="widgets/Edit/EditWidget.xml"
url="widgets/Edit/EditWidget.swf"/>


In the editwidget.xml:
<?xml version="1.0" ?>
<configuration>
    <createoptions>
        <polygondrawtools>polygon,freehandpolygon,extent,autocomplete</polygondrawtools>
        <polylinedrawtools>polyline,freehandpolyline,line</polylinedrawtools>
    </createoptions>
    <addfeatures>true</addfeatures>
    <deletefeatures>true</deletefeatures>
    <toolbarvisible>true</toolbarvisible>
    <toolbarcutvisible>true</toolbarcutvisible>
    <toolbarmergevisible>true</toolbarmergevisible>
    <toolbarreshapevisible>true</toolbarreshapevisible>   
    <updategeometry>true</updategeometry>
    <updateattributes>true</updateattributes> 
    <showcreatorfield>true</showcreatorfield>    
    <showcreationdatefield>true</showcreationdatefield>    
    <showeditorfield>true</showeditorfield>    
    <showeditdatefield>true</showeditdatefield>    
</configuration>


When I click on the edit widget with the feature layer enabled, nothing is shown in the edit widget.
0 Kudos
RhettZufelt
MVP Frequent Contributor
Well, I don't work with secure services, so can't really do much testing.

Curious, if you make the change below, do you actually see your features on the map? That would be the first place, if you can't see it, it's probably not loading properly.

<operationallayers>
  
<layer label="XYZ Test of Edit" type="dynamic" visible="false" alpha="1.0" url="https://url.com/ArcGIS/rest/services/XYZ/FeatureServer"/> 
<layer label="Editable Features" type="feature" visible="true"
info="widgets/InfoTemplates/SimpleInfoWinWidget.swf"
infoconfig="widgets/InfoTemplates/test.xml"
url="https://url.com/ArcGIS/rest/services/XYZ/FeatureServer/0"/> 
</operationallayers>


Also, you may need to delete/re-publish your service, or try it with a different name as you say you created the templates, but I don't see them in your REST services. Here is the info for a line layer that I have that works in the edit widget. Notice the Templates: section which is missing from yours.

Feature Layer: EditLines (ID: 0)
View In:   ArcGIS.com Map 

Display Field: SITECODE

Type: Feature Layer

Geometry Type: esriGeometryPolyline

Description: 

Copyright Text: 

Min. Scale: 0

Max. Scale: 0

Extent: 

XMin: 559357.9375
YMin: 114810.068100002
XMax: 594669.064499997
YMax: 153591.5735
Spatial Reference: 32149

Drawing Info: 

Renderer: 

Simple Renderer: 
Symbol: 

Simple Line Symbol:
Style: esriSLSSolid, Color: [161, 0, 56, 255], Width: 1
Label: Lines
Description: 

Transparency: 0
Labeling Info: N/A

Has Attachments: False

HTML Popup Type: esriServerHTMLPopupTypeNone

Object ID Field: OBJECTID

Global ID Field: 

Type ID Field: 

Fields: 

OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID, Editable: False)
DEC_UNIT (Type: esriFieldTypeString, Alias: DEC_UNIT, Length: 15, Editable: True, Domain: Coded Values: [100-B/C: 100-B/C], [100-D/H: 100-D/H], [100-F/IU-2/IU-6: 100-F/IU-2/IU-6], ...5 more...)

Templates: 

Name: EditLines
Description: 
Drawing Tool: esriFeatureEditToolLine
Prototype: 
    Attributes: 
          DEC_UNIT: 

Supported Interfaces:   REST 

Supported Operations:   Query   Add Features   Update Features   Delete Features   Apply Edits 



R_
0 Kudos
DanielLewis
New Contributor II
Ok, I have the templates showing in the rest service now:

ID: Sprayed
Name: Sprayed
Domains: 

Field Name: INSTALLATIONID
Inherited

Field Name: SITEID
Inherited

Field Name: REALPROPERTYSITEUNIQUEID
Inherited

Field Name: OWNER
Inherited

Templates: 

Name: Sprayed
Description: 
Drawing Tool: esriFeatureEditToolPolygon
Prototype: 

Attributes: 

PRIORITY: None
STATUS: Sprayed
--------------------------------------------------------------------------------
ID: Plowed
Name: Plowed
Domains: 

Field Name: INSTALLATIONID
Inherited

Field Name: SITEID
Inherited

Field Name: REALPROPERTYSITEUNIQUEID
Inherited

Field Name: OWNER
Inherited

Templates: 

Name: Plowed
Description: 
Drawing Tool: esriFeatureEditToolPolygon
Prototype: 

Attributes: 

PRIORITY: None
STATUS: Plowed


And when I enable the feature service in the layers widget, I do see it in the viewer. But when I open the edit widget, the template is not shown.
0 Kudos
DanielLewis
New Contributor II
Got it!  I was ignoring this line:
<!-- If compiling this widget, make sure to add -keep-all-type-selectors=true to your compiler arguments in the FB project properties. -->


works now.
0 Kudos