Select to view content in your preferred language

MiniSearch widget doesnt work execSearch()

4294
44
07-05-2010 05:40 AM
NatashaManzuiga
Regular Contributor
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
Tags (2)
0 Kudos
44 Replies
NatashaManzuiga
Regular Contributor
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



This is the Error #1010 I got...in this part of the function execSearch():
catch (error:Error)
     {
      trace(error.message, false);
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
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>
0 Kudos
NatashaManzuiga
Regular Contributor
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>


Thanks Robert.
I had problem with query.outFields and now it works very well...could I show some info window with data, image and links after this MiniSearch...?
Naty
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
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.
0 Kudos
NatashaManzuiga
Regular Contributor
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
0 Kudos
NatashaManzuiga
Regular Contributor
Many thanks Robert I will try to do it ..

Naty


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.mxml
   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; 
     }  
   }

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
0 Kudos
NatashaManzuiga
Regular Contributor
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.mxml
   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; 
     }  
   }

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


Nobody Can Help me? 😞
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Naty,

   Can you explain in more detail what you are attempting to do?
0 Kudos
NatashaManzuiga
Regular Contributor
Naty,

   Can you explain in more detail what you are attempting to do?

If u see my code, I modified your code to use SearchWidget function...
it's very nice I can search things immediately with MiniSearch widget...
but after I load another widget it doesnt work anymore...it seems like it doesnt recognize the SearchWidget anymore SearchWidget or something changed with ID of the widgets...

Ohhhh u came back Robert ... I feel much better 😄

Naty
0 Kudos