I've checked the box for "Add results as operational layer", and as expected, the results from a search are shown in the legend, layer list, and a tab is added for the results layer in the attribute table. However, the attribute table is blank with no records or fields. The results in the search widget are visible and there parcels selected. I've attached a screenshot to help illustrating what I'm experiencing.
Yes, the search and query widgets were both updated at 3.1 to start using feature layer(s) instead of graphics layer to be able to share results. I tried using the out-of-the-box search widget with the Attribute Table widget working as expected. Would it be possible for you to share the config.xml and the search widget's config. Would be easier to debug.
<?xml version="1.0" ?> <configuration> <zoomscale>50000</zoomscale> <shareresults>true</shareresults> <layers> <layer> <name>Parcels</name> <url>http://services.arcgis.com/wgcHnVlNZ7zk98J7/arcgis/rest/services/ECP_New_Parcels/FeatureServer/0</url> <expression>AsmtNum = '[value]'</expression> <textsearchlabel>Search by Parcel Number</textsearchlabel> <titlefield>AsmtNum</titlefield> <fields> <field name="AsmtNum" alias="AsmtNum"/> <field name="Zoning" alias="Zoning"/> <field name="LUD" alias="LUD"/> <field name="ParcelType" alias="ParcelType"/> <field name="CalcAcres" alias="CalcAcres"/> <field name="Owner_Firs" alias="Owner_Firs"/> <field name="Owner_MI" alias="Owner_MI"/> <field name="Owner_Last" alias="Owner_Last"/> <field name="AssesseeNa" alias="AssesseeNa"/> <field name="Mailing_St" alias="Mailing_St"/> <field name="Mailing_Ci" alias="Mailing_Ci"/> <field name="Mailing__1" alias="Mailing__1"/> <field name="Mailing_Zi" alias="Mailing_Zi"/> <field name="Mailing_Ad" alias="Mailing_Ad"/> <field name="LandValue" alias="LandValue"/> <field name="ImprValue" alias="ImprValue"/> </fields> <orderbyfields>AsmtNum</orderbyfields> </layer> </layers> </configuration>
<shareresults>true</shareresults>
private function createSearchResults(featureSet:FeatureSet, queryFields:XMLList):ArrayCollection { var result:ArrayCollection = new ArrayCollection(); var layerDetails:LayerDetails = queryLayer.layerDetails; if (!queryTitleField) { queryTitleField = featureSet.displayFieldName; } for each (var graphic:Graphic in featureSet.features) { var resultAttributes:ResultAttributes = ResultAttributes.toResultAttributes(queryFields, textDirection, graphic, featureSet, queryLayer, layerDetails, widgetTitle, queryTitleField, queryLinkField, queryLinkAlias); var searchResult:ResultItem = new ResultItem(graphic, resultAttributes); result.addItem(searchResult); var infoWindowRenderer:ClassFactory = new ClassFactory(PopUpRenderer); infoWindowRenderer.properties = { popUpInfo: configurePopUpInfo(resultAttributes)}; graphic.infoWindowRenderer = infoWindowRenderer; } resultFeatureLayer.outFields = queryLayer.outFields; // for Attribute Table and/or AttributeInspector resultFeatureLayer.visible = true; resultFeatureLayer.featureCollection = new FeatureCollection(featureSet, layerDetails); switch (featureSet.geometryType) { case Geometry.MAPPOINT: { resultFeatureLayer.renderer = new SimpleRenderer(resultMarkerSymbol); break; } case Geometry.POLYLINE: { resultFeatureLayer.renderer = new SimpleRenderer(resultLineSymbol); break; } case Geometry.POLYGON: { resultFeatureLayer.renderer = new SimpleRenderer(resultFillSymbol); break; } } return result; }
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.