Select to view content in your preferred language

Enhanced-Search-Widget-for-FlexViewer Part II

137774
552
04-19-2012 08:03 AM
RobertScheitlin__GISP
MVP Emeritus
All,

   I am pleased to announce the next release of my eSearch Widget.

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

Version 2.5.1.7 - 4/19/2012
* Added ability to search (flat/standalone/no geometry) tables.
* This time all Zooming uses the same scaling (popup, datagrid, widget results, zoom to all).
* Added Relates icon/button to datagrids so that you can click on it in the datagrid to
  open relates choice dialog.
* Move all skins to a skins package for cleaner organization.
* Links that are not associated with a field now work.
* Ability to disable the relates tab in the fixed widget is now configurable.
552 Replies
AdamZiegler
Deactivated User
Awesome, thanks! I also wanted to ask if it's possible to add all fields to the grid when using the <fields all="true" /> option.  I have found myself working with data sources that have many fields and being able to throw them all in the grid without formatting them would be cool....although I guess I'd want to limit the amount of fields in the Search results.  Perhaps I am being a bit lazy.

Thanks,
Adam Z
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Adam,

   Serveral people have asked about this posibility and I continue to say no. As a matter of best practice you should not just return all your fields as this is likely unneeded and not optimal.
0 Kudos
JORGELAGOS2
Emerging Contributor
Hello Robert.

I am using eSearch 3.0 to do my site's searches and everything is working fine but he grid reults table is not showing totally rectangular as it used to in the 2.5 application.  I mean the top bar "Search Results" and the bottom bar " Export to CSV Export to TXT are both showing narrower than the middle part of the table.

Thanks for your help

Jorge
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jorge,

   Wow, I have not seen that one before... Can you share your eSearchWidget.xml file?
0 Kudos
JORGELAGOS2
Emerging Contributor
HERE IT IS FIRST THE CODE FROM THE MAIN config.xml

<widgetcontainer layout="float">
<widgetgroup label="Search" icon="assets/images/i_search.png">
<widget label="Mile Posts" left="50" top="420" icon="assets/images/i_pin2.png" config="widgets/eSearch/Mile_Posts.xml" url="widgets/eSearch/SearchWidget.swf"/>
<widget label="Land" left="300" top="420" icon="assets/images/i_draw_poly.png" config="widgets/eSearch/Land.xml" url="widgets/eSearch/SearchWidget.swf"/>
</widgetgroup>

HERE IS THE CODE FOR lands.xml


Land.xml


<?xml version="1.0" ?>
<!-- See Enhanced Search Widget XML Configuration.pdf for detailed explanation -->
<configuration>
<layers>
<layer>
<definitionexpression></definitionexpression>
<enableexport>true</enableexport>
<name>Property Parcels</name>
<url>http://gis.do.com/Do/rest/services/coast_searches/MapServer/2</url>
<expressions>
<expression alias="Property Parcels" textsearchlabel="ENTER: TRACTNUM or LONAME1">
<values>
<value>
upper(TRACTNUM) like upper('%[value]%') or upper(LONAME1) like upper('%[value]%')
</value>
</values>
</expression>
</expressions>

<graphicalsearchlabel>Use one of the graphical search tools to select Property Parcels</graphicalsearchlabel>
<spatialsearchlayer>true</spatialsearchlayer>
<titlefield>TRACTNUM</titlefield>
<fields all="false">
<field name="TRACTSOURC" gridfield="true" gridfieldonly="true"/>
<field name="TRACTCODE" gridfield="true" gridfieldonly="true"/>
</fields>
<links/>
<zoomscale usegeometry="true" zoompercent="15"></zoomscale>
</layer>

</layers>


