Select to view content in your preferred language

Enhanced Search Widget - Domains

3044
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
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   I am not sure where the extra name in this line came from:

<value prompt="Select boom type" usedomain="true" field name="TYPE">TYPE = '[value]'</value>
but it should be:

<value prompt="Select boom type" usedomain="true" field="TYPE">TYPE = '[value]'</value>
as shown in the documentation.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:

0 Kudos
AndrewMilanes
Frequent Contributor
I've tried with or without "name"

I get TypeError 1085
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   Is your domain for the field TYPE listed in your REST Service Directory for that layer?
0 Kudos
AndrewMilanes
Frequent Contributor
ArcGIS REST Services Directory  Logged in user : xxxxxxx | Logout | Get Token
Home > services > dfm_fs > Group_Response_Assets (FeatureServer) > Boom Help | API Reference
JSON
Layer: Boom (ID: 5)

View In:   ArcGIS.com Map

Name: Boom

Display Field: CREATE_NAME

Type: Feature Layer

Geometry Type: esriGeometryPolyline

Description:

Definition Expression: N/A

Copyright Text:

Default Visibility: true

MaxRecordCount: 1000

Supported Query Formats: JSON, AMF

Min Scale: 144449

Max Scale: 0

Supports Advanced Queries: true

Supports Statistics: true

Extent:
XMin: -1.01409911345E7
YMin: 1226528.0568000004
XMax: -8321822.6392
YMax: 3563877.202799998
Spatial Reference: 102100  (3857)


Drawing Info:
Renderer:
Unique Value Renderer:
Field 1: TYPE
Field 2: null
Field 3: null
Field Delimiter: ,
Default Symbol:
N/A
Default Label: null
UniqueValueInfos:
Value: 1
Label: containment
Description:
Symbol:
Style: esriSLSSolid
Color: [255, 170, 0, 255]
Width: 3
Value: 2
Label: sorbent
Description:
Symbol:
Style: esriSLSSolid
Color: [225, 225, 225, 255]
Width: 3
Transparency: 0
Labeling Info:

HasZ: false

HasM: false

Has Attachments: true

HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText

Type ID Field: TYPE

