help! refreshing featurelayer after feature deletion...

2360
5
02-02-2012 10:50 AM
JaredAllen
New Contributor
i've created a js 2.6 web app which will be primarily accessed via an iPad device. one of the functions is to allow users the ability to delete features. this works w/o error, since the sde feature layer respects the applied updates.

the problem is that when an iPad device is used to delete a feature the feature will momentarily disappear, but on pan/zoom the graphic is replaced... however, i can watch that feature in the database, or from a desktop browser, and verify that it is in-fact removed.

so, the iOS browser engine is holding onto a cached image (furthermore, if tested in desktop safari, i get the same effect as in mobile safari) and the only way i can get my iPad device to render the point "gone" is to handle a full location.reload(true)... and that is way to cumbersome.

btw, the layers being edited are being added to map as esri.layers.FeatureLayer with mode_ondemand, which from all accounts of the api reference do not have a functional "disableClientCaching" or "refresh" property or method.

please help! i've been struggling for days on this issue and need to get this resolved asap.

you can respond to this post, or email me directly jallen@northwindgrp.com, or call me 208.403.7969.

my online reference to this app is: http://arcgisserver.northwind-inc.com/itd-mobile/index.htm. you can test in desktop browser vs mobile browser to see the effect of which i'm referring.

thanks for any help.
0 Kudos
5 Replies
StephenLead
Regular Contributor III
Can you pinpoint the relevant sections in the code? It's a fairly complicated application so it would help to narrow down the issue. Which functions in the application should we choose to reproduce the problem?

I noticed in the script at http://arcgisserver.northwind-inc.com/itd-mobile/library/code/global.js that you've defined:

permits = new esri.layers.FeatureLayer("http://arcgisserver.northwind-inc.com/ArcGIS/rest/services/itd-mobile/FeatureServer/1", {
  mode : esri.layers.FeatureLayer.MODE_ONDEMAND,
  disableClientCaching : true,
  visible : false,
  outFields : ["*"]    });


As far as I know, disableClientCaching doesn't apply to a feature layer, but to a Dynamic layer. Not sure if that's related to the issue you're seeing.

Cheers,Steve
0 Kudos
JaredAllen
New Contributor
that is indeed the piece that i'd like to replicate for a featurelayer that is set to ondemand. i know that disableClientCaching is only for dynamic service level layers, but for the fact that the safari browser engine is caching the featurelayer, there's got to be some crafty method to forcing the featurelayer, map, or browser to force a redraw.
0 Kudos
StephenLead
Regular Contributor III
Sorry, I can't really help here. In FireFox on a PC, the features are deleting correctly. I don't have access to an iPad or Mac to test this in iOS.

It might help to make a much simpler version of this application, which you can debug more easily. I'd create a version of this page with all the code in a single script then add a single layer and a simple add/delete function, then see if you can reproduce the problem.

That might help to pinpoint exactly where the problem is occurring - if you submit something as complex as this applicatoin to tech support, it'll be harder for them to debug.

Good luck,
Steve
0 Kudos
JaredAllen
New Contributor
so... i was able to resolve this issue but removing the feature layer after editing, then reloading layer, and then re-attaching it to the initialized editing service. the effectively will overcome any iPad cache of graphics after editing.
0 Kudos
ConstanceErvine
New Contributor
As far as I know, disableClientCaching doesn't apply to a feature layer, but to a Dynamic layer. Not sure if that's related to the issue you're seeing.

Cheers,Steve











0 Kudos