Customizing the Web Editor task

 James Goodrich, a developer on the .NET Web ADF team, contributed this information about some Service Pack 2 enhancements to the Editor task:

 When the Editor task was released at version 9.2 of the Web ADF for the .NET Framework, a common question was “How can I customize the Editor task?”. Service Pack 2 provides an answer to this question. You can now customize the Editor task with custom tools and Editor Panels and we have added more events that allow you to hook into the Editor task.

In addition to these new customization options for developers, the Editor task has another key change at Service Pack 2 which it allows it to be configured with a pooled map service. You can edit non-versioned data using a pooled map service.

See the Editor Task control discussion in the Developer Help for samples and instructions.

Customized Editor Task with added tools

This entry was posted in Services and tagged , , , . Bookmark the permalink.

Leave a Reply

8 Comments

  1. sterlingdq says:

    From Adam on May 8, 2007: I’ll first state that I’m a beginner but I want to dive in head first to developing with ArcGIS Server and blogs like this are very helpful aside from standard documentation. So Thanks! My question: These comments seem to be discussing accessing the text boxes and text values associated with an editing task. Where would code like this be placed? For example, I have had a hard time trying to figure out where a calendar control would go when entering a date value in a text box. This would give the editor a very straight forward way to enter the date to minimize error, etc. Thanks!

  2. sterlingdq says:

    From Mitch on May 8, 2007: Adam, Add OnPreAttributeEdit=”editor_PreAttributeEditEventHandler” to your editor task and the code below. Every time a user edits a field, this event is fired. I’m not an expert, but hope this helps. – Mitch ———————————————————————————————— public void editor_PreAttributeEditEventHandler(object sender, ESRI.ArcGIS.ADF.ArcGISServer.Editor.PreAttributeEditEventArgs e) { if (e.Feature.get_Value(e.Feature.Fields.FindField(“Created_On”)).ToString().Trim().Length == 0) { e.Feature.set_Value(e.Feature.Fields.FindField(“Created_By”), User.Identity.Name); e.Feature.set_Value(e.Feature.Fields.FindField(“Created_On”), DateTime.Now.ToString()); } e.Feature.set_Value(e.Feature.Fields.FindField(“Modified_By”), User.Identity.Name); e.Feature.set_Value(e.Feature.Fields.FindField(“Modified_On”), DateTime.Now.ToString()); e.Feature.Store(); }

  3. sterlingdq says:

    From Adam on May 8, 2007: Mitch, Thanks for replying. I first converted the code to VB since that’s what i’m most familiar with. I added the OnPreAttributeEdit value to the editor task and then put the code in the Default.aspx.vb file at the very end as a Public sub and changed the field names to what I was using in my database. The web app still functions normally but the text boxes do not populate with any value. I also tried to place a break point at the beginning of the sub routine to see if I could step through it and the program did not break. Am I placing the code in the correct spots?Thoughts? Thanks again for your help.

  4. sterlingdq says:

    From Mitch on May 8, 2007: Adam, The text boxes don’t populate until you save. Try running the code, saving, and viewing the result with the info tool. The fields I’m using are being hidden, so this isn’t a problem. It may be a problem for you. —— I am also trying to add calendar componets, textareas, etc, to the editor task. I have had no luck thus far. We may have to wait until they realse the next update (or the source code). -Mitch

  5. sterlingdq says:

    From Adam on May 8, 2007: I see now that the code executes after the values are entered. I get an error message saying that object reference is set to a null value now. I sure hope there are some improvements like what we are talking about here. It would definitely help with maintaining data integrity on large-scale data entry projects with AGS. Thanks a lot Mitch!

  6. sterlingdq says:

    On Tuesday we performed maintenance to move the blog to its new location on blogs.esri.com. For this reason, I have manually ported over some of the comments to this thread that you posted on the former site on May 8.

    Thanks for your comments and interest. It’s great to see everyone talking!

    -Sterling

  7. ajpfister06 says:

    Just a follow up for anyone keeping score here:

    I got off the phone w/ ESRI Support and the only way to accomplish what I’ve been trying to do is create a custom task from scratch and add in all the capabilities (through code). He did mention that things like this were being considered for the next update/release.

    It can’t come soon enough!

  8. binnyps says:

    Could anyone please tell me if there is any way by which we can post the changes to the DEFAULT version, after editing in another version using Editor task control?
    If it can be done, how does the eiditortask take care of reconcilation, conflicts and all?
    Could anyone please help?