Fields:
OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID , editable: false , nullable: false )
TYPE ( type: esriFieldTypeInteger , alias: Boom Type , editable: true , nullable: true )
SIZE ( type: esriFieldTypeString , alias: Size , editable: true , nullable: true , length: 50 )
SECTION_LENGTH ( type: esriFieldTypeInteger , alias: Section Length , editable: true , nullable: true )
NUMBER_SECTIONS ( type: esriFieldTypeSmallInteger , alias: Number of Boom Sections , editable: true , nullable: true )
COMMENTS ( type: esriFieldTypeString , alias: Comments , editable: true , nullable: true , length: 254 )
CREATE_NAME ( type: esriFieldTypeString , alias: Added By , editable: false , nullable: true , length: 50 )
CREATE_DATE ( type: esriFieldTypeDate , alias: Date Added , editable: false , nullable: true , length: 36 )
EDIT_NAME ( type: esriFieldTypeString , alias: Edited By , editable: false , nullable: true , length: 50 )
EDIT_DATE ( type: esriFieldTypeDate , alias: Date Edited , editable: false , nullable: true , length: 36 )
GlobalID ( type: esriFieldTypeGlobalID , alias: GlobalID , editable: false , nullable: false , length: 38 )
Types:
ID: 1
Name: containment
Domains:
SIZE:
Coded Values: [10" 12" 12" 18" 18" 24" 24" 36" 36" 48" 48": 10"] , [12": 12"] , [18": 18"] , ...3 more...
SECTION_LENGTH:
Coded Values: [50: 50'] , [100: 100']
Templates:
Name: containment
Description:
Prototype:
TYPE: 1
SIZE: 18"
SECTION_LENGTH: 50
NUMBER_SECTIONS: 1
Drawing Tool: esriFeatureEditToolLine
ID: 2
Name: sorbent
Domains:
SIZE:
Coded Values: [5": 5"] , [8": 8"]
SECTION_LENGTH:
Coded Values: [10: 10']
Templates:
Name: sorbent
Description:
Prototype:
TYPE: 2
SIZE: 8"
SECTION_LENGTH: 10
NUMBER_SECTIONS: 4
Drawing Tool: esriFeatureEditToolLine

Capabilities: Query,Create,Update,Delete,Uploads,Editing

Sync Can Return Changes: true

Is Data Versioned: true

Supports Rollback On Failure: false

Edit Fields Info:
Creation Date Field: CREATE_DATE
Creator Field: CREATE_NAME
Edit Date Field: EDIT_DATE
Editor Field: EDIT_NAME

Supported Operations:   Query   Apply Edits   Add Features   Update Features   Delete Features   Generate Renderer   Return Updates
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrew,

  Hmm... I am missing where the TYPE field is associated with a particular domain in those sub types... What does your REST Directory look like for this layer using the Map Server instead of the Feature Server?
0 Kudos
AndrewMilanes
Frequent Contributor
ArcGIS REST Services Directory  Logged in user : xxxxx | Logout | Get Token
Home > services > dfm_fs > Group_Response_Assets (MapServer) > Boom Help | API Reference
JSON
Layer: Boom (ID: 5)

Name: Boom

Display Field: CREATE_NAME

Type: Feature Layer

Geometry Type: esriGeometryPolyline

Description:

Definition Expression:

Copyright Text:

Default Visibility: true

MaxRecordCount: 1000

Supported Query Formats: JSON, AMF

Min Scale: 144449

Max Scale: 0

Supports Advanced Queries: true

Supports Statistics: true

Has Labels: false

Can Modify Layer: false

Can Scale Symbols: false

Extent:
XMin: -1.01409911345E7
YMin: 1226528.0568000004
XMax: -8321822.6392
YMax: 3563877.202799998
Spatial Reference: 102100  (3857)


Drawing Info:
Renderer:
Unique Value Renderer:
Field 1: TYPE
Field 2: null
Field 3: null
Field Delimiter: ,
Default Symbol:
N/A
Default Label: null
UniqueValueInfos:
Value: 1
Label: containment
Description:
Symbol:
Style: esriSLSSolid
Color: [255, 170, 0, 255]
Width: 3
Value: 2
Label: sorbent
Description:
Symbol:
Style: esriSLSSolid
Color: [225, 225, 225, 255]
Width: 3
Transparency: 0
Labeling Info:

HasZ: false

HasM: false

Has Attachments: true

HTML Popup Type: esriServerHTMLPopupTypeAsHTMLText

Type ID Field: TYPE

Fields:
OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID )
TYPE ( type: esriFieldTypeInteger , alias: Boom Type )
SHAPE ( type: esriFieldTypeGeometry , alias: SHAPE )
SIZE ( type: esriFieldTypeString , alias: Size , length: 50 )
SECTION_LENGTH ( type: esriFieldTypeInteger , alias: Section Length )
NUMBER_SECTIONS ( type: esriFieldTypeSmallInteger , alias: Number of Boom Sections )
COMMENTS ( type: esriFieldTypeString , alias: Comments , length: 254 )
CREATE_NAME ( type: esriFieldTypeString , alias: Added By , length: 50 )
CREATE_DATE ( type: esriFieldTypeDate , alias: Date Added , length: 36 )
EDIT_NAME ( type: esriFieldTypeString , alias: Edited By , length: 50 )
EDIT_DATE ( type: esriFieldTypeDate , alias: Date Edited , length: 36 )
GlobalID ( type: esriFieldTypeGlobalID , alias: GlobalID , length: 38 )
SHAPE.len ( type: esriFieldTypeDouble , alias: SHAPE.len )
Types:
ID: 1
Name: containment
Domains:
SIZE:
Coded Values: [10" 12" 12" 18" 18" 24" 24" 36" 36" 48" 48": 10"] , [12": 12"] , [18": 18"] , ...3 more...
SECTION_LENGTH:
Coded Values: [50: 50'] , [100: 100']
ID: 2
Name: sorbent
Domains:
SIZE:
Coded Values: [5": 5"] , [8": 8"]
SECTION_LENGTH:
Coded Values: [10: 10']

Supported Operations:   Query   Generate Renderer   Return Updates
0 Kudos
AndrewMilanes
Frequent Contributor
Actually, now that I'm looking at it.  TYPE has sub-types, not a domain.  How would I use that?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   Subtypes will be supported as the source for the eSearch drop down in the next version 3.0.10 due out this week.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   Version 3.0.10 now available

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:

0 Kudos