Select to view content in your preferred language

eSearch on XYevent return only 1 result.

3311
8
Jump to solution
03-21-2013 10:17 AM
AlexandreLavoie
Occasional Contributor
Hi
Probably another small thing to resolve, but I can't figure out what's the problem...

I have a XY Event layer base on a SQL Server 2008 R2 table. Connection made by OLE DB.

The geometry of that layer is based on two fields (WebMercatorX , WebMercatorY)

Of course, there's no OBJECTID for that Layer.

With the "out-of-the-box" search widget, i get multiple results. ("Graphical Search" or "Text Search")

But with the Enhanced Search widget 3.1.12 (compile version), I only get 1 result every time. (I think the first row in the table)
"Graphical Search" or the "Text Search"
uniquevalsfromfield doesn't work. The dropdownlist isn't filling up

Is the Enhanced Search Widget design to deal with XY Event layer?


I'm using FlexViewer 3.1 with Enhanced search widget 3.1.12, ArcGIS server 10.0


Alex Lavoie
Quebec city

<layer>      <token/>             <definitionexpression/>             <enableexport>true</enableexport>             <name>BDMT</name>             <url> xxx /rest/services/WMAS/BDMT3WMAS/MapServer/0</url>             <expressions>                 <expression alias="dossier number" textsearchlabel="Search by # dossier" >                     <values>                         <value prompt="Exemple: 3366114 or 3366" isvaluerequired="true">#Dossier LIKE '%[value]%'</value>                     </values>                 </expression>                 <expression alias="MRC" textsearchlabel="Search by MRC:" isvaluerequired="true">                     <values>                         <value prompt="Exemple: " isvaluerequired="true" uniquevalsfromfield="MRC" autosubmit="true">MRC = '[value]'</value>                     </values>                 </expression>                     <expression alias="Municipalite" textsearchlabel="Recherche par Municipalite:" isvaluerequired="true">                     <values>                         <value prompt="Exemple: Nicolet" isvaluerequired="true" uniquevalsfromfield="Municipalite" autosubmit="true">Municipalite = '[value]'</value>                     </values>                 </expression>             </expressions>             <graphicalsearchlabel>Use one of the graphical search tools to select Zoning</graphicalsearchlabel>             <spatialsearchlayer>true</spatialsearchlayer>             <titlefield>#Dossier</titlefield>             <fields all="false">    <field name="#Dossier"/>           <field name="dossier_id" alias="ID Dossier" visible="true" gridfield="true"/>           <field name="Municipalite" alias="Municipalité" visible="true" gridfield="true"/>           <field name="MRC" alias="MRC" visible="true" gridfield="true"/>             </fields>             <links/>             <zoomscale usegeometry="true" zoompercent="2"></zoomscale>             <autoopendatagrid>true</autoopendatagrid>             <queryattachments>false</queryattachments>           </layer>
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RhettZufelt
MVP Notable Contributor
Not sure about the field names, but for me, I could never get the full functionality out of an event theme until I had the properties in ArcMap show that it has an OID field:
[ATTACH=CONFIG]22863[/ATTACH]

To do this, my DBA had to do some mojo on the table similar to this link:  http://support.esri.com/en/knowledgebase/techarticles/detail/27424

