Thanks guys for all the inputs.
I was able to fix the issue. What was happening is that on unloading
the module, I was not removing the listed commands for that
controller. On loading the module again, each command would get added
again. So if I unload and load the module 5 times, the command would
get added 5 times.
Now I've added the following function to the module controller and
call it every time the module unloads. This cleans up the commands
list from the controller.
public function removeAllCommands():void
{
for (var key:String in commands)
{
removeCommand(key);
}
}
On Mar 1, 2:16 pm, Debabrata Acharjee <[email protected]> wrote:
> Is your problem fixed? It's a bit tricky to get Modules and
> Cairngorm work together. Is your main application also using
> Caringorm?
>
> On Feb 26, 9:53 pm, Vaibhav Seth <[email protected]> wrote:
>
> > Mapping the events to command is a kind of event listener only.
> > So, if even if the view goes out of the application, it doesn't mean the
> > handlers attached will also go away. There are possibilities that they will
> > respond even if the view have been removed from the list.
> > Use the weak-reference true, while adding the command in the controller and
> > use removeCommand() while you unload the module. Also, keep the event names
> > unique across all modules.
>
> > On Fri, Feb 26, 2010 at 11:37 AM, Ajay Chhaya <[email protected]> wrote:
> > > please check the frontcontroller, if it's instance are being created
> > > twice.
> > > ---------------------
> > > Ajay Chhaya
>
> > >www.ajaychhaya.com
> > > --------------------------------
>
> > > On Fri, Feb 26, 2010 at 5:07 PM, gurpreet <[email protected]> wrote:
>
> > >> I am loading modules in my application which is based on Cairngorm.
> > >> Each of the module has its own frontcontroller. I'm facing an issue
> > >> that when a cairngorm event is dispatched within the module, the
> > >> command execute() method gets called twice. Has anyone faced this
> > >> before?
>
> > >> Really need some help here...
>
> > >> Thanks in advance
> > >> gurpreet
>
> > >> --
> > >> You received this message because you are subscribed to the Google Groups
> > >> "Flex India Community" group.
> > >> To post to this group, send email to [email protected].
> > >> To unsubscribe from this group, send email to
> > >> [email protected]<flex_india%[email protected]>
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/flex_india?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Flex India Community" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<flex_india%[email protected]>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/flex_india?hl=en.
>
> > --
> > Thanks,
> > Vaibhav Seth.
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en.