pixyz

How do I display a text field as a text area?

Discussion created by pixyz on May 24, 2011
Latest reply on May 26, 2011 by hzhu
Hi Everyone!  Any help with this would be greatly appreciated.

I've been working on a project to create a few websites that utilize the editing functionality with ArcGIS Server.  I customized the following sample in order to serve up our data:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_multipleAttrInspector.html
If you go to http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm, you will find this sample under Editing - Modify Editable Fields

This is perfect except for one thing I'd like to change.  I have one field that is called "comment" and I'd like that field to show up as a text area.  Something similar to this example:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_editing_widget.html
Again, to find this sample, go to http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm, and go to Editing - Editor with Toolbar (Union).

I've tried a few times to grab some of the code from the Editing - Editor with Toolbar (Union) sample to add to my sample, but so far I haven't been able to find anything that works.  I thought it would be as simple as grabbing the following code and adding it to my sample but perhaps I'm adding it in the wrong place:

//build the layer and field information for the layer, display the description field
        //using a text area.
        var layers = dojo.map(results, function(result) {
          var fieldInfos= dojo.map(result.layer.fields,function(field){
            if(field.name === 'description'){
              return {'fieldName': field.name,'label':'Details',stringFieldOption:esri.dijit.AttributeInspector.STRING_FIELD_OPTION_TEXTAREA}
            }
            else{
              return {'fieldName': field.name,'lable':field.alias}
            }
          });
          return {featureLayer:result.layer,'fieldInfos':fieldInfos}
        });

Outcomes