I've created a custom widget that should execute a feature action for a specific feature class, checked for by the display field name.
When the widget is first added to a web app, everything works well. However if the app is saved and reloaded the feature action does not come up.
Are there specific locations where I should look for mismatched file names or something similar?
The browser (up to date Chrome) console does not report of any errors when attempting to add the widget to an app or selecting the target feature class.
Doing any changes to the feature action .js file, including changing a comment or whitespace, saving the file and reloading the app allows the widget to work as intended until the app is reloaded again.
The process that isn't happening is a feature action, I'm using neither postCreate nor startup. This widget is a modified version of another widget (the one parsing parcel ID's I asked about previously) that appears to work flawlessly. mismatched file and function names trigger actual errors, so I'm confident that isn't the case.
The symptom here, where the widget works after the feature action .js file is saved but only until the web app is loaded again, seem like a sort "versioning" issue where either our server that hosts the web app or something on ESRI's side ignores the feature action .js file unless it has some sort of "newly updated" flag.
I apologize for not being more specific as this behavior is not something I've seen before and do not know how to correctly identify it.
I've filed a case with tech support, and the representative went through the workflow with me via screen sharing and was equally baffled by this behavior.
OK, it did not catch that initially. That is strange behavior you are describing. Do you see any errors in the console? Have you tried logging to the console in the isFeatureSupported to see if it is getting called when you are not seeing the action available?
isFeatureSupported is only getting called during the first load after save, not afterwards.
I am getting the following warning in the console referring to init.js:
Use of getAttributeNode() is deprecated. Use getAttribute() instead.
I've rebuilt the widget using the barebones template rather than the fully built 'Demo' widget and incorporated the feature action.
The widget can be added to the app fine, and works during that instance as intended. However when loading the app again I get the above error and the app does not load.
Where do you define the name/label of your feature action in your code?
I always put mine in the strings.js like this:
The first part _featureAction_ is important.