2 Replies Latest reply on Mar 3, 2008 8:29 PM by smscentral

    module loader

    smscentral Level 1
      I have dragdroplist custom component.
      In this i have two lists showing up values from a servlet using dataprovider

      using this component in application runs fine.
      but when i use this in a module i get the exception loading the values in the list with the url.

      paramaeters for the component are
      1.url to display the values in the lists.
      2.labels of the two lists

      i have a module with a button in it.on click of this button i load another module with the list component in it.
      in a module1 i have
      <mx:Button label="Edit Roles" click="showUserRoles(moduleexample,'editUserRoles.swf');"/>

      public function showUserRoles(moduleexample:ModuleLoader,urlstr:String):void {
      moduleexample.url = urlstr;

      in module 2 i have

      <mx:Module xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" height="600" xmlns:MyComp="Components.*">

      <mx:Panel title="Edit User Roles" >
      displaylisturl = " http://localhost:8080/mittoflexUI/usermanagement"
      submitlisturl = " http://localhost:8080/mittoflexUI/edituserroles"
      labelfield = "description"
      firstlistlabel="Available Roles"
      secondlistlabel="Current Roles"
      buttonlabel = "Submit Roles"
      parentnode = "Users"

      I am able to get the labels for the lists but not the values from the servlet.do i need to use any events for this.

      help me with this..

        • 1. Re: module loader
          Bryan Dresselhaus Level 1
          You can try adding a creationComplete="init();" in the mx:Module tag. Then declare a function down below called init(event:FlexEvent):void {}. In the function assign the urls to the custom component's properties. I suspect that some code might be executing before the module is added to the application's screen.

          If you could, please post the exception or error log you are receiving.
          • 2. Re: module loader
            smscentral Level 1
            thanks for the reply

            i could trace the problem.i am now able to display the values but my drag drop operation is not working.
            previously the problem was with cursormanager.i used httpservice.showbusycursor=true. and now i just removed that line and i could see the values in list.but still have the problem with drag drop now.

            i am going through net and found some thing reagrding multiple modules in application,i saw this

            ""if loaded via different subapps, I would expect drag and drop to fail in 2.0. In 2.0, you would have to share the DragManager itself which would have a higher impact on the SWF size. In 2.0.1, you share IDragManager which will only add about 250 bytes. So, same rules, but easier to run into these scenarios in 2.0.1"""adding two lines import mx.managers.IDragManager;
            private var iDragManager:IDragManager;

            but this doesnt work for me though.

            the error i am getting while trying to drag the value is cannot access a property or method of null object referene
            at mx.managers:CursorManagers.setCursor()
            at mx.managers.dragclasses :: DragProxy.showFeedBack()
            at mx.managers.dragclasses::dragproxy/mouseMoveHandler()