Relates in Search Widget

3961
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 so let me get a few quick questions answered from you then.

  1. Do you see the fixed datagrid in your app?

  2. When you go to http://192.168.100.102/ArcGIS/rest/services/Signs/MapServer/0 in your web browser do you see Relationships list almost completely at the bottom of the page and do you see the query related records link?

  3. Are you saying that the SearchWidgetFixedDG.xml was not in your download?...

0 Kudos
PatriciaMoehring
Frequent Contributor
Patricia,

   OK so let me get a few quick questions answered from you then.

  1. Do you see the fixed datagrid in your app?

  2. When you go to http://192.168.100.102/ArcGIS/rest/services/Signs/MapServer/0 in your web browser do you see Relationships list almost completely at the bottom of the page and do you see the query related records link?

  3. Are you saying that the SearchWidgetFixedDG.xml was not in your download?...



1. I really hate to sound like a newbie (which I really am) but I'm not sure I know what you mean when you ask if I see the fixed datagrid in my app? 
2. I did do a query and yes I get the related tables here.[ATTACH=CONFIG]16634[/ATTACH]
3. Ken told me how to get the xml over which I've done.

But now I'm getting WidgetError #2035
0 Kudos
PatriciaMoehring
Frequent Contributor
Robert:  I think I may have just done a no no.  So, the file that was downloaded for eSearch 2.5 did not have the SearcjWidgetFixedDG.xml.  I downloaded the eSearch 3.0 and dragged the xml over to my projects.

Did I do good?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Patricia,

   Hmm, that explains why you did not have the file in your download. So if you are using Flex Viewer 2.5 than you do not need the SearchWidgetFixedDG.xml as it is just for Version 3.0.x.

So remove the config part from this line:

<widget right="0" left="0" bottom="0"  config="widgets/eSearch/SearchWidgetFixedDG.xml"   url="widgets/eSearch/SearchWidgetFixedDG.swf"/>


Or just comment it the whole line and use the floating datagrid instead. By changing this line back:

<floatorfixed  disablerelatestabinfixed="false">float</floatorfixed><!--  possible values are fixed and float -->
0 Kudos
PatriciaMoehring
Frequent Contributor
Robert:  Ok, I didn't have the swf file either.  So, some things are working and I didn't do anything else except add the swf in project properties/modules for the SearchWidgetFixedDG. 

Attached is the result after running.[ATTACH=CONFIG]16636[/ATTACH]

So, now what do you think?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Patricia,

   It took me a while to see what your configuration issue was... You are using the fixed datagrid and you are not specifying any gridfields.

<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>
0 Kudos
PatriciaMoehring
Frequent Contributor
Robert:  I tried that on data from the Sign table.  Tried variations but nothing seems to work.  What about that URL in the Enhanced Search Widget URL Search Configuration.pdf; where does the URL go.  It seems like I'm missing something.  I can get everything to work except for the related data to populate.

I'm still getting the message in the Search window that there is no datagrid configured for this layer.

So, I really don't know what to do now!  Help, I'm stuck and the more I wiggle the deeper it gets!:)  Let me know if you think of anything else or need anything from me.  I'm going to try and squeeze some info out of Ken to see if he has any ideas on this but I think we are both kind of baffled -- him more than me; I'm just lost!

Thanks, Patricia
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Patricia,

   Lets work on one thing at a time.

If you add the attribute gridfield to the fields on your sign post layer then that will get rid of the "no datagrid configured for this layer" message.

            <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>

Once you make these changes then you need to be sure your browser is picking up this new xml file by clearing your browsers cache.
0 Kudos
PatriciaMoehring
Frequent Contributor
Robert:  Thank you for your patience!  Ok, the error message is gone.  But I'm still not getting data in the table.  Attached is snapshots of what I currently have in config.xml, searchwidget.xml and what I'm getting.
0 Kudos