You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Oleg Konovalov <ol...@gmail.com> on 2016/04/28 20:14:07 UTC

Robotleg mediator cannot hear event from command

Hi,

I am new to Robotlegs.
Adding enhancements to existing Flex+Java app.
So in Command on successful data retrieve of list of data from the server I
dispatchToModule event with that new ArrayCollection, to which I listen in
Mediator, but that eventhandler never gets executed.
In debugger I can see that all is executed correctly in Command.
Mediator and Command do not share any models.

Any idea what might be wrong?

Robotlegs 1.5.2 with Flex 4.6 on Win10.

TIA,
Oleg.

Re: Robotleg mediator cannot hear event from command

Posted by OK <OK...@edscha.com>.
Hi,
only a shoot in the dark cause I've no experience with RobotLegs but PureMVC
from wich RobotLegs is inspired. Are you sure that your DropDownList
mediator is instanciated?:

http://knowledge.robotlegs.org/kb/reference-mvcs-implementation/how-to-mediate-a-flex-popup


HTH,
Olaf



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Robotleg-mediator-cannot-hear-event-from-command-tp12629p12631.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Robotleg mediator cannot hear event from command

Posted by Oleg Konovalov <ol...@gmail.com>.
I should also add that:
- the dropdownlist I am trying to populate is on Popup, which is
instantiated from same Mediator.
- I have one popupEvent with many many types, just added one for
RequestData, and another to indicate to Mediator that list is loaded
ListLoaded.
- I do have moduleCommandMap.mapEvent for RequestData in the context, but
not for ListLoaded. Do I need to?
On Apr 28, 2016 2:14 PM, "Oleg Konovalov" <ol...@gmail.com> wrote:

> Hi,
>
> I am new to Robotlegs.
> Adding enhancements to existing Flex+Java app.
> So in Command on successful data retrieve of list of data from the server
> I dispatchToModule event with that new ArrayCollection, to which I listen
> in Mediator, but that eventhandler never gets executed.
> In debugger I can see that all is executed correctly in Command.
> Mediator and Command do not share any models.
>
> Any idea what might be wrong?
>
> Robotlegs 1.5.2 with Flex 4.6 on Win10.
>
> TIA,
> Oleg.
>

Re: Robotleg mediator cannot hear event from command

Posted by Tonic <an...@hotmail.fr>.
Your Service just must extends Actor, to access to the RL event bus.

In your Service, just use Async Token, and in the complete or error
callback, dispatch the event with the "dispatch" method.



-----
Tonic
Twitter 
Folio 
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Robotleg-mediator-cannot-hear-event-from-command-tp12629p12735.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Robotleg mediator cannot hear event from command

Posted by Oleg Konovalov <ol...@gmail.com>.
Tonic,

My Command does call Service (to get data from DB stored proc),
and on success (in handler) has to do a little processing of its resultset
to create a proper ArrayCollection.
only after that I am trying to dispatch the ListLoaded event (from onSucces
handler).

I have seen that working from doing dispatchToModules() directly from
execute() in that app,
but don't see why it works there, but not from onSuccess handler.
Is there difference there?

I don't think we can easily upgrade Robotlegs at that point - it's a large
and complex app,
and nobody else around from original developers to fix possible problems,
and I am not in full control of it yet.


TIA,
Oleg.

On Fri, Apr 29, 2016 at 4:28 AM, Tonic <an...@hotmail.fr> wrote:

> Hi, the command in Robotlegs normaly can't communicate with the robotlegs
> eventbus. Command must execute Service (who extend Actor), and this is the
> Service who dipatch Event with your result (your collection) in the
> robotlegs bus event.
>
> In Robotleg 2.2.1, you can simply extend Command, an inject event
> dispatcher
> bus like this.
>
>
>
> With that, your command can dispatch to the bus without executing Service
> extends Actor.
>
> So maybe you can upgrade your library ;)
>
>
>
> -----
> Tonic
> Twitter
> Folio
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Robotleg-mediator-cannot-hear-event-from-command-tp12629p12632.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>



-- 
Thank you,
Oleg.

Re: Robotleg mediator cannot hear event from command

Posted by Tonic <an...@hotmail.fr>.
Hi, the command in Robotlegs normaly can't communicate with the robotlegs
eventbus. Command must execute Service (who extend Actor), and this is the
Service who dipatch Event with your result (your collection) in the
robotlegs bus event.

In Robotleg 2.2.1, you can simply extend Command, an inject event dispatcher
bus like this.



With that, your command can dispatch to the bus without executing Service
extends Actor.

So maybe you can upgrade your library ;)



-----
Tonic
Twitter 
Folio 
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Robotleg-mediator-cannot-hear-event-from-command-tp12629p12632.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.