Select to view content in your preferred language

RE: Attribute Inspector SaveButton - Bug with chrome and firefox

1200
5
02-07-2014 02:02 AM
GaneshSolai_Sambandam
Regular Contributor
Hi ESRI Developer team / GIS folks,

I have developed an WEBGIS application where an user can go &  edit individual feature layers in the application.

As you know, the attribute inspector by default only comes with delete button. But, for some, users would like to have a save
button added on to attribute inspector and once they have completed editing, they wanted to use the save button. So, I have looked at the sample link below from ESRI javascript API and implemented the functionality into my application.


http://developers.arcgis.com/javascript/samples/ed_attribute_inspector/

The delete button and save button works extremely well in Internet Explorer, but fails to execute in FireFox and Chrome.

So to test this, I checked the sample link above to see whether the code works in firefox and chrome, but the problem is the same
in the ESRI sample link.

The problem is when you copy the link above in FF or Chrome and click any feature on the map and make some changes to the attribute, if you press save button, it will save on chrome and FF. But, if you press Delete button to delete a feature, then, it activates the save button, but not delete button. Actually the problem is here with the delete and save button, in FF and chrome.




Can you please look into this sample link above and throw some lights on how to fix it.
0 Kudos
5 Replies
GaneshSolai_Sambandam
Regular Contributor
Hi ESRI Developer team / GIS folks,

I have developed an WEBGIS application where an user can go &  edit individual feature layers in the application.

As you know, the attribute inspector by default only comes with delete button. But, for some, users would like to have a save
button added on to attribute inspector and once they have completed editing, they wanted to use the save button. So, I have looked at the sample link below from ESRI javascript API and implemented the functionality into my application.


http://developers.arcgis.com/javascript/samples/ed_attribute_inspector/

The delete button and save button works extremely well in Internet Explorer, but fails to execute in FireFox and Chrome.

So to test this, I checked the sample link above to see whether the code works in firefox and chrome, but the problem is the same
in the ESRI sample link.

The problem is when you copy the link above in FF or Chrome and click any feature on the map and make some changes to the attribute, if you press save button, it will save on chrome and FF. But, if you press Delete button to delete a feature, then, it activates the save button, but not delete button. Actually the problem is here with the delete and save button, in FF and chrome.




Can you please look into this sample link above and throw some lights on how to fix it.


Hi GIS folks,
Can anyone help me on this.


Regards
Ganesh
0 Kudos
GaneshSolai_Sambandam
Regular Contributor
Hi Guys,
Can anyone tell me why this savebutton functionality on chrome and firefox doesn't work properly.
The sample link above doesn't work either.

Please help.................

Regards
Ganesh
0 Kudos
AndyGup
Esri Regular Contributor
Ganesh,

Thanks for letting us know. I was able to reproduce the fact that the delete button and delete listener aren't working on Chrome in the Attribute Inspector sample.

I can see that saves are working by using the browser console. Are you able to see the saves occurring in the background?

Have you opened a support ticket yet? That way we can get this tracked and in the queue.

If you need a quick fix you can always manually build your own custom delete button and set the default delete button to false. Here is a psuedo-code example to get you pointed in the right direction:

          
var layerInfos = [{
'featureLayer': petroFieldsFL,
'showAttachments': false,
'showDeleteButton': false, /* set this to false */
      
            ....

var dButton = new Button({ label: "Delete", "class": "dButton"});
domConstruct.place(dButton.domNode, attInspector.deleteBtn.domNode, "after");

dButton.on("click",function(evt){
    updateFeature.getLayer().applyEdits(null,null,[updateFeature]);
    map.infoWindow.hide();
})






https://developers.arcgis.com/javascript/jsapi/attributeinspector.html#event-delete



-Andy
0 Kudos
GaneshSolai_Sambandam
Regular Contributor
Ganesh,

Thanks for letting us know. I was able to reproduce the fact that the delete button and delete listener aren't working on Chrome in the Attribute Inspector sample.

I can see that saves are working by using the browser console. Are you able to see the saves occurring in the background?

Have you opened a support ticket yet? That way we can get this tracked and in the queue.

If you need a quick fix you can always manually build your own custom delete button and set the default delete button to false. Here is a psuedo-code example to get you pointed in the right direction:

          
var layerInfos = [{
'featureLayer': petroFieldsFL,
'showAttachments': false,
'showDeleteButton': false, /* set this to false */
      
            ....

var dButton = new Button({ label: "Delete", "class": "dButton"});
domConstruct.place(dButton.domNode, attInspector.deleteBtn.domNode, "after");

dButton.on("click",function(evt){
    updateFeature.getLayer().applyEdits(null,null,[updateFeature]);
    map.infoWindow.hide();
})






https://developers.arcgis.com/javascript/jsapi/attributeinspector.html#event-delete



-Andy


Hi Andy
thank you very much for your quick turnaround. I am really amazed to see that you have responded to my query. The only problem is with the delete button and the save button works perfectly alright.
I haven't logged a ticket with ESRI and to be honest, I don't how to log a support ticket with ESRI. Please guide on this.

Finally, I will try to create a custom delete button as per your advice and see whether that one works and finally, a big thank you for the custom code as well.

Regards
Ganesh
0 Kudos
AndyGup
Esri Regular Contributor
Ganesh, no worries. I have gone ahead and submitted a tech support issue on this. I had asked because I didn't want to duplicate a submission if you had already entered one.

For future reference, there are a number of ways you can submit issues to tech support. If you are in the U.S. and have a maintenance contract you can call it in. If you are elsewhere, typically you would work with an Esri distributor first. And, if you have a developers. arcgis.com subscription plan then here is some information on the support you get for that: https://developers.arcgis.com/en/plans/.

-Andy
0 Kudos