Select to view content in your preferred language

Enhanced Search Widget URL Search Configuration

5232
42
04-19-2011 09:34 AM
JamesFaron
Frequent Contributor
Robert,

I am getting an error in the MapManager after inputting the code changes that are specified in the Enhanced Search Widget URL Search Configuration pdf. The error is to the line of code as follows from private function mapLoadComplete function utimerComplete:
ViewerContainer.getInstance().widgetManager.getWidget(id);

The error is 1061: Call to a possibly undefined method getWidget through a reference with static type com.esri.viewer.managers:WidgetManager

Thanks,
Jim Faron
Tags (2)
0 Kudos
42 Replies
RobertScheitlin__GISP
MVP Emeritus
Nate,

   Hmm... If Owner is an attribute of the CULPR field than shouldn't the exprnum be 0? Because expression 2 is tied to the classcode field.

?search=Owner&slayer=0&exprnum=0&showdatagrid=true
0 Kudos
NateRose
Deactivated User
I thought from reading your pdf that the exprnum is the number or layer's you have setup for searching.

I tested the parameters that you posted after clearing my browser cache and still nothing.  The search for "Owner" works fine in the Search Widget itself also.  That's what's odd.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nate,

   Now you have me confused...

Each layer can have multiple expressions defined for it so exprnum=2 would mean the 3rd expression for the particular layer you are specifying in the slayer.

So this code means:

?search=Owner&slayer=0&exprnum=0&showdatagrid=true


In layman's speak means:
Search the first layer defined in the SearchWidget.xml using the first expression defined for that layer, using a search value of "Owner"

Does that help?
0 Kudos
NateRose
Deactivated User
Robert,

Sorry for the confusion.  I meant the number of expressions when I referred to the layers.  I only have one layer setup and three search expressions.

I attached my SearchWidget.xml, maybe this will help. 

If I have it set to slayer=0 and exprnum=0 as you mention it should work.  Still no search on page load.  I'm gonna try another layer and/or expression just to see if there is an issue with that. 

Thanks for your time with this.

Nate
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nate,

   Do you not have a crossdomain.xml on your server? I would gladly test this for you but I can not as long as you don't have a crossdomain.xml at http://maps.co.stearns.mn.us/crossdomain.xml
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nate,

Do you have the eSearch widget preloded as instructed in the pdf?

i.e.
<widget label="Enhanced Search" preload="open"
             icon="assets/images/i_search.png"
             config="widgets/eSearch/SearchWidget.xml"
             url="widgets/eSearch/SearchWidget.swf"/>
0 Kudos
NateRose
Deactivated User
Robert,

I do have the Search window set to preload.

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


I didn't have a crossdomain.xml file setup but I looked it up quick and built one at "C:\inetpub\wwwroot" so hopefully it works based on the esri documentation.  It's accessible from the path http://maps.co.stearns.mn.us/crossdomain.xml

Here is the app path:
http://maps.co.stearns.mn.us/TaxForfeit/bin-debug/index.html
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nate,

   You have missed some portion of the instructions some where because I can add your layer to my eSearch Widget and now that you have a crossdomain.xml in place this url:

http://gislap134/FlexViewer2.3/index.html?search=Owner&slayer=0&exprnum=0&showdatagrid=true&debug=tr...

Executes the search for me.
0 Kudos
NateRose
Deactivated User
Robert,

Thanks for testing it.  I double checked the code vs the instructions and everything looks good so I'm going to start with fresh 2.3.1 viewer and update the code in that.  I'm thinking maybe everything didn't get updated properly during the upgrade from 2.2 to 2.3.  I'll let you know what I find.

Thanks again,

Nate
0 Kudos
NateRose
Deactivated User
Robert,

I'm running into the same problem with the new project as before.  I started with a original copy of the 2.3.1 version of the viewer and updated the necessary code listed in the URL Search Configuration documentation but it still won't bring up any search results on page load. 

Would you be willing to take a look at the code to see what might be going wrong?  I've checked it over and over, but must be missing something since you tested the layer out in your copy.

Thanks,

Nate
0 Kudos