We actually went the primary key route, and had to make it a NUMBER(9,0) (not sure why NUMBER(9) didn't, maybe versions or Oracle or something) for it to work.

Basically, it needs a "unique" "not null" (which fits definition of primary key) "numeric (9)" field that it can use as the OID field for it to work correctly. (we made ours required and autopopulated so that someone can't add data without populating the field, which would break the service (only needs one NULL in there for it to not recognize it as OID)

A good test is to add the table as an event theme in ArcMap, look at the properties and make sure it says OID yes, then grab the select tool and try to select some data, if you can't select it, then it will not work properly as a service and something isn't right.  Also, unless you unchecked the warn me box, it will warn you when you add the event theme that you won't be able to select, query, or edit the features if it isn't right.


R_

View solution in original post

0 Kudos
8 Replies
RhettZufelt
MVP Notable Contributor
Alex,

I'm using the same version flexviewer and eSearch widget and have no problem getting the results as well as the uniquvalues list to populate.

My event theme is loaded from an Oracle table, but just through an odc connection.

I do have an autogenerated number (unique values, required=true) field on my table, this way, Arc will use that in leiu of an OID field.  Otherwise, event themes are pretty limiting.

R_
0 Kudos
AlexandreLavoie
Occasional Contributor

I do have an autogenerated number (unique values, required=true) field on my table, this way, Arc will use that in leiu of an OID field.
R_


Hi Rhett,

I have a unique value field (#Dossier). Here's there a xml tag for that?
Alex

My field's name are not standard.. ( with the #) but i got the same result when I copy my data in a Access Database with standard field name
0 Kudos
RhettZufelt
MVP Notable Contributor
Not sure about the field names, but for me, I could never get the full functionality out of an event theme until I had the properties in ArcMap show that it has an OID field:
[ATTACH=CONFIG]22863[/ATTACH]

To do this, my DBA had to do some mojo on the table similar to this link:  http://support.esri.com/en/knowledgebase/techarticles/detail/27424

We actually went the primary key route, and had to make it a NUMBER(9,0) (not sure why NUMBER(9) didn't, maybe versions or Oracle or something) for it to work.

Basically, it needs a "unique" "not null" (which fits definition of primary key) "numeric (9)" field that it can use as the OID field for it to work correctly. (we made ours required and autopopulated so that someone can't add data without populating the field, which would break the service (only needs one NULL in there for it to not recognize it as OID)

A good test is to add the table as an event theme in ArcMap, look at the properties and make sure it says OID yes, then grab the select tool and try to select some data, if you can't select it, then it will not work properly as a service and something isn't right.  Also, unless you unchecked the warn me box, it will warn you when you add the event theme that you won't be able to select, query, or edit the features if it isn't right.


R_
0 Kudos
AlexandreLavoie
Occasional Contributor
Thank you Rhett for your help

I will try with my DBA to add a OID field in MS SQL server.

I thought it will be possible to use eSearch without this OID manipulation because  "basic search widget" is able to perform the query on my XY Event with no OID's

Your related Technical Articles is for ArcGIS under 10.0. Is it still up to date?

Thank you so much for your time.

Alex
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Alex,

   The eSearch widget has dependencies on an OID field. You can not really compare something that is working in the OTB Search widget with the eSearch as the eSearch is much more complex and feature rich. I don't work with event tables so I am definitely deferring to Rhett here are he has experience using them in the eSearch.
0 Kudos
AlexandreLavoie
Occasional Contributor
Ok

I understand that your eSearch is more complex (and I appreciate!!) than the OTB Search.

XY Event are useful for me to keep a dynamic link to the data.

I will use the advice from Rhett.

Thanks for your enhanced widgets and your commitment to the Flex Viewer development

Alex
0 Kudos
RhettZufelt
MVP Notable Contributor
Thank you Rhett for your help

Your related Technical Articles is for ArcGIS under 10.0. Is it still up to date?

Thank you so much for your time.

Alex


Alex, I could not get it to work until I could select them in ArcMap with select tool (which meant they had to have an OID field).  Have the same issue with both versions, and the "fix" I used for version 10 seems to work in 10.1 (see below).

In version 10, you can't use the publish as service toolbar (as msd) for this data type, you must right-click on ArcMap document with catalog and publish as mxd)

I have moved it over to 10.1.  In order for it to work here, not only did I need the OID field, but I had to go into Server Manager, Site, Data Store, Register Database, and register the database the xy event theme table is coming from.  Then I was able to "Share as service" from ArcMap and is working as expected (or as hoped ).  Even the uniquevaluesfromfield populates with the list.

R_
0 Kudos
AlexandreLavoie
Occasional Contributor
Hi Rhett,

I finally found the solution!

You helped me with this:
I could never get the full functionality out of an event theme until I had the properties in ArcMap show that it has an OID field


My table connection was made by a simple "Add Data"... (or drag 'n drop). This was the problem.

Instead, I used the "Add Query Layer..." function in Arcmap

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/What_is_a_query_layer/00s50000000n0000...

This way, I got the "Has Object-ID" to YES!!! in my layer Properties.

I already had a Numeric (10), not null field. (so i didn't need your technical article)

Thank your for your help!

Alex
0 Kudos