Select to view content in your preferred language

Enhanced Search Widget URL Search Configuration

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

   You missed this line in the MapManager.mxml instructions.

Update this function:
protected override function partAdded(partName:String, instance:Object):void
{
super.partAdded(partName, instance);
if (instance == map)
{
var cssStyleDeclaration:CSSStyleDeclaration =
styleManager.getStyleDeclaration("com.esri.ags.components.supportClasses.InfoWindow")
cssStyleDeclaration.setStyle("backgroundColor", getStyle('contentBackgroundColor'));
styleManager.setStyleDeclaration("com.esri.ags.components.supportClasses.InfoWindow",
cssStyleDeclaration, true);
//My Add
map.addEventListener(MapEvent.LOAD, mapLoadComplete);
//End My Add
}
}
0 Kudos
NateRose
Deactivated User
Robert,

I added that piece of code into the MapManager.mxml, exported a release build, and it still won't run the search.  That code was in my original app, must have just missed it. 

Did everything else check out in the code I posted?  I did notice that my SearchWidget.swf isn't compiling like the other widgets, is that a problem?

Nate
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nate,

   That is a Big problem. Can you check the problems window in Flash Builder and see what is listed there for errors (don't worry about warnings).
0 Kudos
NateRose
Deactivated User
Robert,

I haven't seen anything listed in the Problems tab.  I'm using Flash Builder 4 as of a few months ago.

The same is happening for the eDraw widget.  All of the other SWF files are compiling fine.  I'll look around and see what I can find why they wouldn't be generating without any visible errors.

Nate
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nate,

   OK if you don't have anything listed in the problems window that the only other thing I can think of is you did not add the SearchWidget.mxml to your projects modules list. Anytime you are adding a widget's source code to your project you have to add it to the modules list so that Flash Builder knows to compile a swf file for it.
0 Kudos
NateRose
Deactivated User
Robert,

That did the trick.  Thanks for your patience!!  It works great, just going to try move the grid results to the left side of the screen and clean up the data for quicker response.  Right now its about a 5 second delay.

Thanks,

Nate
0 Kudos
JayGeisen
Regular Contributor
Robert, I just got this installed and, once again, masterful work across the board!  The code, the configs, the documentation.....all fabulous.  A huge thanks from your friends at Johnson County, IA. This is easily worth 7 stars!
0 Kudos
NateRose
Deactivated User
Robert,

It's working really great, just a couple quick questions. Previously I changed the camera icon but now there is a blue circle that shows up on the search results.  Is this referenced somewhere besides the SearchWidget.xml? I haven't found anything yet to update this. 

Also I found the code that would set the Grid results to display left aligned.  I can adjust the width in the SearchWidgetFloatDG.mxml but don't see anything for the horizontal alignment.

Thanks,

Nate
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nate,

   Hmm... I am a little confused. The symbology or the results is STILL controlled by what you specify in the SearchWidget.xml. So if you changed it before to something different than you can do that same thing now. The data grid results are automatically left aligned so what are you saying or asking here:

Also I found the code that would set the Grid results to display left aligned. I can adjust the width in the SearchWidgetFloatDG.mxml but don't see anything for the horizontal alignment.
0 Kudos
NateRose
Deactivated User
Robert,

Here is a screenshot which should help. 

I meant to say I can update the width of the grid results in the SearchWidgetFloatDG.mxml but I can't left align the entire grid results window.  See how it defaults to the middle of the map.  I just wanted to shift it over to the left side.

For the search symbology, I changed the image from the binoculars to a transparent .png image and now it shows the blue circles on each result.  I updated the simplefillsymbol color below but to no avail.
<symbols>
     <simplefillsymbol color="0x000000" alpha="0.0">
      <outline color="0x000000" alpha="0.0" width="2"/>
     </simplefillsymbol>
     <!-- You can have one or the other, either simplemarkersymbol or picturemarkersymbol
          defined for your point results NOT BOTH. picturemarkersymbol will override simplemarkersymbol
          if you do not have it commented out. --> 
     <!--<simplemarkersymbol style="square" size="12" color="0xff0000" alpha="0.0" xoffset="0" yoffset="0" angle="0">
      <outline style="solid" color="0x000000" alpha="1" width="1"/>
     </simplemarkersymbol>-->
     <picturemarkersymbol url="assets/images/i_search2.png" height="30" width="30" xoffset="0" yoffset="0" />
  <simplelinesymbol color="0xff0000" alpha="0.8" width="2"/>
    </symbols>
0 Kudos