Creating an application using the API, not the viewer. I am attempting to modify the Attribute Inspector (view only) sample from the website to toggle between two layers. When a user clicks on one button, it will populate the attribute inspector with attributes from one feature layer, and if the user clicks the other, then clicks the map, it will populate with attributes from the other feature layer.
Currently, I am toggling visibility of these two feature layers. The attribute inspector correctly grabs the attributes from the proper layer on the first click, but does not properly fill or identify feature attributes on subsequent clicks. It either displays a blank window or keeps the attributes from the first click.
Is there a clear cache property I need to run? or is it possible to query two layers in the same main map?