Mapping event with second type to command is not working
Hi,
I am doing enhancements to existing Robotlegs2 web app.
So my popup dispatches event of type1, which main app listens to,
so on that event Command calls Service, which in calls remote Java service,
which calls DB via Spring JDBC template, and returns me status string
(success or some Error).
Now I am adding a second type - type2, and the rest is similar (except I pass extra params to Stored Proc 2).
For some reason I see Event dispatched, but Commend for type2 is NOT getting executed.
Is there a limitation that I can't do:
moduleCommandMap.mapEvent(ChangePasswordEvent.type1, ChangePasswordRequestCommand, ChangePasswordEvent);
moduleCommandMap.mapEvent(ChangePasswordEvent.type2, ChangePasswordRequestCommand, ChangePasswordEvent);
What else might be missing or wrong?
I am fairly new to Robotlegs2.
Please help.
TIA,
Oleg.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Ondina D.F. on 09 Aug, 2016 09:26 AM
Hi Oleg,
Sorry for the late response. I haven't received any notifications about your message, and since you've marked the discussion as private, I didn't see it on the forum's web page either, until now. Is there any reason you want this discussion to be private, or it just happened by accident?
To your question:
There is no limitation on the number of events or event types mapped to a command.
In robotlegs 2 the mapping should look like this:
What is moduleCommandMap in your example? Is it just the name of the variable of type IEventCommandMap?
If your event is carrying a payload ( the params ?), you need to inject the event into your command, so that you can access the params there:
If that doesn't solve your problem, please show the code (or an example) where your command is trying to access the event's payload.
Ondina
2 Posted by olegkon on 09 Aug, 2016 11:43 AM
Hi,
I was able to resolve it:in second case user is entering there through deep linking,(parent of popup is different)so I needed to use different context Thank you for your help, Oleg.
Support Staff 3 Posted by Ondina D.F. on 10 Aug, 2016 10:41 AM
No problem!
Ondina D.F. closed this discussion on 10 Aug, 2016 10:41 AM.