Relates in Search Widget

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

   But the error window went away right? Do you have any other relates you could test on? I am running out of ideas here.
0 Kudos
PatriciaMoehring
Frequent Contributor
Yes, but that's a whole other can of worms!  However, the relate is working just can't open the images using the hyperlinkgridfield, think it has something to do with the ip address we are using and the whole virtual world?  Have to wait till the it guy comes in tomorrow.

I know the relate is working since I can get it to work through the query and in ArcMap; just don't know why it's not working here.  Could I use link or some other method.

I'm throwing this out there because I think it might be an issue -- I noticed in the Query related records the relate seemed to be based on Object ID.  My relate is based on rSignPost Facility ID and rSign Post ID (1:M).  So, when I did the query the post object id did find 3 matching records in the rSign table with the post id.  But I did not use Object ID in the relationship class since they have a tendency to change when records get deleted.

I don't know, I'm just talking out loud!  Aren't you glad you can't hear me!:)
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Patricia,

   You can't base very much on the fact that it works in ArcMap as that is SOAP based and does not involve ArcGIS Server which is REST based. The fact that you use something other than objectid field is actually best practice and exactly how every GIS person should do it.

However, the relate is working just can't open the images using the hyperlinkgridfield
are you talking about in ArcMap or in Flex?
0 Kudos
PatriciaMoehring
Frequent Contributor
Robert:  Are you sure you want to open that can of worms?  I've attached the document that shows -- search for parks -- get the relationship window -- shows related park attachments -- click on hyperlink field -- get error message.  The IT guy and Ken are going to look at it in the am.  Unless, of course, you've seen this before and know exactly what the problem is!:)

The Sign Post to Sign is still an issue but like I said, if I perform a query from the REST Services, it works.  See attachment.  If you think of anything else that I may be missing, please let me know and I'll try to find it!

Thanks again for all your patience!
0 Kudos
PatriciaMoehring
Frequent Contributor
Robert:  This is really weird.  I set the signs aside and started working on some other searches.  I'm just sending this because this search is working and I don't really know why it should be working when the sign relate isn't?  Anyway, I have a General Zoning Table that is related to the Zoning Parcels feature with a 1:M relationship and ZONE_ is in both tables and that is what the relate is built on.  I've attached some pics of the REST for you to see.  I thought this might spur some thought into why I still can't see the related signs.  Pay particular attention to the url end number.  So, here is what it looks like in Flex:

<layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>Zoning</name>
   <url>http://192.168.100.102/ArcGIS/rest/services/Zoning/MapServer/1</url>
   <expressions>
    <expression alias="Zoning Code" textsearchlabel="Search by Zoning Code: [ Example: CBD, GC, I-1, I-2, I-E, I-P, NC, NSC, PO, R-1A, R-1B, R-1C, R-1CC, R-1D, R-1U, R-2, R-3, R-R, RESORT, SC, PUD, RCD, MHP, GW]">
     <values>
      <value>upper(ZONE_) like upper('%[value]%')</value>
     </values>
    </expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select parcels</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>ZONE_</titlefield>
   <fields all="false">
    <field name="MACCT" alias="Parcel ID" gridfield="true"/>
    <field name="ZONE_" alias="Zoning Code" gridfield="true"/>
    <field name="ADD_Z" alias="Additional Zoning" gridfield="true"/>
   </fields>
   <relates>
    <relate id="1" label="Related Zoning Information" enableexport="true" icon="widgets/eSearch/assets/images/i_relate.png">
     <fields all="false">
      <field name="ZONE_" alias="Zoning Code"/>
      <field name="ZONE_DESC" alias="Zoning Description"/>
      <field name="GEN_ZONE" alias="General Zoning Code"/>
      <field name="GEN_DESC" alias="General Zoning Description"/>
     </fields>
    </relate>
   </relates>
   <zoomscale usegeometry="true" zoompercent="1.2"></zoomscale>
  </layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Patricia,

   That does not help bring anything to mind. I am glad that you did get a relate working though.
