Select to view content in your preferred language

Enhanced Search Widget URL Search Configuration

5216
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
Jim,

   Did you miss the "Changes to the WidgetManager.mxml" on the bottom of page 2?
0 Kudos
JamesFaron
Frequent Contributor
Robert,

No I didn't miss that. Inserted it on line 467, after the 'setAutoXY() function.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
James,

   And your problems window in Flash Builder does not report any error?
0 Kudos
JamesFaron
Frequent Contributor
Robert,

I did miss an additional error (for some reason flashbuilder repeats the same error, same line for over 10 times): in the WidgetManager, I get error 1120:Access of undefined property Widget in this code:
Widget.setState(WidgetStates.WIDGET_OPENED);


I changed the W in widget to lower case 'widget.setState', and that fixed it, but then got the error 1120:Access of undefined property BaseWidget in this code towards the end of your insert:
widget.setState(BaseWidget.WIDGET_OPENED);
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
James,

  Just change that line to :
widget.setState(WidgetStates.WIDGET_OPENED);

And you will be good to go.

I will get my errors fixed in the documentation. 😮
0 Kudos
JamesFaron
Frequent Contributor
Robert,

I saw that toward the beginning of that insert you instruct the following:
widget = widgetTable.find(id) as IBaseWidget;
     //add back the container if exists
     //if using FlexViewer 2.1 than this line needs to be
     //widget.setState(BaseWidget.WIDGET_OPENED);
     widget.setState(WidgetStates.WIDGET_OPENED);
     wgtContainer.focusWidget(id);


So I changed the line in the else statement (where I was getting the error):
else
       widget.setState(WidgetStates.WIDGET_OPENED);
      widgetTable.add(id, widget);


The error is gone!

Thanks again for your help,

Jim Faron
0 Kudos
JayGeisen
Regular Contributor
Robert,

How might one modify the code to allow different searches other than the first one in the config file?  My current site (1.x) allows this, using code supplied by you (naturally).  I actually tried modifying the 1.x code myself to do this in version 2.2, but then I happened across this thread and went with this.  If you are taking requests, this would be high on my list.  In fact, I'm not even sure I am too excited about moving my public site to 2.2 until I can get this worked out, since we now rely on the ability to link to various features through the URL search.  Anyway, just thought I'd throw that out there.  Thanks again for everything you do for the community. 

Cheers,
Jay
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jay,

   What did a couple of your 1.x urls look like? Please be sure to post more than one and preferably searching different layers.
0 Kudos
JayGeisen
Regular Contributor
0 Kudos