Select to view content in your preferred language

MiniSearch widget doesnt work execSearch()

4310
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
RobertScheitlin__GISP
MVP Emeritus
Naty,

   So if I understand correctly then you are calling execSearch1 from the minisearch and it works fine (meaning it brings up the full searchwidget if it is not open already and executes the search) and when you open any other widget and add some new text to the minisearch and click enter it doesn't work. Does it give you any error?
0 Kudos
NatashaManzuiga
Regular Contributor
Naty,

   So if I understand correctly then you are calling execSearch1 from the minisearch and it works fine (meaning it brings up the full searchwidget if it is not open already and executes the search) and when you open any other widget and add some new text to the minisearch and click enter it doesn't work. Does it give you any error?


u perfectly understood!
Yes Robert, this is the error: Error #1009.

Naty
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Naty,

   Error 1009 is such a generic error it just means that a variable is null. The best thing for you to do now is download the Flash Player debugger version form Adobe so that you can add a break point in and see where the error is actually occurring. Google "Flash Player Debugger" and down load the appropriate version IE or netscape compatible version once you install that then you can click the little green bug in Flex or Flash builder instead of the run button.
0 Kudos
NatashaManzuiga
Regular Contributor
Naty,

   Error 1009 is such a generic error it just means that a variable is null. The best thing for you to do now is download the Flash Player debugger version form Adobe so that you can add a break point in and see where the error is actually occurring. Google "Flash Player Debugger" and down load the appropriate version IE or netscape compatible version once you install that then you can click the little green bug in Flex or Flash builder instead of the run button.



Robert, I'm trying to find the error, I saw that I get the widget and the problem is in queryBuilding...I dont know how it can be....cause I pass correct value...
it seems like some variables stop working when I lunch another widget ....
😞
Naty
0 Kudos
NatashaManzuiga
Regular Contributor
Robert, I'm trying to find the error, I saw that I get the widget and the problem is in queryBuilding...I dont know how it can be....cause I pass correct value...
it seems like some variables stop working when I lunch another widget ....
😞
Naty


Robert I downloaded the debugger and I m running it
but it stops here:
[SWF] /Buildings/com/esri/solutions/flexviewer/assets/flash/red_glow.swf - 1,082 bytes after decompression
[SWF] /Buildings/com/esri/solutions/flexviewer/assets/flash/loader.swf - 941 bytes after decompression
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Function/com.esri.solutions.flexviewer:MapManager/refreshLayer/com.esri.solutions.flexviewer:timerHandler()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
0 Kudos
NatashaManzuiga
Regular Contributor
Robert I downloaded the debugger and I m running it
but it stops here:
[SWF] /Buildings/com/esri/solutions/flexviewer/assets/flash/red_glow.swf - 1,082 bytes after decompression
[SWF] /Buildings/com/esri/solutions/flexviewer/assets/flash/loader.swf - 941 bytes after decompression
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Function/com.esri.solutions.flexviewer:MapManager/refreshLayer/com.esri.solutions.flexviewer:timerHandler()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()


Robert, I fixed it...I set the breakpoint on the function queryBuilding and after I loaded livewidget ,I see the problem:
var id:Number = SiteContainer.getInstance().getWidgetId("Search");
    var bWidget:IBaseWidget = SiteContainer.getInstance().widgetManager.getWidget(id) as IBaseWidget;
    var aaa:String;
    aaa=ti.text;
     if (bWidget){
      var bWidg:BaseWidget = bWidget.getInstance();
      var vSW:SearchWidget = bWidg as SearchWidget;
      vSW.queryBuilding(aaa);

id:found =3
bWidget:found= SearchWidget (@6a2cae1)
aaa:found="5"
var bWidg:BaseWidget = bWidget.getInstance();//(bWidget.getInstance()SearchWidget (@6a2cae1)
bWidg:found = LiveMapsWidget (@71b0ae1):@ so bWidget.getInstance() get the instance of LiveMapsWidget!!
HOW IS IT POSSIBLE? :S
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Naty,

   I have seen this before and the fix is simple.

//Just comment out this line or delete it.
var bWidg:BaseWidget = bWidget.getInstance();
// and change this line
var vSW:SearchWidget = bWidg as SearchWidget;
 to 
var vSW:SearchWidget = bWidget as SearchWidget;
0 Kudos
NatashaManzuiga
Regular Contributor
Naty,

   I have seen this before and the fix is simple.

//Just comment out this line or delete it.
var bWidg:BaseWidget = bWidget.getInstance();
// and change this line
var vSW:SearchWidget = bWidg as SearchWidget;
 to 
var vSW:SearchWidget = bWidget as SearchWidget;


Wowwwwww
Thank u so much Robert!!!

Naty
0 Kudos
AlexJones
Emerging Contributor
Naty,

Do you have a complete mini search as you are using it? I would like to see what you have done and maybe implement some of it on my site. It sounds like you have it set up to handle a broad amount of data. Please let me know.

Thanks,

Alex
0 Kudos
NatashaManzuiga
Regular Contributor
Naty,

Do you have a complete mini search as you are using it? I would like to see what you have done and maybe implement some of it on my site. It sounds like you have it set up to handle a broad amount of data. Please let me know.

Thanks,

Alex


As soon as possible I will send u 😉

Naty
0 Kudos