Select to view content in your preferred language

Enhanced-Search-Widget-for-FlexViewer Part III

143882
776
04-30-2013 03:58 PM
RobertScheitlin__GISP
MVP Emeritus
All,

   Here is a new thread to post questions and discuss the Enhanched Search Widget. The old thread was getting too long.
Tags (2)
776 Replies
RobertScheitlin__GISP
MVP Emeritus
All,

   There is a new version available:

Version 3.2.3 - 4/30/2013
* Added enablemultigraphicssearch
* Added enableincludetextsearch
* Added enableaddtollerance
* Added enablegraphicsbuffering
* Fixed disablelinkifnull issue
* Relate tab name is set to relate label from xml
* Fixed issue using uniquevalsfromfield when only having tables configured
0 Kudos
SladeBridges
Emerging Contributor
Robert,
We have upgraded our services from 9.3.1 to 10.1 and I have added the 10.1 service to the eSearch widget. Everything seems to work except for a print service, basically be have Getaways as shape files in the service that our clients can search for to get a specific pre-made pdf map. The feature for our staging areas work fine, but the ones for our feeders do not work, however the 9.3.1 service works correctly with the same code. The code is as follows:
9.3.1 code:
<layer>
            <definitionexpression/>
            <enableexport>true</enableexport>
            <name>Feeder To Print</name>
            <url>http://west-distserver.southernco.com/arcgis/rest/services/APC-StormMap1/MapServer/0</url>
            <expressions>
                <expression alias="Feeder ID" textsearchlabel="Search by FEEDERID[ Example: '12217']">
                    <values>
                        <value prompt="Example: FEEDERID">FEEDERID in('[value]')</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Fuse</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>Feeder To Print</titlefield>
            <fields all="false">
                <field name="Getaway.SubName" alias="SubName" gridfield="true"/>
                <field name="DISGISDB.getaway.FEEDERID" alias="Feeder ID" gridfield="true"/>
                <field name="Getaway.FeederPrin" alias="FeederPrin" hyperlinkgridfieldonly="true" hyperlinkaliastext="Get Image"/>
            </fields>
            <links>
                <link alias="      ">
                    <![CDATA[{Getaway.FeederPrin}]]>
                    <icon><![CDATA[assets/images/i_camera.png]]></icon>
                </link>
            </links>
            <zoomscale usegeometry="true" zoompercent="2"/>
        </layer>
10.1 code:
<layer>
            <definitionexpression/>
            <enableexport>true</enableexport>
            <name>Feeder To Print</name>
            <url>http://alxapap53ts:6080/arcgis/rest/services/APC/Print_Services/MapServer/0</url>
            <expressions>
                <expression alias="FEEDERID " textsearchlabel="Search by FEEDERID[ Example: '12217']">
                    <values>
                        <value prompt="Example: FEEDERID">FEEDERID in ('[value]')</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Fuse</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>Feeders To Print</titlefield>
            <fields all="false">
                <field name="DISGISDB.getaway.FEEDERID " alias="Feeder ID" gridfield="true"/>
                <field name="DISGISDB.getaway.FEEDER_DESCRIPT  " alias="Feeder Description" gridfield="true"/>
                <field name="PrintServices.FeederPrin" alias="FeederPrin" hyperlinkgridfieldonly="true" hyperlinkaliastext="Get Image"/>
            </fields>
            <links>
                <link alias="      ">
                    <![CDATA[{PrintServices.FeederPrin}]]>
                    <icon><![CDATA[assets/images/i_camera.png]]></icon>
                </link>
            </links>
            <zoomscale usegeometry="true" zoompercent="2"/>
        </layer>
[ATTACH=CONFIG]23946[/ATTACH]
[ATTACH=CONFIG]23949[/ATTACH]
i have attache screen shots from both
0 Kudos
SladeBridges
Emerging Contributor
Should have said i am on Flex Viewer 3.1 and eSearch Widget 3.1.8
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Slade,

  It looks like you have a 1009 error using either services... I would check the spelling (and CaSe) of the field names. Also in diagnosing ths issue it would be benifical to you to attempt the same exact query using the where clause and out fields directly from your Rest Service Directory page.
0 Kudos
SladeBridges
Emerging Contributor
Slade,

  It looks like you have a 1009 error using either services... I would check the spelling (and CaSe) of the field names. Also in diagnosing ths issue it would be benifical to you to attempt the same exact query using the where clause and out fields directly from your Rest Service Directory page.