0 Kudos
PatriciaMoehring
Frequent Contributor
Robert:  Thanks, I did actually get 2 relates working.  But on the one I had for parks relating to an attachment table I had to add a hyperlink field and populate it with the hyperlink address.  I could not get the hyperlinkprefix to work.

Even though the Zoning works, does the url look strange to you.  I would have thought the number after MapServer should have been 2 or 3 but not 1.

Anyway, if you think of anything please let me know.  I'm stumped!  And if anyone else out there has any ideas please share!

BTW, do you have a really cool widget for printing at 2.5?

Thanks, Patricia
0 Kudos
PatriciaMoehring
Frequent Contributor
Robert:  I just thought I would let you know that the sign relate is now working.  Don't ask me, I have no idea why!  I was showing someone how to use the search queries and just tried the sign search anyway and it worked.

I could have just visited the twilight zone, I'm not sure!  Since I've been working on the webmap I feel like I'm always in the twilight zone!

Just thought I would let you know!:)
0 Kudos
PaulLang
Deactivated User
Below is working with multiple relates, relates are one too many.
eSearch works...

<layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>Relate Search</name>
   <url>http://gcgis/ArcGIS/rest/services/MyRelate/MapServer/0</url>
   <expressions>
    <expression alias="Parcel Number" textsearchlabel="">
     <values>
       <value prompt="Parcel Number Example: 150758">AKPAR = '[value]'</value>
     </values>
    </expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select Roads</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>AKPAR</titlefield>
   <fields all="false">
    <field name="AKPAR" alias="PID #"  gridfield="true"/>
    <field name="PIN" alias="PIN #"  gridfield="true"/>
    <field name="CALCAC" alias="Calculated Acres" gridfield="true"/>
   </fields>
   <links>
    <link>
    </link>
   </links>
   <zoomscale usegeometry="true" zoompercent="1.6" />
   <autoopendatagrid>false</autoopendatagrid>
   <relates>
   
    <relate id="0" label="Building Summary" enableexport="true" icon="assets/images/i_hydro.png">
     <fields all="true" />
    </relate>
   
    <relate id="1" label="Sale Summary" enableexport="true" icon="assets/images/i_hydro.png">
     <fields all="true" />
    </relate>

    <relate id="2" label="Tax Work" enableexport="true" icon="assets/images/i_hydro.png">
     <fields all="true" />
    </relate>
   
    <relate id="3" label="AS400 Out" enableexport="true" icon="assets/images/i_hydro.png">
     <fields all="true" />
    </relate>
   
    <relate id="4" label="Mobile Video Images" enableexport="true" icon="assets/images/i_hydro.png">
     <fields all="false">
     <field name="Parcel" alias="Parcel" />
      <field name="ImagePath" alias="House Picture" hyperlinkgridfield="true"/>
     </fields>
    </relate>
   
   </relates>
   <queryattachments>false</queryattachments>
  </layer>
0 Kudos
PatriciaMoehring
Frequent Contributor
Don't know if this would be a new thread but you know what happens when you give a mouse a cookie . . .

I currently have an eSearch set up for Parcels -- can be searched by address, parcelid, or ownername.  Within the search popup is also a link to the County auditor's website with more information about the parcel (since I'm with a municipality).  Then I have a Zoning feature, which consists of all the parcel shapes, the parcelid, zoning code, and additional zoning code info.  A separate feature was necessary since one parcel can have more than one types of zoning.  I do not have a relate set up but I suppose I could Parcel to Zoning -- 1:M -- based on ParcelID.  And if everyone remembers I have a relate to a zoning table that gives the full description of the code and also a PopUp for zoning parcels set up.


Then he wants a glass of milk!

Economic Development really likes the ability to search parcels but once the search is complete, the parcel is selected, and the search popup appears; which means I cannot get the zoning popup to appear.  So, is there a way to include the zoning code in the parcel search popup without creating the relationship class or do you think that is the only way to go?

I'm open to suggestions; I like banging my head against the wall!:) 

Let me know if you think this should be a separate thread and I'll start one.

Thanks, Patricia
0 Kudos