on 07-31-2008 10:39 PM
Hi all,
I want my component MovimientosAlmacen_com to catch the "Importar" event from other component FileInterface_comp, so I put the event in the interface controller of FileInterface_comp, then in the wdDoInit() method of my component controller I put this code:
IWDEventId eventId = wdThis.wdGetFileInterfaceInterface().WD_EVENT_IMPORTAR;
IWDEventHandlerId eventHandlerId = wdThis.WD_EVENTHANDLER_ON_IMPORTAR;
wdComponentAPI.addEventHandler(eventId,eventHandlerId);
But when I try to run my application, it gives me the error:
java.lang.IllegalArgumentException: EventId(Importar) does not belong to Component(net.ebpartners.sky.MovimientosAlmacen_comp, 32656196)
So, my question is, can this be done?, can I catch an event from a different component?
Thanks in advance
Daniel
Daniel,
Of course this can be done - and this is the primary and perhaps only method of interaction from Child Component to Parent component. Have you declared appropriate component usage between the components? If the information flow is from Parent to Child then no eventing is required - this can be done by context mapping through interface view controller. If information flow is from Child to Parent, eventing is required.
Please take a look at [this|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8d7cd90-0201-0010-4a8c-dd22fa16ca0a] tutorial to solve your issue.
Hope this helps.
Vishwas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vishwas,
You were right, the problem was I did not declare the component interface controler as a required controler, and when I create the event handler method in the parent component, I could not assign the event to my event hanlder, I follow the tutorial and everything works now,
thanks a lot !!!!
Regards
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
we cann't catch the event from other component,we will get IllegalArgumentException.
we can only fire the event ,which belongs to the same component.
you can only catch the event from component controller.
you can do this.
Declare an Event(Submit) in the componentController.
Declare a button in view,and catch the event by doing like this.
onActionviewaction(....)
{
IWDEventId eventid=wdThis.wdGetFirst_CompController().WD_EVENT_SUBMIT;
IWDEventHandlerId evhandlerid=wdThis.WD_EVENTHANDLER_ON_ACTIONVIEWACTION;
wdComponentAPI.addEventHandler(eventid,evhandlerid);
}
Regards
sowmya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.