where in the instructions is an example of using a where clause to pull directly from the rest services directory?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Slade,

   Just go to your servers API Reference url:

http://YourServerAddress/arcgis/sdk/index.html?catalog.html
and choose query as the topic from the table of contents.
0 Kudos
NicholasMcNamara
Frequent Contributor
In the new version, I see that the tooltip for the relate icon in the eSearch results is changed to the relate label in the XML, but it does not seem to be applying to the tab in the grid name for me. That still seems to be using the relateresulttab element in the FixedDG XML. This is the XML for each of my 2 layers I'm using relates for, along with the related FixedDG XML. When I run a search on either of these layers, the tab is labeled "Related Data." I'm not sure if this is a bug, if the XML in the FixedDG XML is set to override the regular XML, if I'm making another configuration error, or if I misunderstood the update.

layer 1
<layer>
 <definitionexpression/>
 <enableexport>false</enableexport>
 <name>Pole</name>
 <url>http://SNEW-GIS.NORWALK2NDWATER.COM/ArcGIS/rest/services/Operational_Layers/Operational_Electric/MapServer/18</url>
<expressions>
<expression alias="Pole #" textsearchlabel="Search Poles by Pole Number:" isvaluerequired="true">
<values>
 <value prompt="Example: C9178" isvaluerequired="true">facilityID like '[value]'</value>
 </values>
 </expression>
<expression alias="Street Name" textsearchlabel="Search Poles by Street:" isvaluerequired="true">
<values>
 <value prompt="Example: Outlook" isvaluerequired="true">street like '%[value]%'</value>
 </values>
 </expression>
 </expressions>
 <graphicalsearchlabel>Use one of the graphical search tools to select Poles</graphicalsearchlabel>
 <spatialsearchlayer>false</spatialsearchlayer>
 <titlefield>facilityID</titlefield>
<fields all="false">
 <field name="comments" gridfield="true"/>
 <field name="subtypeCode" gridfield="true"/>
 <field name="facilityID" gridfield="true" sort="asc|2|string"/>
 <field name="poleHeight" gridfield="true"/>
 <field name="poleClass" gridfield="true"/>
 <field name="poleType" gridfield="true"/>
 <field name="owner" gridfield="true"/>
 <field name="poleUse" gridfield="true"/>
 <field name="circuitID" gridfield="true"/>
 <field name="street" gridfield="true" sort="asc|1|string"/>
 <field name="maintenance" gridfield="true"/>
 <field name="routeNumber" gridfield="true"/>
 <field name="poleHeightEstimated" gridfield="true"/>
 <field name="poleClassEstimated" gridfield="true"/>
 <field name="instDate" gridfield="true"/>
 <field name="PoleTopExtension" gridfield="true" alias="Pole Top Extension"/>
 </fields>
 <links/>
 <zoomscale usegeometry="true" zoompercent="1.6"/>
 <autoopendatagrid>true</autoopendatagrid>
<relates>
<relate id="5" label="Joint Use" enableexport="true" icon="assets/images/Pole.png" printitle="Joint Use" enableprintgrid="true">
<fields all="false">
 <field name="poleNumber"/>
 <field name="jUseType"/>
 <field name="companyID"/>
 </fields>
 <zoomscale usegeometry="true" zoompercent="1.6"/>
 </relate>
 </relates>
 <queryattachments>true</queryattachments>
 </layer>


layer 2
<layer>
 <definitionexpression/>
 <enableexport>true</enableexport>
 <name>Hydrant</name>
 <url>http://SNEW-GIS.NORWALK2NDWATER.COM/ArcGIS/rest/services/Operational_Layers/Operational_Water/MapServer/5</url>
<expressions>
<expression alias="Street / Cross Street Name" textsearchlabel="Search by Street / Cross Street Name:" isvaluerequired="true">
<values>
 <value prompt="Example: Flax Hill" userlist="" isvaluerequired="true" operator="AND">LOCATION like '%[value]%' OR X_STREET like '%[value]%'</value>
 </values>
 </expression>
