I am trying to follow along some ArcGIS JavaScript API samples for my app. I have replaced their layers with mine along with some of the attribute info for the AttributeInspector widget. Everything works except the most essential part of my app, the AttributeInspector window. I cannot figure out why my fields don't display on the right pane of my page. The text in the details pane will actually change its title which indicates that it listens to the click event. However no attributes show. The legend, shows, but not the attribute inspector. I've debugged and every object is stable, including the attributeinspector which contains the featurelayer object it should correspond with. Why doesn't this work?
ESRI, doesn't really explain much of this widget. Their documentation lacks detail. There are no best practices for different implementations of building a map (via esri.Map or esri.arcgis.utils.createMap) and using specific widgets for a particular implementation. Anyway, here is a photo before and after result with code.
[ATTACH=CONFIG]27051[/ATTACH] [ATTACH=CONFIG]27052[/ATTACH] Here is the relevant javascript code:
Here is the html ----------------------------------------------------------------------------------------------------------------- <%-- Created by IntelliJ IDEA. User: jcorrea Date: 8/12/13 Time: 3:12 PM To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>Region VIII PA Tracker</title> <link rel="stylesheet" type="text/css" media="all" href="styles/main.css"/>
<div data-dojo-type="dijit.layout.AccordionContainer"> <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="title:'Details', selected:true"> <span id="details">Click a point to edit attributes.</span> <div id="attributeEdit"></div>
The code snippet has the objectid field hard-coded into it. In the earlier snippet the objectid field was named ID. For the geology layer its objectid. Here's a fiddle showing the code working with the geology layer. http://jsfiddle.net/xBDKb/13/
Kelly, that solved my problem with the geology layer and with my points layer! It reminded me to keep aware of what the objectid field is named. Thanks