Select to view content in your preferred language

Enhanced Search Widget URL Search Configuration

4726
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
NateRose
Deactivated User
Robert,

I noticed you added an option for the data grid to show up after a search is performed in the March update. BTW I really like the data grid results format.  Is there an option for the data grid to show up on page load using the URL Search Configuration?

For example, returning all records of a layer and having them displayed in the data grid on page load?

Thanks,

Nate
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jay and Nate,

   Your enhancement requests made it into the v2.3 release of the Enhanced Search Widget. Only thing is that the new version is ONLY for Flex Viewer 2.3. Time to upgrade.
0 Kudos
JayGeisen
Regular Contributor
Thanks Again, Robert!
0 Kudos
NateRose
Deactivated User
Robert,

Thanks for the update.  I added the code from the URL Search Config, initially I got an error while building the project in FB4 with duplicate functions in MapManager.mxml.  I looked through the code again and found this additional maploadcomplete function so I commented this out so there was only one reference. 

            private function mapLoadComplete(event:MapEvent):void
            {
                // ViewerContainer.dispatchEvent(new AppEvent(AppEvent.LAYER_LOADED));
            }

After I did that I'm getting an error saying this:

Encountered errors or warnings while building project LayerListWidget.mxml.
    MapManager.mxml: Access of possibly undefined property urlConfigParams through a reference  
       with static type Class.
    MapManager.mxml: Attempted access of inaccessible method getWidgetId through a reference
       with static type com.esri.viewer:ViewerContainer.

My Enhanced Search widget is labeled "Search" so I changed the .getWidgetId("Enhanced Search"); to .getWidgetId("Search");  I thought this might have helped but I'm still getting the same error and it lists it through each widget in the error dialog.

Nate
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nate,

   Did you notice my comment that the new version is only for FlexViewer 2.3?
0 Kudos
NateRose
Deactivated User
Robert,

Yes, I first copied over the files to upgrade to 2.3 and then made the code changes.  Does it look like an issue with the upgrade to 2.3?

Nate
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nate,

   Yep you must have an issue with your copy, there would not have been a mapLoadComplete function in the 2.3 version of the MapManager.mxml
0 Kudos
NateRose
Deactivated User
Robert,

I no longer had the 2.3 files so I downloaded the 2.3.1 flexviewer and it worked fine with no errors.  When I put the "?search=Owner&slayer=0&exprnum=3&showdatagrid=true" parameters in the it loads the page as usual but runs no search.

If that is a compatibility issue with 2.3.1, is there a way to get 2.3 un-compiled?  I don't see it on the download page for previous versions.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nate,

   I don't think that the search=Owner is correct.

search=x x is suppose to be the actual value that is searched for.
&exprnum=3 so this means you have 4 expressions defined in your xml file then right? Expressions numbers start at 0 as most all enumerations do.
0 Kudos
NateRose
Deactivated User
You are right on the "exprnum=3", should be 2 since I have 3 layers.  As for the search=Owner, its an attribute in the CULPR field.  Maybe this will help you see what I got going on.  Still nothing when I change it to "exprnum=2" though.

<expressions>
             <expression alias="Status" textsearchlabel="Search Status (Owner/Renter) [ Example: Owner ]:">upper(CULPR) = upper('[value]')</expression>
            
<expression alias="Improvements" textsearchlabel="Search by Improvements [ Example: Y or N ]:">upper(Improvement) = upper('[value]')</expression>
            
<expression alias="Price" textsearchlabel="Search Price Range By Code [ Example: A($0-10,000), B($10,000-20,000), C($20,000-50,000), or D($50,000+)]:">upper(classcode) = upper('[value]')</expression>
            </expressions>
0 Kudos