Enhanced-Search-Widget-for-FlexViewer Part III

116305
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
Stew,

   This should do:

        <layer>
            <token/>
            <definitionexpression/>
            <enableexport>true</enableexport>
            <enableprintgrid title="Selected Troop Command(s)">true</enableprintgrid>
            <name>NYARNG UNITS</name>
            <url>http://ngnya0-gis-02:6080/arcgis/rest/services/UNITS/Units_Map2/MapServer/0</url>
            <expressions>
                <expression alias="Troop Command" textsearchlabel="Search Troop Command:" isvaluerequired="true">
                    <values>
                        <value prompt="Example: 153TC4" isvaluerequired="false" uniquevalsfromfield="TroopCommand" autosubmit="false">TroopCommand = '[value]'</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Troop Command</graphicalsearchlabel>
            <spatialsearchlayer>false</spatialsearchlayer>
            <titlefield>TroopCommand</titlefield>
            <fields all="false">
              <field name="UIC" gridfield="true"/>
              <field name="UNIT_NAME" gridfield="true"/>
              <field name="SITE_NAME" gridfield="true"/>
              <field name="SITE_CODE" gridfield="true"/>
              <field name="SiteNumber" gridfield="true"/>
              <field name="INSTNAME" gridfield="true"/>
              <field name="TroopCommand" gridfield="true"/>
            </fields>
            <links/>
            <zoomscale usegeometry="true" zoompercent="2"/>
            <autoopendatagrid>false</autoopendatagrid>
            <queryattachments>false</queryattachments>
            <relates/>
            <symbology>
                <picturemarkersymbol url="assets/images/i_camera.png" height="30" width="30" xoffset="0" yoffset="0" />
            </symbology>
        </layer>
0 Kudos
JoshWhite
Regular Contributor III
I'm putting this widget through its paces on this one.  I have a feature that I would like to view attachments, which works fine and also open a link in a related table.  The link is to a video file that I didn't want to have attached to the database because it will make the geodatabase too large.  If I can't get this to work, I may just include the links in the main file, but the relate would be better for me.

UPDATE:  I actually go this to work, it is a bit clunky because of the way I set it up but I was wondering if there was a good way to change the location.  As it is now the link is just the file name so the widget was looking for it in the same directory as itself.  I fixed that for now by putting it in the same location as the config file.  I also tried to add a folder name to the hyperlink in my feature class and that also worked.  I'm just wondering if there is a tag that I can use to tell the widget to look in a different location.  On another note, if decide not to use the relate is it possible to have multiple hyperlink fields?  In other words, link to more than one place.  I would just add a field to my feature class with the new file name.
Josh White, AICP
Principal Planner

City of Arkansas City
0 Kudos
StewartGalloway
New Contributor III
Hi Robert,
Can you help with these issues?  The esearch widget is working but:

1) the widget displays an error msg for the initial search (see attached).

2) I'd like to display a different symbol per result, depending on the value searched on.  (You helped me change the default picturemarkersymbol).

3) I get too many results to page through (see attached).

Thanks very much.
Stew
ArcGIS Viewer for Flex. Application builder version 3.3
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Stew,

   I am not real sure on what the issue for number one is... Your XML looks fine. Can you attach your main config.xml for me to look at?

As far as number 2 having a different symbol per result based on the search criteria. There is nothing setup in this widget to allow for a unique value renderer per layer. You could setup a layer for each of the different symbols you want.

Your third question is likely that you have a popup assigned to the layer you are searching on and that is interfering with the search results popup. I will be able to see if this is the case when I see your main config.xml
0 Kudos
StewartGalloway
New Contributor III
Robert,
Please see attached for the main config file.
I will try to set up a different layer for each symbol.
Thank you very much.
Stew
0 Kudos
StewartGalloway
New Contributor III
Robert,
I see a PopUp_2.xml and I see it referenced in the config.xml but nothing is checked within the App Builder \ Configure Layer or the Sub_layer.  Remove the reference in the config.xml?
Thanks.
Stew
0 Kudos
JulieWilliams1
New Contributor
Hi Robert!

We have been successfully using your 3.5 version of the eSearch tool in many of our maps and we love it!  We have run into a little problem with related features in a search and being able to actually zoom to each related features when they are pulled up in the grid.  We have a polygon feature for our isolation areas and each polygon has many related valve point features.  The eSearch tool will pull up all of the related valve features into the results grid when we do a search on an isolation area polygon, but we were hoping to be able to zoom to each valve feature from the grid.  We currently get an error box that pops up saying "Invalid or Missing Perameters" with an "ok" box at the bottom.  Here is the code for this search in the config. file:

<layer>
            <token></token>
            <definitionexpression></definitionexpression>
            <enableexport>true</enableexport>
            <enableprintgrid>true</enableprintgrid>
            <name>ISO Boundry</name>
            <url>http://vmgismap/arcgis/rest/services/EmergencyMap_IsolationFeatures/MapServer/9</url>
            <expressions>
                <expression alias="ISO Boundry" textsearchlabel="Search ISO Boundry">
                    <values>
                        <value prompt="Example: SLC 37" field="BNDID">UPPER(BNDID) LIKE UPPER('%[value]%')</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select ISO Boundry</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>BOUNDARY ID</titlefield>
            <fields all="false">
                <field name="BNDID"alias="ID"gridfield="true"/>
                <field name="BNDYDESC"alias="Description"gridfield="true"/>
                <field name="CUSTOMERCOUNT"alias="Customer Count"gridfield="true"/>
            </fields>
                <links>
                </links>
            <zoomscale usegeometry="true"></zoomscale>
            <autoopendatagrid>false</autoopendatagrid>
            <queryattachments>false</queryattachments>
            <relates>
                <relate id="1"label="Isolation Valves"enableexport="true"enableprintgrid="true"printtitle="Isolation Boundary Valves">
                    <fields all="false">
                        <field name="GDC.V_GDC_VALVES.ITEM_DESCRIPTION"alias="Valve Number"gridfield="true"/>
                        <field name="GDC.V_GDC_VALVES.HOUSING"alias="Housing"gridfield="true"/>
                        <field name="GDC.V_GDC_VALVES.VSIZE"alias="Size"gridfield="true"/>
                        <field name="GDC.V_GDC_VALVES.MAKE"alias="Make"gridfield="true"/>
                        <field name="GDC.V_GDC_VALVES.ADDRESS_TEXT"alias="Valve Address"gridfield="true"/>
                    </fields>
                </relate>
            </relates>
            <symbology>
                <simplefillsymbol color="0xff0000" alpha="0.5">
                    <outline color="0xff0000" alpha="0.8" width="2" />
                </simplefillsymbol>
            </symbology>
        </layer>

Just wondering if you can see anything we are missing or have in there that is not correct and that could be causing the problem? I was able to get this to work on another one of our features where we just have a one to one relate - our service line feature and a service valve that it is related to.  I was able to click on the valve in the results grid and it would zoom to it on the map.  It's this other one to many relate that is causing us problems.  As always, thanks for your help and thanks for this wonderful tool!

Julie Williams
Questar Corp
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Stew,

   Yes you should change the operational layers section to this:

        <operationallayers>
            <layer type="dynamic" label="DMNA Site" imageformat="png8" url="http://NGNYA0-GIS-02:6080/arcgis/rest/services/RealProperty/DMNA_Site/MapServer" visible="true"/>
            <layer type="dynamic" label="Units Map2" imageformat="png8" url="http://ngnya0-gis-02:6080/arcgis/rest/services/UNITS/Units_Map2/MapServer" visible="true"/>
        </operationallayers>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Julie,

So errors I see in your XML is that tag attributes have to be seperated by a space. Also the relate fields do not need the gridfield attribute as there is no other way to dispaly relates but in the datagrid.

<relates>
  <relate id="1"label="Isolation Valves"enableexport="true"enableprintgrid="true"printtitle="Isolation Boundary Valves">
    <fields all="false">
      <field name="GDC.V_GDC_VALVES.ITEM_DESCRIPTION" alias="Valve Number"/>
      <field name="GDC.V_GDC_VALVES.HOUSING" alias="Housing"/>
      <field name="GDC.V_GDC_VALVES.VSIZE" alias="Size"/>
      <field name="GDC.V_GDC_VALVES.MAKE" alias="Make"/>
      <field name="GDC.V_GDC_VALVES.ADDRESS_TEXT" alias="Valve Address"/>
    </fields>
  </relate>
</relates>
0 Kudos
JulieWilliams1
New Contributor
Hi Robert!
Sorry it took so long for me to respond.  I ended up making the changes that you suggested, but I was still getting the same error.  So, I have just been messing around with other changes to see if anything would make it work.  We had a join to a table on the feature that the relate is on and I wondered if that could cause problems because it seems like joins have caused problems for us in the past.  So, I ended up removing the join and it now works!  So, that join was the root of the problem, after all.  Don't know if you have any experience with others having trouble with joins, but I figure this may help someone else.  We will just have to see what is more important to our user - seeing more data or being able to zoom to the valve feature....thanks, again, for all of your help!!

Julie Williams
0 Kudos