While I don't have an (ArcGIS Server) Mapserver version of the data layer I add it twice from ArcGIS Online. It is a data layer with public rights. What would be the correct solution ?
It looks like you are using a URL that points to hosted FeatureService that you published to ArcGIS Online. If that is true then the line of code that defines the dmsl variable is using that ArcGISDynamicMapServiceLayer class, but is passing in a FeatureService. You could change the class to ArcGISFeatureLayer and add a MODE for the second argument. Then that layer should display.
This last line is additional too compared to the original code. It's now almost functioning as it should.
After changing attribute values that define the symbology the new symbology is not yet consequently changed. I replaced one of the last lines in the original code:
dmsl.refresh();
with:
featureLayer.refresh();
It seems that changes are only effectively shown after first choosing Apply and then Edit again followed by Discard. Strange but less problematic. Replacing the code with featureLayer0.refresh(); didn't help. Somewhere I missed the logic behind this.
Despite this using the samples is very effective for extending my knowledge.