<expression alias="District and Hydrant #" textsearchlabel="Search Hydrants by District and Hydrant Number:" isvaluerequired="true">
<values>
 <value prompt="Example: 2" userlist="2,3,5,6,W" isvaluerequired="true">DISTRICT like '[value]'</value>
 <value prompt="Example: 112" userlist="" isvaluerequired="true">FACILNUM like '[value]'</value>
 </values>
 </expression>
 </expressions>
 <graphicalsearchlabel>Use one of the graphical search tools to select hydrants</graphicalsearchlabel>
 <spatialsearchlayer>false</spatialsearchlayer>
 <titlefield>Hyperlink_Flex</titlefield>
<fields all="false">
 <field name="DISTRICT" gridfield="true" sort="asc|1|string"/>
 <field name="FACILNUM" gridfield="true" sort="asc|2|string"/>
 <field name="LOCATION" gridfield="true"/>
 <field name="X_STREET" gridfield="true"/>
 <field name="HY_MAKE" gridfield="true"/>
 <field name="PORT" gridfield="true"/>
 <field name="STEAMER" gridfield="true"/>
 <field name="BURY" gridfield="true"/>
 <field name="STATUS" gridfield="true"/>
 <field name="GATE" gridfield="true"/>
 <field name="CONNECTN" gridfield="true"/>
 <field alias="Barrel" name="BARRELL" gridfield="true"/>
 <field name="LAT_SIZE" gridfield="true"/>
 <field name="DIR_OPEN" gridfield="true"/>
 <field name="INST_DATE" dateformat="MM/DD/YYYY" gridfield="true"/>
 <field name="MN_SIZE" gridfield="true"/>
 <field name="MN_MTRL" gridfield="true"/>
 <field name="INSTL_BY" gridfield="true"/>
 <field name="JOB_NUM" gridfield="true"/>
 <field name="NXT_INSP" dateformat="MM/DD/YYYY" gridfield="true"/>
 <field name="F_ORDER" gridfield="true"/>
 <field name="DESCRIPT" gridfield="true"/>
 <field name="REMARKS" gridfield="true"/>
 <field name="Hyperlink_Flex" visible="false" gridfield="true"/>
 </fields>
<links>
<link alias="Open Hydrant Card" disablelinksifnull="true">
 http://SNEW-GIS.NORWALK2NDWATER.COM/hydrants/{Hyperlink_Flex}.dwg
 <icon>assets/images/ACAD_icon_9_48x48x32.png</icon>
 </link>
 </links>
 <zoomscale usegeometry="true" zoompercent="2"/>
 <autoopendatagrid>true</autoopendatagrid>
 <queryattachments>false</queryattachments>
<symbology>
<simplefillsymbol color="0x0000ff" alpha="0.5">
 <outline color="0x00ffff" alpha="0.8" width="2"/>
 </simplefillsymbol>
 </symbology>
<relates>
<relate id="0" label="Hydrant Flushing" enableexport="true" icon="widgets/eSearch/assets/images/HydrantFlushing48x48.png" printitle="Hydrant Flushing" enableprintgrid="true">
<fields all="false">
 <field name="JOIN_KEY_LABEL"/>
 <field name="INS_DATE" sort="dsc|1|date" dateformat="MM/DD/YYYY"/>
 <field name="STA_PSI"/>
 <field name="RES_PSI"/>
 <field name="TEST_HY"/>
 <field name="INS_TYPE"/>
 <field name="FLOW"/>
 <field name="TEST_DUR"/>
 </fields>
 <zoomscale usegeometry="true" zoompercent="1.6"/>
 </relate>
 </relates>
 </layer
>

Also:
 <relatetooltip>Show Related Data</relatetooltip>
 <relateicon>widgets/eSearch/assets/images/i_relate.png</relateicon>

DG XML:
<configuration>
 <autohide>true</autohide>
 <height>200</height>
 <duration>3000</duration>
<labels>
 <searchresulttab>Search Results</searchresulttab>
 <relateresulttab>Related Data</relateresulttab>
 <autohidelabel>Auto hide</autohidelabel>
 </labels>
 </configuration>


Thanks,
Nick
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nick,

The relates Results tab will us the relateresulttab tag from the datagrid xml until you choose the relate. This is the intended behavior as you only have on relate per layer but others like my preview site has MULTIPLE relates assigned to one layer and thus the tabs label can not be changed until I know which relate you have chosen.
0 Kudos
NicholasMcNamara
Frequent Contributor
When you say "when you choose the relate," how are you determining when the relate is chosen? Even after I click the relate icon and view the data in the datagrid, the tab label does not change. Would it be possible to detect whether there was only one relate and set it to the only label present?
0 Kudos