Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Simple WD4A Portal Eventing does not work

Hello togehter,

I'm trying to get a simple Portal Eventing to work with two WebDynpro ABAP components. I read several threads as well as a blog from Thomas Jung about this but still have no eventing. What am I doing wrong? I think that it might be only a little obstacle but I can't get it. So what I didi is:

1.) Created 1st WD4A application with a button and an action behind that button:

DATA: l_api_component TYPE REF TO if_wd_component,

l_portal_manager TYPE REF TO if_wd_portal_integration.

l_api_component = wd_comp_controller->wd_get_api( ).

l_portal_manager = l_api_component->get_portal_manager( ).

l_portal_manager->fire(

portal_event_namespace = 'urn:my.namespace'

portal_event_name = 'test_event'

portal_event_parameter = 'testValue' ).

2.) Created 2nd WD4A application with the following code in the WDDOinit-Method:

DATA: l_api_component TYPE REF TO if_wd_component,

l_portal_manager TYPE REF TO if_wd_portal_integration,

view TYPE REF TO if_wd_view_controller.

l_api_component = wd_comp_controller->wd_get_api( ).

l_portal_manager = l_api_component->get_portal_manager( ).

view ?= wd_this->wd_get_api( ).

l_portal_manager->subscribe_event(

portal_event_namespace = 'urn:my.namespace'

portal_event_name = 'test_event'

view = view

ACTION = 'CATCH_EVENT' ).

and an action.

method ONACTIONCATCH_EVENT .

data: EVT_NAME type STRING,

evt_parameter type string.

EVT_NAME = WDEVENT->GET_STRING( NAME = 'PORTAL_EVENT_NAME' ).

if EVT_NAME = 'test_event'.

evt_parameter = WDEVENT->GET_STRING( NAME = 'PORTAL_EVENT_PARAMETER' ).

DATA:

ls_text TYPE if_main=>element_main,

node_main TYPE REF TO if_wd_context_node,

elem_main TYPE REF TO if_wd_context_element.

node_main = wd_context->get_child_node( name = `MAIN` ).

evt_parameter = 'IT WORKED'.

else.

evt_parameter = 'did not work'.

endif.

ls_text-text_receiver = evt_parameter.

node_main->bind_element( ls_text ).

endmethod.

3.) FInally I created two iViews (for each WD4A application) and a page, linked the iViews in the page and made a preview. Unfortunately nothing happend in the second iVIew with the 2nd WD4A application in it.

Any help?

Thanx in advance

Matthias

Former Member
Not what you were looking for? View more on this topic or Ask a question