TypeError: _297 is null

844
10
05-11-2011 07:12 AM
RyanKelley
New Contributor II
I am using .js API sample code to work on editing... I have replaced what is needed in that code to reflect our servers, data, feature services, etc.

When I try and modify a polygon's attributes or shape, I get an error every time. And, it appears four times. This seems like sort o generic error I have seen posted other places on the forums too.

TypeError: _297 is null
if(!dojo._hasResource["dijit._base.man...h","tr","xx","zh","zh-cn","zh-tw"]);

Any ideas?
0 Kudos
10 Replies
derekswingley1
Frequent Contributor
Can you post a simplified version of your page that generates the error?
0 Kudos
RyanKelley
New Contributor II
Here is the .js piece... again, just took sample code and replaced with our servers, feature layers, etc. Permissions are wide open on the Feature Services for editing too...

Any thoughts?

    <!-- reference ArcGIS JavaScript API -->
    <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2"></script>
    <script type="text/javascript">
      //require selection dijit
      dojo.require("esri.map");
      dojo.require("esri.dijit.editing.Editor-all");
      dojo.require("dijit.layout.ContentPane");
      dojo.require("dijit.layout.BorderContainer");

      var map;
      var resizeTimer;
      
      function init() {

        esri.config.defaults.io.proxyUrl = "http://ourServer/proxy/proxy.ashx";
        
        esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://ourServer/ArcGIS/rest/services/Geometry/GeometryServer");
                
 var extent = new esri.geometry.Extent({"xmin":-13969147.281817337,"ymin":4805977.618327605,"xmax":-12669147.534885714,"ymax":6610095.663226462, "spatialReference":{"wkid":3857}});
        map = new esri.Map("map",{extent:extent});
        dojo.connect(map, "onLoad", function() {
          dojo.connect(dijit.byId('map'), 'resize', function() {
            resizeMap();
          });
        });
        dojo.connect(map, "onLayersAddResult", initEditor);
        var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://ourServer/ArcGIS/rest/services/BaseMap/MapServer");
        map.addLayer(basemap);

        var evacuationPerimeter = new esri.layers.FeatureLayer("http://ourServer/ArcGIS/rest/services/MicroStorms_Collapsed/FeatureServer/1",{
          mode: esri.layers.FeatureLayer.MODE_ONDEMAND, 
          outFields: ['*']
        });

        map.addLayers([evacuationPerimeter]);
      }

      function initEditor(results) {
     
       //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}
        });
        var templateLayers = dojo.map(results,function(result){
          return result.layer;
        });
        var templatePicker = new esri.dijit.editing.TemplatePicker({
          featureLayers: templateLayers,
          grouping: true,
          rows: 'auto',
          columns: 3
        },'templateDiv');
        templatePicker.startup();

        var settings = {
          map: map,
          templatePicker:templatePicker,
          enableUndoRedo:true,
          layerInfos:layers,
          toolbarVisible: true,
          createOptions: {
            polygonDrawTools: [ esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYGON,
                        esri.dijit.editing.Editor.CREATE_TOOL_AUTOCOMPLETE]
          },
          toolbarOptions: {
            reshapeVisible: true,
            cutVisible: true,
            mergeVisible: true
          }
        };
        var params = {settings: settings};

        var editorWidget = new esri.dijit.editing.Editor(params,'editorDiv');
        editorWidget.startup();
        map.infoWindow.resize(300,165);
      }
      //Handle resize of browser
      function resizeMap(){
        clearTimeout(resizeTimer);
        resizeTimer = setTimeout(function(){
          map.resize();
          map.reposition();
        }, 500);
      }
      dojo.addOnLoad(init);
    </script>
0 Kudos
derekswingley1
Frequent Contributor
Try adding this before your script tag for the JS API:
 <script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
0 Kudos
RyanKelley
New Contributor II
Thanks for responding by the way...

Still no love. Any other thoughts?
0 Kudos
derekswingley1
Frequent Contributor
Not sure...which part of your app is breaking? Is the your tiled map service loading?
0 Kudos
RyanKelley
New Contributor II
I rebooted my machine and now it works, but not always... Sort of hard to pin-point when it's not consistent. Now, I am no longer getting the _297 error, but a 400 error that I am unable to apply edits.

The tiled map service is fine I think. I get the error as soon as I try and add a poly or edit an existing one. I have some more investigating to do I believe...

Thanks for your help and please post if you have any other thoughts.

I will post a solution when I find one.
0 Kudos
derekswingley1
Frequent Contributor
I would guess that adding the djConfig stuff addressed the _297 is null error but you were still loading a cached version of the page. Regarding the 400 on trying to apply edits, I would start by making sure your proxy is configured correctly.
0 Kudos
RyanKelley
New Contributor II
I agree about the djConfig tag fixing the _297 error (thank you)... I'll look into the proxy settings.

I'm finding it interesting that I get the 400 error if not all of the features from the feature service draw, which generates an error relating to graphics being unable to draw.  If this error occurs, I can't edit. If all the features do draw and no error occurs, the editing is just perfect. A proxy thing? A feature service thing?
0 Kudos
lbowne
by
New Contributor II
i get similar errors, how did you fix?
0 Kudos