Select to view content in your preferred language

Error #1009: Cannot access a property or method of a null object reference

2433
2
Jump to solution
06-28-2012 03:28 AM
ShaningYu
Honored Contributor
I loaded a component to export map to PDF (async one) from http://www.arcgis.com/home/item.html...f697d9965f1dd7. However, I got a runtime error: TypeError: Error #1009: Cannot access a property or method of a null object reference at WidgetManager.mxml's Line 403,
    var widget:IBaseWidget;
    widget = modInfo.factory.create() as IBaseWidget;
    widget.widgetId = widgetId;   // Line 403
when I clicked the tool's icon to open the widget.
Through tracing, I found that widget is null.
I believe that the modInfo.factory.create() failed.  How can this problem be solved?  I will appreciate if someone can hint me how to debug this problem. Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Shaning,

   From the looks of the error you are attempting to use the compiled swf and David compiled this using a different version of the flex API than you are currently using. You will have to recompile this widget your self so that you can get the API versions matching with your app.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Shaning,

   From the looks of the error you are attempting to use the compiled swf and David compiled this using a different version of the flex API than you are currently using. You will have to recompile this widget your self so that you can get the API versions matching with your app.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:

0 Kudos
ShaningYu
Honored Contributor
Great!  Exactly as you pointed out.  Thanks so much!!!
0 Kudos