http://forums.esri.com/Thread.asp?c=158&f=2421&t=295623#953276
I have the same problem...execSearch()..in MiniSearch widget.
If I add a search term and press Return nothing happens. I also added a button to the widget with the "execSearch()" statement and nothing happens with this either.
Thx
Naty
Natasha,
Did you follow these directions?
1. Add MiniSearch.mxml & MiniSearch.xml to the src/com/esri/solutions/flexviewer/widgets folder
2. Add xmlns:widgets ="com.esri.solutions.flexviewer.widgets.*" to the application tag in the index.mxml.
3. Add <widgets:MiniSearch x="20" y="420" /> to the index.mxml just above the </mx:Application> and below the </SiteContainer> so the last three lines of the index.mxml would look like this
</SiteContainer>
<widgets:MiniSearch x="20" y="420" />
</mx:Application>
Naty,
The minisearch was only designed to zoom you to a location quickly. if you want the info popup then you should use the full search widget or you would have to extend the code to add the info popup.
Many thanks Robert I will try to do it ..
Naty
private function execSearch1():void
{
try
{
var id:Number = SiteContainer.getInstance().getWidgetId("Search");
var bWidget:IBaseWidget = SiteContainer.getInstance().widgetManager.getWidget(id) as IBaseWidget;
if (bWidget){
var bWidg:BaseWidget = bWidget.getInstance();
var vSW:SearchWidget = bWidg as SearchWidget;
vSW.querybmpid(ti.text);
} else {
//execSearch();
var bWidget2:IBaseWidget;
bWidget2 = SiteContainer.getInstance().widgetManager.getWidget(id) as IBaseWidget;
var vSW2:SearchWidget = bWidget2 as SearchWidget;
vSW2.querybmpid(ti.text);
}
}
catch (error:Error)
{
//execSearch();
ti.text = error.message;
}
} Robert, mini search works perfectly, after this I tried to use the search widget function that I got from timerComplete of MapManager.mxml so I created a new function in MiniSearch.mxmlprivate function execSearch1():void { try { var id:Number = SiteContainer.getInstance().getWidgetId("Search"); var bWidget:IBaseWidget = SiteContainer.getInstance().widgetManager.getWidget(id) as IBaseWidget; if (bWidget){ var bWidg:BaseWidget = bWidget.getInstance(); var vSW:SearchWidget = bWidg as SearchWidget; vSW.querybmpid(ti.text); } else { //execSearch(); var bWidget2:IBaseWidget; bWidget2 = SiteContainer.getInstance().widgetManager.getWidget(id) as IBaseWidget; var vSW2:SearchWidget = bWidget2 as SearchWidget; vSW2.querybmpid(ti.text); } } catch (error:Error) { //execSearch(); ti.text = error.message; } }
It perfectly works tooo....but after I Load another widget(for example: LiveMapsWidget.swf) it stops to work and I get Error #1010...how is it possible?...
Naty
Naty,
Can you explain in more detail what you are attempting to do?