error loading module using ModuleManager

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default error loading module using ModuleManager

    Hi all,

    I load a module using ModuleManager.getModule(modname) in a flex application.
    module is loaded successfully.

    and when i try to click the links in the module,it connects to HTTPService and
    gets the data successfully but before showing data i get the following error:
    #1009: Cannot access a property or method of a null object reference.

    i try to debug and i see this in debug mode

    TypeError: Error #1009: Cannot access a property or method of a null object
    reference.
    at mx.rpc::AbstractInvoker$cinit()
    at global$init()
    at global$init()
    at mitto.core::MittoBackendRequest()
    at mitto.core::MittoBackendRequest$/CreateBackendRequest()
    at component.MXML::ListUsersComponent/entitiesList()
    at UserModule/linkToListUsers()
    at UserModule/__listUsers_click()

    what is this at mx.rpc::AbstractInvoker$cinit()
    at global$init()
    at global$init() ??/

    when i click continue when the error pops up, i get back to the list with my
    data in datagrid.

    Any suggestion would be helpful.

    Thanks



    smscentral Guest

  2. Similar Questions and Discussions

    1. Problem Dynamically Loading a Module
      Hi all, I'm having some trouble with trying to dynamically load a module at runtime. The following example demonstrates the problem I'm...
    2. loading a module in parrentApplication from anothermodule
      Hi, I have the following parrent application: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"...
    3. Module loading order
      Hello, Description: package A; my $instance; sub new { my $class = shift; my %args = @_; return $instance if $instance;
    4. #24199 [Opn->Fbk]: problem with loading module in apache 2.0.46
      ID: 24199 Updated by: sniper@php.net Reported By: keeper at fly dot srk dot fer dot hr -Status: Open +Status: ...
    5. loading a module dependant on the OS
      I have a Perl script which runs under Windows and uses the module Win32::Process, I now have a need to run this on Linux. I can do produce two...
  3. #2

    Default Re: error loading module using ModuleManager

    can you show some working code that shows the problem?
    atta707 Guest

  4. #3

    Default Re: error loading module using ModuleManager

    thanks for ur time.

    i am loading the module using module manager

    public function loadModule(filePath:String):void {
    mittoAppInstance = MittoApp.getInstance();
    moduleInfo = ModuleManager.getModule(filePath);
    moduleInfo.addEventListener(ModuleEvent.READY, modReadyEventHandler);
    moduleInfo.addEventListener(ModuleEvent.PROGRESS,m odProgressEventHandler);
    moduleInfo.addEventListener(ModuleEvent.ERROR, modErrorEventHandler);
    moduleInfo.load();
    MittoApp.getInstance().progressbar.visible = true;
    }

    //get the instance of module , call method on that object, add it to the main
    application
    private function modReadyEventHandler(e:ModuleEvent):void {
    moduleInstance = this.getModuleInstance();
    this.addToApplication();
    }

    //get the instance of the module
    public function getModuleInstance():Object{
    return moduleInfo.factory.create() as Object;
    }

    //add module to mitto application
    public function addToApplication():void{
    mittoAppInstance.main.addChild(moduleInstance as DisplayObject);
    }


    and my module has some links
    <mx:ControlBar>
    <mx:LinkButton id="addUser" label="Add User"
    click="linkToAddUser();"/>
    <mx:LinkButton id="listUsers" label="List Users"
    click="linkToListUsers();"/>
    <mx:LinkButton id="editpermissions" label="Edit Permission"
    click="selectUser()"/>
    </mx:ControlBar>

    public function linkToListUsers():void{
    listUsersInstance = new ListUsersComponent()
    listUsersInstance.list_url="usermanagement";
    listUsersInstance.action="listusers";
    listUsersInstance.entitiesList();
    this.remove();
    usermain.addChild(listUsersInstance);
    }

    and as i click on list users..i get the exception 1009.

    Thanks



    <mx:Panel layout="horizontal" width="100%" height="100%" title="Welcome to
    Mitto!"
    horizontalAlign="center" paddingBottom="10" paddingLeft="10"
    paddingRight="10" paddingTop="10">

    <mx:VBox id="menu" width="10%" height="100%">
    <mx:LinkButton label="{uixml.Permission.Description}"
    click="loadModule()" />
    <mx:LinkButton label="Logout" click="logout()"/>
    <mx:TextArea id="log" width="250" height="300" y="600"/>
    </mx:VBox>

    smscentral Guest

  5. #4

    Default Re: error loading module using ModuleManager

    So far so good! The exception source is actually going beyond this code: in the MittoBackendRequest.CreateBackendRequest() method.

    have tried to debug this method?
    atta707 Guest

  6. #5

    Default Re: error loading module using ModuleManager

    hii

    The problem seems not with the module or modulemanager..sorry for that..
    but i have some renderers in mt listuserscomponents.

    checkbox header : on selecting will select all checkboxes in datagrid.
    this renderer seems to be causing that exception.I removed that renderer for a
    while and check it..its running fine..

    i attach my renderer code..
    if i remove initialze method i get the exception

    and if i dont remove the initialize method..i see an extra checkbox in the
    datagrid's first column header..i dont know from where is this appearing..i
    wish i could attach a screen shot...

    aaaaaaaa...i think i confuse u a lot..

    thanks once again













    public class DatagridCheckboxRendererAS extends CheckBox
    {
    public function DatagridCheckboxRendererAS(){
    super();

    }

    override public function initialize():void{
    this.addEventListener(FlexEvent.CREATION_COMPLETE, checkDelPermission);
    }


    override public function set data(value:Object):void{
    if(value != null){
    super.data = value;
    checkDelPermission(null);
    }
    }

    /*check for the delete permission,if true delete checbox is enabled
    called on CreationComplete event*/
    public function checkDelPermission(event:FlexEvent = null):void{
    var checkpermissioninstance:CheckPermission = new CheckPermission();
    checkpermissioninstance.permissions = [8];
    if(data.hasOwnProperty("permission")){
    checkpermissioninstance.permBit = data.permission;
    var delpermission:ArrayCollection =
    checkpermissioninstance.getPermissions()
    if(delpermission!=null){
    if(delpermission[0]==true){
    this.enabled = true;
    }
    else{
    this.enabled=false
    }
    }
    }
    else{
    this.enabled = false;
    }

    }

    //if delete checkbox is disabled,then do not display the cehckbox
    override protected function
    updateDisplayList(unscaledWidth:Number,unscaledHei ght:Number):void
    {
    super.updateDisplayList(unscaledWidth,unscaledHeig ht);
    if(this.enabled)
    this.visible = true;
    else
    this.visible=false;
    }


    override public function validateProperties():void{
    super.validateProperties();
    if (listData)
    {
    var dg:DataGrid = DataGrid(listData.owner);
    var column:CheckBoxHeaderColumn = dg.columns[listData.columnIndex];
    column.addEventListener("click",columnHeaderClickH andler);

    }
    }


    //click handler for checkbox renderers in each row
    override protected function clickHandler(event:MouseEvent):void{
    super.clickHandler(event);
    var dg:DataGrid = DataGrid(listData.owner);
    var data : Object = dg.dataProvider[listData.rowIndex];
    var dataObj :Object = {id:data.id,check:event.target.selected};
    parentDocument.toggleSelectedData(dataObj);
    }


    //click handler for the header checkbox of datagrid column
    private function columnHeaderClickHandler(event:MouseEvent):void{
    selected = event.target.selected;
    var dg:DataGrid = DataGrid(listData.owner);

    //the first header row has its index as neagtive value.Exclude the header
    row.
    if(dg.itemRendererToIndex(this) >= 0){
    if(this.visible){
    var data:Object = dg.dataProvider[dg.itemRendererToIndex(this)];
    var dataObj :Object = {id:data.id,check:event.target.selected};
    parentDocument.toggleSelectedData(dataObj);
    }
    }

    }

    smscentral Guest

  7. #6

    Default Re: error loading module using ModuleManager

    hi...

    i try to debug that mittobackendrequest but as and when i click my link..it
    shows up the error..

    at mx.rpc::AbstractInvoker$cinit()
    at global$init()
    at global$init()
    at mitto.core::MittoBackendRequest()
    at mitto.core::MittoBackendRequest$/CreateBackendRequest()
    at component.MXML::ListUsersComponent/entitiesList()
    at UserModule/linkToListUsers()
    at UserModule/__listUsers_click()


    mittobackend request class :


    public static function CreateBackendRequest(url:String=null) :
    MittoBackendRequest {
    return new MittoBackendRequest(url);
    }

    public function MittoBackendRequest(url:String=null){
    this.showBusyCursor = true;
    this.useProxy = false;
    this.method = "POST";
    this.url = url;
    this.curInstance = MittoBackendRequest.instanceCounter++;

    httpservice = new HTTPService();
    httpservice.addEventListener(FaultEvent.FAULT, handleFault);
    httpservice.addEventListener(InvokeEvent.INVOKE, handleInvoke);
    //httpservice.addEventListener(ResultEvent.RESULT, BackendResultHandler);
    this.events = new EventDispatcher();
    }

    smscentral Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139