Relates in Search Widget

3985
29
08-03-2012 06:36 AM
PatriciaMoehring
Frequent Contributor
Hi Robert:  Thanks in advance for your help!  Just so you know, Ken Carrier helped me get things started and now I'm trying to take over (that's a scary thought).  So, we have most of the eSearchWidget searches working.  The ones we seem to have the most problem with are those with relationship classes set up.  I've looked through the pdf instructions and some things I'm sure will become more clear as I continue to work through all of my issues!:)  The particular problem I am having is with the Sign Post feature and having the related Sign table information show up in the table.  On various attempts, I've had the table show up with field names but no Sign data.  However, after the search is complete I would get a message about not having the datagrid setup.

In the config.xml, I added the SearchWidgetFixedDG under the UI elements but I don't have a SearchWidgetFixedDG.xml as the config statement says I should; not really sure how I get that (like I said I'm new to this):

<!-- UI elements -->
    <widget left="10"  top="50"    config="widgets/Navigation/NavigationWidget.xml"             url="widgets/Navigation/NavigationWidget.swf"/>
    <widget right="0" left="0" bottom="0" config="widgets/eSearch/SearchWidgetFixedDG.xml"  url="widgets/eSearch/SearchWidgetFixedDG.swf"/>
    <widget right="-2" bottom="-2" config="widgets/OverviewMap/OverviewMapWidget.xml"           url="widgets/OverviewMap/OverviewMapWidget.swf"/>
    <widget right="20" top="55"    config="widgets/MapSwitcher/MapSwitcherWidget.xml"           url="widgets/MapSwitcher/MapSwitcherWidget.swf"/> 
<widget left="0"   top="0"     config="widgets/FeatureTooltip/FeatureTooltipWidget.xml"     url="widgets/FeatureTooltip/FeatureTooltipWidget.swf"/>
<widget left="0"   top="0"     config="widgets/HeaderController/HeaderControllerWidget.xml" url="widgets/HeaderController/HeaderControllerWidget.swf"/>

and under the widgetcontainer here is the Search widget info:

<widget label="Search" left="60" top="400" preload="open"
                icon="assets/images/i_search.png"
                config="widgets/eSearch/SearchWidget.xml"
                url="widgets/eSearch/SearchWidget.swf"/>

In the SearchWidget.xml:

<layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>Sign Post</name>
   <url>http://192.168.100.102/ArcGIS/rest/services/Signs/MapServer/0</url>
   <expressions>
    <expression alias="Sign Post" textsearchlabel="Search by Street Name: [ Example: ROSEMARIE or Rosemarie or rosemarie]">
     <values>
      <value>upper(OnStreetName) like upper('%[value]%')</value>
     </values>
    </expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select sign posts</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>OnStreetName</titlefield>
   <fields all="false">
    <field name="OnStreetName" alias="Street Name" />
    <field name="Subtype" alias="Post Type" />
    <field name="FACILITYID" alias="Post ID" />
    <field name="PCond" alias="Post Condition" />
    <field name="SonPost" alias="Signs on Post" />
   </fields>
   <relates>
    <relate id="0" label="Related Sign Information" enableexport="true" icon="widgets/eSearch/assets/images/i_relate.png">
     <fields all="true" />
    </relate>
   </relates>
   <zoomscale usegeometry="true" zoompercent="1.2"></zoomscale>
   <autoopendatagrid>true</autoopendatagrid>
  </layer>

I did change:
<floatorfixed disablerelatestabinfixed="false">fixed</floatorfixed><!-- possible values are fixed and float -->

If you need any other information please let me know and thanks again!  Patricia
Tags (2)
0 Kudos
29 Replies
RobertScheitlin__GISP
MVP Emeritus
Patricia,

   OK, based on what you provided in your SearcWidget.xml you are still missing my instructions. You need to add the gridfield attribute to the fields of the Sign Post layer NOT the relate. I does not matter a bit if you have the gridfield attribute in the relates field element because those are always going to appear in a datagrid.
0 Kudos
PatriciaMoehring
Frequent Contributor
Robert:  Ok, so now I'm getting sign post information in the search portion of the table but still nothing in the relate.  See attached.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Patricia,

   Great so now all you need to do is click the relate button in the widget results or in the datagrid then.
0 Kudos
PatriciaMoehring
Frequent Contributor
And the relate table comes up empty!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Patricia,

   So it does not display a popup message that say no relates forund, but it does flip to an empty relates datagrid tab? Try changing your RELATE fields back to this:

<fields all="true" />
0 Kudos
PatriciaMoehring
Frequent Contributor
ok, so now here's the message.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Patricia,

   OK, one more time send me you SearchWidget.xml so I can see how you applied the change. Can you do and actual copy and paste instead of a screen grab?
0 Kudos
PatriciaMoehring
Frequent Contributor
Ok, here you go!

<layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>Sign Post</name>
   <url>http://192.168.100.102/ArcGIS/rest/services/Signs/MapServer/0</url>
   <expressions>
    <expression alias="Sign Post" textsearchlabel="Search by Street Name: [ Example: ROSEMARIE or Rosemarie or rosemarie]">
     <values>
      <value>upper(OnStreetName) like upper('%[value]%')</value>
     </values>
    </expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select sign posts</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>OnStreetName</titlefield>
    <fields all="false">
     <field name="OnStreetName" alias="Street Name" gridfield="true" />
     <field name="Subtype" alias="Post Type" gridfield="true" />
     <field name="FACILITYID" alias="Post ID" gridfield="true" />
     <field name="PCond" alias="Post Condition" gridfield="true" />
     <field name="SonPost" alias="Signs on Post" gridfield="true" />
    </fields>
   <relates>
    <relate id="0" label="Related Sign Information" enableexport="true" icon="widgets/eSearch/assets/images/i_relate.png">
     <fields all="True"/>
    </relate>
   </relates>
   <zoomscale usegeometry="true" zoompercent="1.2"></zoomscale>
   <autoopendatagrid>true</autoopendatagrid>
  </layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Patricia,

   Flex is a case sensitive language, so:
<fields all="True"/>
is not correct it needs to be:
<fields all="true"/>
0 Kudos
PatriciaMoehring
Frequent Contributor
No, I'm still not getting the related data?  Any other ideas?
0 Kudos