Select to view content in your preferred language

Enhanced Search Widget - Domains

3047
25
09-21-2012 08:40 AM
AndrewMilanes
Frequent Contributor
I can't seem to figure out the correct expression syntax for using a domain.  Here's what I have, which isn't working:

        <layer>
            <definitionexpression/>
            <enableexport>true</enableexport>
            <name>Field Boom</name>
            <url>http://webmaps.es2-inc.com:6080/arcgis/rest/services/dfm_fs/Group_Response_Assets/FeatureServer/5</url>
            <expressions>
                <expression alias="Boom Type" textsearchlabel="Seach for Boom Type:" isvaluerequired="false">
                    <values>
                        <value prompt="Select boom type" usedomain="true" field name="TYPE">TYPE = '[value]'</value>
                    </values>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Boom</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>TYPE</titlefield>
            <fields all="true"/>
            <links/>
            <zoomscale usegeometry="true" zoompercent="2"/>
            <autoopendatagrid>false</autoopendatagrid>
            <queryattachments>false</queryattachments>
            <relates/>
            <symbology>
                <simplefillsymbol color="0x0000ff" alpha="0.5">
                    <outline color="0x00ffff" alpha="0.8" width="2"/>
                </simplefillsymbol>
            </symbology>
        </layer>
Tags (2)
0 Kudos
25 Replies
AndrewMilanes
Frequent Contributor
Thanks!  I'll download it now and give it a shot.
0 Kudos
AndrewMilanes
Frequent Contributor
Still getting error 1085:

<layer>
<definitionexpression/>
<enableexport>true</enableexport>
<name>Field Boom</name>
<url>http://webmaps.es2-inc.com:6080/arcgis/rest/services/dfm_fs/Group_Response_Assets/FeatureServer/5</url>
<expressions>
<expression alias="Boom Type" textsearchlabel="Seach for Boom Type:" isvaluerequired="false">
<values>
<value prompt="Select boom type" usesubtype="true" field="TYPE">TYPE = [value]</value>
</values>
</expressions>
<graphicalsearchlabel>Use one of the graphical search tools to select Boom</graphicalsearchlabel>
<spatialsearchlayer>true</spatialsearchlayer>
<titlefield>TYPE</titlefield>
<fields all="true"/>
<links/>
<zoomscale usegeometry="true" zoompercent="2"/>
<autoopendatagrid>false</autoopendatagrid>
<queryattachments>false</queryattachments>
<relates/>
<symbology>
<simplefillsymbol color="0x0000ff" alpha="0.5">
<outline color="0x00ffff" alpha="0.8" width="2"/>
</simplefillsymbol>
</symbology>
</layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   The usesubtype does not require the field attribute:

<value prompt="Select boom type" usesubtype="true">TYPE = [value]</value>


Not sure what else might be causing your issue as I have test on my end and this works.
0 Kudos
DavidAlford1
Occasional Contributor
This is the entire code. This is a secured service layer...not sure if that has anything to do with it. BTW...I work with Andrew

<configuration>
    <layers>
