I've been modifying the Flex View for my own purposes and one of the capability i need is Editing.
I added the Feature Service which has a Versioned polygon file but when i go to edit it the Editor Window is completely blank and i can't edit any data.
I created a couple of Templates but those don't show up in the window. I have no idea what i'm doing wrong. I've also confirmed that the Geometry service link works.
Any help would be greatly appreciated.
The first thing to double-check is in the mxd. You need to be connecting to the data via an account which a) is set as an account capable of having edit privileges and b) actually has edit privileges on the data set you're connecting it. You can double-check this by starting an edit session in your mxd and verifying that you can make edits and save them. I've also found that saving as an msd prevents editing from working, I have to use an mxd.
Once you're sure the mxd is set up with edit permissions and it's available on your server, create the map service being sure to check the Feature box (and ensure Edit is checked below).
The last step is just making sure you call the layer correctly in config.xml. You don't really need to alter editwidget.xml except to change the polygon editing tools available, or switch from the default ESRI geometry server. Your editable layer should look like this in config.xml:
<layer label="Editable Features" type="feature" visible="false"
info="widgets/InfoTemplates/SimpleInfoWinWidget.swf"
infoconfig="widgets/InfoTemplates/IWT_IncidentAreas.xml"
url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/2"/>
the key things in the above:
1) make sure type="feature"
2) make sure the URL is a) going through the FeatureServer link (not MapServer) and b) ends in the number for the specific layer you wish to edit
3) infoconfig will determine which fields are visible when you are NOT editing, when you are editing all fields will be visible and sorted alphabetically.
Of course, you also need to call the Edit Widget in config.xml:
<widget label="Edit"
icon="assets/images/i_edit.png"
config="widgets/Edit/EditWidget.xml"
url="widgets/Edit/EditWidget.swf"/>
If you have been playing with source code, start using ESRI's sample service (above) to verify that editing in general works, then you can move to troubleshooting with your actual service.
hope this helps!
EDIT: I forgot to mention that the above is how it works with anonymous editing. If you want to restrict the ability to edit to certain people, you need to secure your map service, generate a token, call the service with the token in config.xml, and then secure the entire viewer so it requires a login to view. I have a separate view-only app and editable app, and secure the latter with IIS.