<spatialrelationships>
<!-- possible spatial relationships esriSpatialRelIntersects | esriSpatialRelContains
| esriSpatialRelCrosses | esriSpatialRelEnvelopeIntersects | esriSpatialRelIndexIntersects
| esriSpatialRelOverlaps | esriSpatialRelTouches | esriSpatialRelWithin currently
unavailable: esriSpatialRelRelation -->
<spatialrelationship>
<name>esriSpatialRelContains</name>
<label>entirely contained in</label>
</spatialrelationship>
<spatialrelationship>
<name>esriSpatialRelIntersects</name>
<label>interssected by</label>
</spatialrelationship>
<spatialrelationship>
<name>esriSpatialRelEnvelopeIntersects</name>
<label>intersected by envelop of</label>
</spatialrelationship>
</spatialrelationships>
<bufferunits>
<bufferunit>
<name>UNIT_FOOT</name>
<label>Feet</label>
</bufferunit>
<bufferunit>
<name>UNIT_STATUTE_MILE</name>
<label>Miles</label>
</bufferunit>
<bufferunit>
<name>UNIT_METER</name>
<label>Meters</label>
</bufferunit>
<bufferunit>
<name>UNIT_KILOMETER</name>
<label>Kilometers</label>
</bufferunit>
</bufferunits>
<enabledatagridinteractionwithwidget>true</enabledatagridinteractionwithwidget>
<toleranceforpointgraphicalselection>6</toleranceforpointgraphicalselection><!-- value is in screen pixels -->
<tolerancebydefault>false</tolerancebydefault>
<spatialreference>102003</spatialreference>
<zoomscale>2400</zoomscale>
<geometryservice>http://gis.do.com/Do/rest/services/Geometry/GeometryServer</geometryservice>
<csvseparator>,</csvseparator>
<disablebuttons></disablebuttons><!--possible values one or more not all four search types comma separated text,graphic,spatial,grid,datagrid -->
<defaultselectionoption>textInput</defaultselectionoption><!--possible values only one graphicalInput or textInput or spatialInput -->
<enabledrawgraphicbutton>true</enabledrawgraphicbutton>
<enablebuffergraphicbutton>true</enablebuffergraphicbutton>
<selectedgraphicaltool></selectedgraphicaltool><!-- possible values are extent or polygon or mappoint or polyline or nothing -->
<multipartgraphicsearch>false</multipartgraphicsearch>
<floatorfixed>float</floatorfixed><!-- possible values are fixed and float -->
<relatetooltip>Show Relates</relatetooltip>
<relateicon>widgets/eSearch/assets/images/i_relate.png</relateicon>
<labels>
<bufferusergraphics>Buffer Graphic</bufferusergraphics>
<norelatesfound>No related features found for: </norelatesfound>
<norelatesfoundalerttitle>No Results</norelatesfoundalerttitle>
<addtolerance>Add search tolerance to point selection</addtolerance>
<existingdrawgraphicslabel>Use Existing eDraw Widget Graphics</existingdrawgraphicslabel>
<existingbuffergraphicslabel>Use Existing Point Buffer Widget Graphics</existingbuffergraphicslabel>
<graphicalsearchlabel>Graphical Search</graphicalsearchlabel>
<textsearchlabel>Text Search</textsearchlabel>
<resultslabel>Results</resultslabel>
<layerlabel>Search Layer:</layerlabel>
<layerfieldlabel>Search Layer Field:</layerfieldlabel>
<nolayerlabel>No search layer defined.</nolayerlabel>
<submitlabel>Search</submitlabel>
<pointlabel>Select by Point</pointlabel>
<linelabel>Select by Line</linelabel>
<rectanglelabel>Select by Rectangle</rectanglelabel>
<polygonlabel>Select by Polygon</polygonlabel>
<clearlabel>Clear</clearlabel>
<loadinglabel>Loading...</loadinglabel>
<selectionlabel>Features Selected:</selectionlabel>
<gridresultslabel>Show Results in Grid</gridresultslabel>
<csvdefaultname>Selected Records</csvdefaultname>
<relatescsvdefaultname>Related Records</relatescsvdefaultname>
<exportbtnlabel>Export...</exportbtnlabel>
<export2csvoptionlabel>Export to CSV...</export2csvoptionlabel>
<export2txtoptionlabel>Export to Txt...</export2txtoptionlabel>
<bufferlabel>apply a search distance:</bufferlabel>
<spatialsearchlabel>Spatial search</spatialsearchlabel>
<applybufferlabel>Apply buffer</applybufferlabel>
<searchlayerlabel>Search entities of:</searchlayerlabel>
<enablemultipartsearch>enable multi-part graphics</enablemultipartsearch>
<zoomalllabel>Zoom</zoomalllabel>
<zoomalltip>Zoom to all results</zoomalltip>
<bufferalpha>Adjust buffer alpha</bufferalpha>
<buffercolor>Select buffer color</buffercolor>
</labels>
<symbols>
<simplefillsymbol color="0xff0000" alpha="0.5">
<outline color="0xff0000" alpha="0.8" width="2" />
</simplefillsymbol>
<!-- You can have one or the other, either simplemarkersymbol or picturemarkersymbol
defined for your point results NOT BOTH. picturemarkersymbol will override
simplemarkersymbol if you do not have it commented out. -->
<!--<simplemarkersymbol style="square" size="12" color="0xff0000" alpha="0.5"
xoffset="0" yoffset="0" angle="0"> <outline style="solid" color="0x000000"
alpha="1" width="1"/> </simplemarkersymbol> -->
<picturemarkersymbol url="assets/images/i_search.png" height="30" width="30" xoffset="0" yoffset="0" />
<simplelinesymbol color="0xff0000" alpha="0.8" width="2" />
</symbols>
</configuration>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jorge,

   It is highly unlikely that to configuration you provided me would have produced the result you have in your screen shot with out the widgets source code having been modified...