<layer>
<definitionexpression/>
<enableexport>true</enableexport>
<name>Field Boom</name>
<url>http://webmaps.es2-inc.com:6080/arcgis/rest/services/dfm_fs/Group_Response_Assets/FeatureServer/5</url>
<expressions>
<expression alias="Boom Type" textsearchlabel="Seach for Boom Type:" isvaluerequired="false">
<values>
<value prompt="Select boom type" usesubtype="true">TYPE = [value]</value>
</values>
</expressions>
<graphicalsearchlabel>Use one of the graphical search tools to select Boom</graphicalsearchlabel>
<spatialsearchlayer>true</spatialsearchlayer>
<titlefield>TYPE</titlefield>
<fields all="true"/>
<links/>
<zoomscale usegeometry="true" zoompercent="2"/>
<autoopendatagrid>false</autoopendatagrid>
<queryattachments>false</queryattachments>
<relates/>
<symbology>
<simplefillsymbol color="0x0000ff" alpha="0.5">
<outline color="0x00ffff" alpha="0.8" width="2"/>
</simplefillsymbol>
</symbology>
</layer>
    </layers>
    <tables>
        This section is ONLY for tables (i.e. data that has no geometry)!
        <table>
            <definitionexpression/>
            <enableexport>true</enableexport>
            <name>Sub Type</name>
            <url>http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/WaterTemplate/WaterDistributionAdministrativeReport/MapServer/6</url>
            <expressions>
                <expression alias="Replacement Score Greater Than" textsearchlabel="Search Replacement Score Greater Than:">
                    <values>
                        <value prompt="Example: 100" userlist="60,70,80,90,100">REPLSCORE &gt; [value]</value>
                    </values>
                </expression>
            </expressions>
            <titlefield>FACILITYID</titlefield>
            <fields all="false">
                <field name="FACILITYID"/>
                <field name="FCLASS" alias="Feature Class" gridfield="true"/>
                <field name="ASSETCOND" alias="Asset Condition" gridfield="true"/>
                <field name="CONDDATE" alias="Condition Date" dateformat="MM/DD/YYYY" useutc="true" gridfield="true"/>
                <field name="REPLSCORE" alias="Replacement Score" gridfield="true"/>
            </fields>
            <links>
                <link alias="View Traffic Photo" diablelinksifnull="true">
                    <![CDATA[{agree_with_incident}]]>
                    <icon><![CDATA[assets/images/i_camera.png]]></icon>
                </link>
            </links>
            <relates/>
            <queryattachments>false</queryattachments>
        </table>
        <table>
            <definitionexpression/>
            <enableexport>true</enableexport>
            <name>SF Incidents</name>
            <url>http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/MapServer/1</url>
            <expressions>
                <expression alias="Agree with incident 1" textsearchlabel="Search Incidents that are agreed to:">
                    <values>
                        <value prompt="Example: True" field="agree_with_incident" usedomain="true">agree_with_incident = [value]</value>
                    </values>
                </expression>
                <expression alias="Incident date" textsearchlabel="Search Incidents on or after date:">
                    <values>
                        <value prompt="Example: 2012/04/16">datetime &gt;= '[value] 00:00:00'</value>
                    </values>
                </expression>
            </expressions>
            <titlefield>sf_311_serviceoid</titlefield>
            <fields all="false">
                <field name="sf_311_serviceoid" alias="Incident OID"/>
                <field name="agree_with_incident" alias="Website Link" hyperlinkgridfield="true" hyperlinkaliastext="Go to Website" linkprefix="http://someWebSite/aspx/web/details.aspx?p_entity=" linksuffix=".aspx"/>
                <field name="cient_ip" alias="Client IP" gridfield="true"/>
                <field name="datetime" alias="Date" dateformat="MM/DD/YYYY" useutc="true" gridfield="true"/>
                <field name="notes" alias="Notes" gridfield="true"/>
            </fields>
            <links>
                <link alias="View Traffic Photo" diablelinksifnull="true">
                    <![CDATA[{agree_with_incident}]]>
                    <icon><![CDATA[assets/images/i_camera.png]]></icon>
                </link>
            </links>
            <relates>
                <relate id="1" label="Incident Priority Service Request" enableexport="true" icon="widgets/eSearch/assets/images/i_relate.png">
                    <fields all="true"/>
                </relate>
            </relates>
            <queryattachments>false</queryattachments>
        </table>
    </tables>
    <spatialrelationships>
        <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>
    <keepgraphicalsearchenabled>true</keepgraphicalsearchenabled>
    <autozoomtoresults>true</autozoomtoresults>
    <enabledatagridinteractionwithwidget>true</enabledatagridinteractionwithwidget>
    <toleranceforpointgraphicalselection>6</toleranceforpointgraphicalselection>
    <tolerancebydefault>false</tolerancebydefault>
    <spatialreference>102003</spatialreference>
    <zoomscale>2400</zoomscale>
    <geometryservice>http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer</geometryservice>
    <csvseparator>,</csvseparator>
    <disablebuttons/>
    <defaultselectionoption>textInput</defaultselectionoption>
    <enabledrawgraphicbutton>true</enabledrawgraphicbutton>
    <enablebuffergraphicbutton>true</enablebuffergraphicbutton>
    <selectedgraphicaltool/>
    <multipartgraphicsearch>true</multipartgraphicsearch>
    <floatorfixed>fixed</floatorfixed>
    <relatetooltip>Show Relates</relatetooltip>
    <relateicon>widgets/eSearch/assets/images/i_relate.png</relateicon>
    <labels>
        <includetextquery>include text query in selection criteria</includetextquery>
        <includetextquerywarn>Must be the same search layer in both
Enter a value to enable search button</requiredtooltip>
    </labels>
    <symbols>
        <simplefillsymbol color="0xff0000" alpha="0.5">
            <outline color="0xff0000" alpha="0.8" width="2"/>
        </simplefillsymbol>
        <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
David,

   Must have something to do with the secured service then. I do not develop my widgets to be compatible with secured services. Other have help by providing the necessary code changes for this widget to work with proxy services but token based no garuentee.  As I mentioned I have tested with a non-secure map service that uses subtypes and there is no issue.
0 Kudos
DavidAlford1
Occasional Contributor
Would it be possible to post a sample code of what that subtype syntax should look like? Maybe after reviewing your code that works, I can figure out what I am doing wrong.

Thanks for your help...
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
David,

   There is a sample of it in the eSearchWidget.xml, but here it is changed a little to use all fields like you are doing (this change has been tested as well):

        <layer>
            <definitionexpression></definitionexpression>
            <enableexport>true</enableexport>
            <name>Sub Types</name>
            <url>http://gislap183/webgis/rest/services/SubTypes/MapServer/0</url>
            <expressions>
                <expression alias="Fitting Type" textsearchlabel="Search Type:" isvaluerequired="false">
                    <values>
                        <value prompt="Example: TEE" usesubtype="true" isvaluerequired="false">TYPECODE = [value]</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Zoning</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>FACILITY_I</titlefield>
            <fields all="true" />
            <links/>
            <zoomscale usegeometry="true" zoompercent="2"></zoomscale>
            <autoopendatagrid>false</autoopendatagrid>
            <queryattachments>false</queryattachments>
            <relates/>
        </layer>
0 Kudos
DavidAlford1
Occasional Contributor
Could you contact me @ dalford@es2-inc.com? I have a few questions and don't want to continue to go through the forums.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
David,

   I do not communicate outside the forums as this would allow people to contact me directly and has the tendency to be abused and people to expect me to be their personal programmer.
0 Kudos
DavidAlford1
Occasional Contributor
Actually, we were looking to pay someone to develop or to modify your widgets to suit our maps. We are not programmers and we are spending too much time trying to figure out how to modify the code. It would benefit us more to pay someone instead of spending so much time and still be back at square one.
0 Kudos