Stuggling to get this new widget to work. I'm finding if I specify in the config something like this:
<layer label="Boundaries" url="http://testserver/arcgis/rest/services/Boundaries/Boundaries/MapServer/0"></layer> <!-- non-mapped layer(s), added for just this widget -->
It works and show all features, but doesn't update when you pan to a new extent and if I set the config like this:
<layersettings>
<layer name="Boundaries"> <!-- Overwriting layer settings for a map service layer -->
<sublayer id="0" iseditable="false"> <!-- is editable only supported for a sub layer within a map service layer -->
<fields>
<field name="objectid" alias="ObjectID"/>
</fields>
<showobjectid>false</showobjectid>
<showglobalid>false</showglobalid>
<exportlocation>true</exportlocation>
<showattachments>false</showattachments>
<showrelatedrecords>false</showrelatedrecords>
<columnsorder>alphabetical</columnsorder>
</sublayer>
</layer>
</layersettings>
The above references a map service like this in my main config file:
<layer label="Boundaries" type="dynamic" visible="false" alpha="1.0"
url="http://testserver/arcgis/rest/services/Boundaries/Boundaries/MapServer"/>
It doesn't work at all. What am I doing wrong and how can I set this attribute table to work with map services I have defined in the main config file?
<operationallayers> <layer label="311" type="feature" visible="false" alpha="1.0" url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0"/> <layer label="PoolPermits" type="dynamic" visible="false" alpha="1.0" url="http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/MapServer"/> </operationallayers>
<layer label="Military_Units" url="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Military/FeatureServer/2">
It works and show all features, but doesn't update when you pan to a new extent
Hey Shaun,
Just to clarify a bit more, the AttributeTable widget allows you to:
a) work with layers added to the map (for feature layers, it directly adds them, for a map service it goes in an find the corresponding featurelayers and adds them)
e.g:<operationallayers> <layer label="311" type="feature" visible="false" alpha="1.0" url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0"/> <layer label="PoolPermits" type="dynamic" visible="false" alpha="1.0" url="http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/MapServer"/> </operationallayers>
Would add 311 layer and corresponding feature layers(2) from PoolPermits map service. You dont have to do anything in the widget's config for this.
Is this really true? I can see the attributes from any service loaded as type="feature", but I see no attribute information at all with any of the type="dynamic" mapservices using the default attributetablewidget.xml.
The only example in the documentaion is for AppBuilder and it has a screenshot allowing you to select which layers to show in the attribute table. Is this actually modifying the xml to show sublayers, or is the AttributeWidget actually supposed to show them all by default like it does with type="feature"?
Thanks,
R_
TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.esri.ags.components::AttributeTable/updateGraphicCollection()at com.esri.ags.components::AttributeTable/checkForVisibilityAndScale() at com.esri.ags.components::AttributeTable/refresh() at widgets.AttributeTable::AttributeTableWidget/featureLayer_hideShowHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.core::UIComponent/setVisible() at mx.core::UIComponent/set visible() at com.esri.ags.layers::Layer/set visible() at widgets.AttributeTable::AttributeTableWidget/updateFeatureLayersVisibility() at widgets.AttributeTable::AttributeTableWidget/layer_hideShowHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.core::UIComponent/setVisible() at mx.core::UIComponent/set visible() at com.esri.ags.layers::Layer/set visible() at com.esri.viewer.components.toc.tocClasses::TocMapLayerItem/refreshLayer() at com.esri.viewer.components.toc.tocClasses::TocItem/setVisible() at com.esri.viewer.components.toc.tocClasses::TocItem/set visible() at com.esri.viewer.components.toc.tocClasses::TocItemRenderer/onCheckBoxClick()
<operationallayers> <layer label="311" type="feature" visible="false" alpha="1.0" url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0"/> <layer label="PoolPermits" type="dynamic" visible="true" alpha="1.0" url="http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/MapServer"/> <layer label="WasteSites" type="dynamic" visible="true" alpha="1" url="http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/All_Waste_Sites2/MapServer"/> <layer label="MRTest" type="feature" visible="true" alpha="0.5" url="http://gis01.wch-rcc.com/ArcGIS/rest/services/rkz/mrtest/MapServer/0"/> </operationallayers>
Is this really true? I can see the attributes from any service loaded as type="feature", but I see no attribute information at all with any of the type="dynamic" mapservices using the default attributetablewidget.xml.
The only example in the documentaion is for AppBuilder and it has a screenshot allowing you to select which layers to show in the attribute table. Is this actually modifying the xml to show sublayers, or is the AttributeWidget actually supposed to show them all by default like it does with type="feature"?
Thanks,
R_
So, is there something special about the ESRI service(s) you listed below, as both of them will show up in the attribute table. Of course, the way you coded it visible="false", one has to actually click the checkbox to turn it on.
The first time I turn on the dynamic layer I get this error (twice):
TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.esri.ags.components::AttributeTable/updateGraphicCollection()at com.esri.ags.components::AttributeTable/checkForVisibilityAndScale() at com.esri.ags.components::AttributeTable/refresh() at widgets.AttributeTable::AttributeTableWidget/featureLayer_hideShowHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.core::UIComponent/setVisible() at mx.core::UIComponent/set visible() at com.esri.ags.layers::Layer/set visible() at widgets.AttributeTable::AttributeTableWidget/updateFeatureLayersVisibility() at widgets.AttributeTable::AttributeTableWidget/layer_hideShowHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent() at mx.core::UIComponent/setVisible() at mx.core::UIComponent/set visible() at com.esri.ags.layers::Layer/set visible() at com.esri.viewer.components.toc.tocClasses::TocMapLayerItem/refreshLayer() at com.esri.viewer.components.toc.tocClasses::TocItem/setVisible() at com.esri.viewer.components.toc.tocClasses::TocItem/set visible() at com.esri.viewer.components.toc.tocClasses::TocItemRenderer/onCheckBoxClick()
after dismissing/continuing past the error, it seems to load/unload the attributes as you check/un-check the checkbox (as expected) so it appears to actually honor the visible="" from the checkbox. If I uncheck a layer, it's tab is removed from the attribute table. If I load as visible="true", then I never get the error, no matter how many times I check/uncheck the box. With the type="feature" layer, I never get the error, no matter if visible on load or not.
// AttributeTable(featureLayerToAttributeTable[featureLayer]).refresh();
However, no matter how I load my services, I only see the attributes if I load them as type="feature", and will NOT show any attributes from a dynamic service.
<operationallayers> <layer label="311" type="feature" visible="false" alpha="1.0" url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0"/> <layer label="PoolPermits" type="dynamic" visible="true" alpha="1.0" url="http://sampleserver6.arcgisonline.com/arcgis/rest/services/PoolPermits/MapServer"/> <layer label="WasteSites" type="dynamic" visible="true" alpha="1" url="http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/All_Waste_Sites2/MapServer"/> <layer label="MRTest" type="feature" visible="true" alpha="0.5" url="http://gis01.wch-rcc.com/ArcGIS/rest/services/rkz/mrtest/MapServer/0"/> </operationallayers>
In this example the MRTest attributes populate the grid, WasteSites just seems to be ignored (no tab, no data, nothing). Same thing if I load the MRTest as dynamic.
Unfortunatly, my service is not public, but here is how I have it loaded. Do you see anything I am missing? This is a AGS 10.05 service, and have also tried with 10.11 service, but no joy.
Any ideas?
R_