0 Kudos
JORGELAGOS2
Emerging Contributor
Hello Robert, thanks for the help but I can assure you we haven't change the swf code. Could the problem be something with the field length on our data.  I am probably asking too much but could you try to test some data with long field lengths and see what you get?

Thanks

Jorge
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jorge,

   The reason I mention a possible code change on your part was there is nothing in your lands.xml that specifies any more than 2 grid fields and in the image you have LOTS of fields displayed?...
0 Kudos
JORGELAGOS2
Emerging Contributor
Sorry Robert for misleading you but I delete many fields from the actual code to make it more readable. Below I include all the fields
<graphicalsearchlabel>Use one of the graphical search tools to select Property Parcels</graphicalsearchlabel>
<spatialsearchlayer>true</spatialsearchlayer>
<titlefield>TRACTNUM</titlefield>
<fields all="false">
<field name="TRACTSOURC" gridfield="true" gridfieldonly="true"/>
<field name="TRACTCODE" gridfield="true" gridfieldonly="true"/>
<field name="TRACTNUM" gridfield="true"/>
<field name="ASSOC_TR" gridfield="true" gridfieldonly="true"/>
<field name="UFSID" gridfield="true" gridfieldonly="true"/>
<field name="LONAME1" gridfield="true"/>
<field name="LONAME2" gridfield="true" gridfieldonly="true"/>
<field name="COUNTY" gridfield="true" gridfieldonly="true"/>
<field name="STATE" gridfield="true" gridfieldonly="true"/>
<field name="SECTION" gridfield="true" gridfieldonly="true"/>
<field name="TOWNSHIP" gridfield="true" gridfieldonly="true"/>
<field name="RANGE" gridfield="true" gridfieldonly="true"/>
<field name="ABSTRACTNO" gridfield="true" gridfieldonly="true"/>
<field name="SURVEYNAME" gridfield="true" gridfieldonly="true"/>
<field name="LGLSOURCE" gridfield="true" gridfieldonly="true"/>
<field name="LEGALDESC" gridfield="true" gridfieldonly="true"/>
<field name="LNLIST_ACR" gridfield="true" gridfieldonly="true"/>
<field name="LEGALACRES" gridfield="true" gridfieldonly="true"/>
<field name="SHAPEACRES" gridfield="true" gridfieldonly="true"/>
<field name="ONLINE" gridfield="true" gridfieldonly="true"/>
<field name="ROUTE" gridfield="true" gridfieldonly="true"/>
<field name="BEGINMP" gridfield="true" gridfieldonly="true"/>
<field name="ENDMP" gridfield="true" gridfieldonly="true"/>
<field name="BEGINSTA" gridfield="true" gridfieldonly="true"/>
<field name="ENDSTA" gridfield="true" gridfieldonly="true"/>
<field name="FOOTAGE" gridfield="true" gridfieldonly="true"/>
<field name="PERM_ACRES" gridfield="true" gridfieldonly="true"/>
<field name="TEMP_ACRES" gridfield="true" gridfieldonly="true"/>
<field name="ETWS_ACRES" gridfield="true" gridfieldonly="true"/>
<field name="TOTL_WS_AC" gridfield="true" gridfieldonly="true"/>
<field name="SURVEYED" gridfield="true" gridfieldonly="true"/>
<field name="MAPPER" gridfield="true" gridfieldonly="true"/>
<field name="PLOTDATE" gridfield="true" gridfieldonly="true" dateformat="MM/DD/YYYY"/>
<field name="LOADDATE" gridfield="true" gridfieldonly="true" dateformat="MM/DD/YYYY"/>
<field name="MOCID" gridfield="true" gridfieldonly="true"/>
<field name="MOCIDPREV" gridfield="true" gridfieldonly="true"/>
<field name="SSPREVIOUS" gridfield="true" gridfieldonly="true"/>
<field name="SSCURRENT" gridfield="true" gridfieldonly="true"/>
<field name="SBPREVIOUS" gridfield="true" gridfieldonly="true"/>
<field name="SBCURRENT" gridfield="true" gridfieldonly="true"/>
<field name="DEL" gridfield="true" gridfieldonly="true"/>
<field name="REV" gridfield="true" gridfieldonly="true"/>
<field name="PS_PAGE" gridfield="true" gridfieldonly="true"/>
<field name="ISSUE" gridfield="true" gridfieldonly="true"/>
<field name="NOMSCALE" gridfield="true" gridfieldonly="true"/>
<field name="STATUS" gridfield="true" gridfieldonly="true"/>
<field name="GIS_DEL" gridfield="true" gridfieldonly="true"/>
<field name="PLAT" gridfield="true" gridfieldonly="true"/>
<field name="CLOSED" gridfield="true" gridfieldonly="true"/>
<field name="PLAT_REV" gridfield="true" gridfieldonly="true"/>
<field name="TRO" gridfield="true" gridfieldonly="true"/>
<field name="WK_PROJ" gridfield="true" gridfieldonly="true"/>
<field name="TITLE" gridfield="true" gridfieldonly="true"/>
<field name="CRNS" gridfield="true" gridfieldonly="true"/>
<field name="MISC" gridfield="true" gridfieldonly="true"/>
<field name="GIS_NOTES" gridfield="true" gridfieldonly="true"/>
<field name="TIM_DEL" gridfield="true" gridfieldonly="true"/>
<field name="TIM_REV" gridfield="true" gridfieldonly="true"/>
<field name="TIM_CO" gridfield="true" gridfieldonly="true"/>
<field name="SMAP_NAME" gridfield="true" gridfieldonly="true"/>
<field name="SMAP_NUM" gridfield="true" gridfieldonly="true"/>
<field name="SMAP_SCALE" gridfield="true" gridfieldonly="true"/>
<field name="SMAP_ANGLE" gridfield="true" gridfieldonly="true"/>
<field name="DWG_DATE" gridfield="true" gridfieldonly="true" dateformat="MM/DD/YYYY"/>
<field name="DWG_NUM" gridfield="true" gridfieldonly="true"/>
<field name="DWN_BY" gridfield="true" gridfieldonly="true"/>
<field name="APPR_BY" gridfield="true" gridfieldonly="true"/>
<field name="CE_HYPERLI" gridfield="true" gridfieldonly="true"/>
<field name="PLAT_HYPER" gridfield="true" gridfieldonly="true"/>
<field name="SURV_CL" gridfield="true" gridfieldonly="true"/>
<field name="TYPE" gridfield="true" gridfieldonly="true"/>
<field name="NAME_DEED" gridfield="true" gridfieldonly="true"/>
<field name="SB_ONLINE" gridfield="true" gridfieldonly="true"/>
<field name="MILEAGE" gridfield="true" gridfieldonly="true"/>
<field name="Spread" gridfield="true" gridfieldonly="true"/>
<field name="ASSOC_CNT" gridfield="true" gridfieldonly="true"/>
<field name="PROP_DIST" gridfield="true" gridfieldonly="true"/>
<field name="RPLS" gridfield="true" gridfieldonly="true"/>
<field name="REVISION" gridfield="true" gridfieldonly="true"/>
<field name="VOL_PAGE" gridfield="true" gridfieldonly="true"/>
<field name="PLAT_PRI" gridfield="true" gridfieldonly="true"/>
<field name="UFS_NAME1" gridfield="true" gridfieldonly="true"/>
<field name="UFS_NAME2" gridfield="true" gridfieldonly="true"/>
<field name="ENTRY_F" gridfield="true" gridfieldonly="true"/>
<field name="ENTRY_T" gridfield="true" gridfieldonly="true"/>
<field name="ENTRY" gridfield="true" gridfieldonly="true"/>
<field name="EXIT_F" gridfield="true" gridfieldonly="true"/>
<field name="EXIT_T" gridfield="true" gridfieldonly="true"/>
<field name="EXIT" gridfield="true" gridfieldonly="true"/>
<field name="CUR_DATE" gridfield="true" gridfieldonly="true" dateformat="MM/DD/YYYY"/>
</fields>
<links/>
<zoomscale usegeometry="true" zoompercent="15"></zoomscale>
</layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jorge,

   I just tried one of my map service layer and defined 54 gridfields without issue in the datagrid...? Are you saying that you have a text field that has it length at 255 or greater and it has data that is that big as well? If so why don't you try and eliminate that field from your list and see what happens. Sure would be nice if I could test against your data.
0 Kudos