Do you feel trapped into using the ESRI Web ADF for your application because of its out of the box Editing functionality?
Don't!
I recently fell into the same trap - the client's timeline was agressive, and I figured that the less custom features we had to write the better. The requirement was for users to be able to draw points and lines on the map and type in a comment, then save to the database. So we chose the Editor Task to edit a 'comment point' or 'comment line' layer. (Using ArcGIS Server 9.3.1 with SQL Server 2005 & SDE)
The user has to open the editor task window, choose which layer they want to comment on, then choose the editor drawing tool. After drawing on the map and typing a comment, the user has to jump back up to the top of the form and choose to save their edits. Not at all intuitive.
Turns out, the only people who know how to use/can figure out how to use the out of the box Editor Task in the Web ADF are GIS analysts. So, if your users are regular people, they probably won't want to take the time to 'figure it out', which means they won't use the feature, which means you're creating an app that people won't use.
Well, my colleague and I revisited this problem soon after finishing the Web ADF version of the application.
For grins, he migrated the app (with the exception of the editing task) to the ESRI JavaScript API and immediately notice a SIGNIFICANT improvement in performance for all operations, including page loading, layer visibility toggling, and querying.
So, the only question remaining for us was how to edit (or at least insert) new features through the JavaScript API. We came up with several hypotheses:
- Use WFS-T to insert features
- Write custom ArcObjects code
Great. So I started down the dreaded ArcObjects route. Within a few hours, I had cobbled together a solution:
User clicks on map and types a comment. In JavaScript we capture these values and append to an AJAX request (in DOJO or jQuery) to a .NET web handler. The handler picks up the querystring parameters, parses them and passes them off to a C# Class which contains the ArcObjects code which inserts the geometry into SDE. Phew!
Thought we had it down, then realized that this solution requires that the host server have ArcGIS Desktop or ArcEngine installed to take advantage of the licensing. Drat!
So I slightly modified some code I found
on the ESRI Resource pages.Instead of connecting to SDE using Direct Connect, you connect to the Server Object Manager and go from there.
So the result is that the Client Side JavaScript calls the .NET handler, which calls the C# class to insert the geometry ArcGIS Server Style.
Woo Hoo!