Select to view content in your preferred language

Enhanced-Search-Widget-for-FlexViewer Part III

180997
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
MicahVan_Maanen
Emerging Contributor
OK, thanks for checking it out.  I'll do some more testing.
0 Kudos
SertaçTAKIL
Deactivated User
Hi,

I have both new versions of FlexViewer 3.3 and the eSearch.
My problem is: If I make a text search to a field that has text properties in a polygon feature layer that's in a file geodatabase
as "edirne" I get no results but when I search like "Edirne" I get results. What might be the problem?
Is there a setting for case sensitivity?

Thank you,
Sertaç
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sertaç,

   Your problem is your SQL expression you are using. Use something like this (important part is the upper keyword to eliminate the case sensitivity from your query):

upper(ZONING_NAME) LIKE upper('%[value]%')
0 Kudos
KeisukeNozaki
Frequent Contributor
I really like this widget but have one question.
When searching polygon layer, results are selected in red.
However, when searching point layer, results are not selected in red (callout box shows up instead).
Am I missing something or is this a known issue?
Thank you.

[ATTACH=CONFIG]25628[/ATTACH][ATTACH=CONFIG]25628[/ATTACH]
[ATTACH=CONFIG]25629[/ATTACH]
0 Kudos
RhettZufelt
MVP Notable Contributor
This is set with the <symbols> tag at the bottom of the config file and can be set individually for lines, points, and polygons (fill and outline).



 <symbols>
  <simplefillsymbol color="0xff0000" alpha="0.0">
   <outline color="0x00FFFF" 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="20" width="20" xoffset="1" yoffset="1" />
  <simplelinesymbol color="0x00FFFF" alpha="0.8" width="2" />
 </symbols>



Also, if you are running version at least 3.0.8 or newer, the symbology can be set differently for each layer searched using the <symbology> tag.


               <symbology>
                   <simplefillsymbol color="0x00FFFF" alpha="0">
                       <outline color="0x00FFFF" alpha="1.0" width="2" />
                   </simplefillsymbol>
               </symbology>



For points, you can select a standard marker (red square, diamond, triangle, etc), or a picture marker symbol.
Furthur information on these settings is in the XML configuration.pdf file included with the eSearch download.

R_
0 Kudos
SpencerV
Deactivated User
Hi,

I have been working with Flex Viewer and the eSearch Widget for a few months now. Everything has been going great but I have stumbled upon an issue. Currently, I am setting up the widget search for some new services that I have set up on my 10.1 server. I have set up the graphical, text, and spatial methods and they all work no problem for some layers but for other layers in the same service I get the error of:

[RPC Fault faultString="Invalid or missing input parameters." faultcode="400" faultDetail=""]


In a few instances the two data layers that I am setting up, in the same service, have almost identical fields such as NAME, ADDRESS, and CITY but it the widget only works with one and not the other. Even when I have copy and pasted exact segments from one to the other. Below I have added the xml of two layers. One works while the other does not. As you can see, the fields I am using are similar. Any help would be greatly appreciate!

Edit: Forgot to mention, I am running the 3.0 viewer with the corresponding widget.

Thanks,
Spencer

Works:
<layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>New Jersey Correctional Institutions</name>
   <url>http://XX.XXX.XX.XX:8080/arcgis/rest/services/NewJerseyLayersService/MapServer/2</url>
   <expressions>
    <expression alias="Name" textsearchlabel="Search Institution Name">
     <values>
      <value prompt="Example: Island Heights Police Department">upper(NAME) LIKE upper('%[value]%')</value>
     </values>
    </expression>
    <expression alias="Address" textsearchlabel="Search Institution Address">
     <values>
      <value prompt="Example: 380 Hillsdale Avenue">upper(ADDRESS) LIKE upper('%[value]%')</value>
     </values>
    </expression>
    <expression alias="City" textsearchlabel="Search Institution City">
     <values>
      <value prompt="Example: Chatham">upper(CITY) LIKE upper('%[value]%')</value>
     </values>
    </expression>
    <expression alias="County" textsearchlabel="Search Institution County">
     <values>
      <value prompt="Example: Morris">upper(COUNTY) LIKE upper('%[value]%')</value>
     </values>
    </expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select a Correctional Institution</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>Name</titlefield>
   <fields all="false">
    <field name="OBJECTID" alias="ID" gridfield="true"/>
    <field name="NAME" alias ="Name" gridfield="true"/>
    <field name="ADDRESS" alias="Address" gridfield="true"/>
    <field name="CITY" alias="City" gridfield="true"/>
    <field name="COUNTY" alias="County" gridfield="true"/>
    <field name="TELEPHONE" alias="Phone Number" gridfield="true"/>
   </fields>
   <links />
   <zoomscale usegeometry="true" zoompercent="1.6" />
   <autoopendatagrid>false</autoopendatagrid>
   <relates />
   <queryattachments>false</queryattachments>
  </layer>



Does NOT work:
<layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>New Jersey Hospitals</name>
   <url>http://XX.XXX.XX.XX:8080/arcgis/rest/services/NewJerseyLayersService/MapServer/7</url>
   <expressions>
    <expression alias="Name" textsearchlabel="Search Hospital Name">
     <values>
      <value prompt="Example: Virtuawest Jersey Hospital">upper(NAME) LIKE upper('%[value]%')</value>
     </values>
    </expression>
    <expression alias="Address" textsearchlabel="Search Hospital Address">
     <values>
      <value prompt="Example: 380 Hillsdale Avenue">upper(ADDRESS) LIKE upper('%[value]%')</value>
     </values>
    </expression>
    <expression alias="City" textsearchlabel="Search Hospital City">
     <values>
      <value prompt="Example: Chatham">upper(CITY) LIKE upper('%[value]%')</value>
     </values>
    </expression>
    <expression alias="County" textsearchlabel="Search Hospital County">
     <values>
      <value prompt="Example: Morris">upper(COUNTY) LIKE upper('%[value]%')</value>
     </values>
    </expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select a Hospital</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>Name</titlefield>
   <fields all="false">
    <field name="OBJECTID" alias="ID" gridfield="true"/>
    <field name="NAME" alias ="Name" gridfield="true"/>
    <field name="ADDRESS" alias="Address" gridfield="true"/>
    <field name="CITY" alias="City" gridfield="true"/>
    <field name="COUNTY" alias="County" gridfield="true"/>
    <field name="TELEPHONE" alias="Phone Number" gridfield="true"/>
    <field name="NAICDESCR" alias="Type" gridfield="true"/>
   </fields>
   <links />
   <zoomscale usegeometry="true" zoompercent="1.6" />
   <autoopendatagrid>false</autoopendatagrid>
   <relates />
   <queryattachments>false</queryattachments>
  </layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Spencer,

   Have you double checked that the Field names for the layer that does not work are correct (Flex Is a CaSe sensitive language) and if you try to specify a field that does not exist in that layer you will get an error.
0 Kudos
SpencerV
Deactivated User
Hi Robert,

I have checked the fields to make sure they were case appropriate. Everything seems to check out.

Thanks,
Spencer
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Spencer,

   Can you take a screenshot of the rest service directory page for the hospitals layer so I can review it?
0 Kudos
SpencerV
Deactivated User
Robert,

Attached are the screen caps for the Hospital layer in my service directory. I tried to include as much as I could from the directory.

Thanks,
Spencer
0 Kudos