Skip to Content
0
May 12, 2010 at 09:27 AM

Cannot receive event fired from component1 in component2

18 Views

Hi all,

Based on the link http://wiki.sdn.sap.com/wiki/display/BSP/Usingportaleventtocommunicatemultipledatabetweendifferentwebapplication(WDAandBSP)

I enter a text each in the 3 input fields in app1. I failed to receive the 3 text in app2. Debugging mode on the code below shows evt_name and evt_parameter as blank.

Method onactioncatch_event.

data: EVT_NAME type STRING,

evt_parameter type string,

wa_string type string,

it_string like table of wa_string.

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

if EVT_NAME = 'test_event'.

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

Split evt_parameter at "*" into table lt_string.

DATA:

node_main TYPE REF TO if_wd_context_node,

elem_main TYPE REF TO if_wd_context_element,

stru_main TYPE if_default=>element_main ,

item_text_reciever LIKE stru_main-text_reciever.

  • navigate from <CONTEXT> to <MAIN> via lead selection

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

  • get element via lead selection

elem_main = node_main->get_element( ).

Read table it_string into wa_string index 1.

  • get single attribute

elem_main->set_attribute(

EXPORTING

name = `TEXT_AREA_1`

value = wa_string ).

Clear wa_string.

Read table it_string into wa_string index 2.

Elem_main->set_attribute(

Exporting name = 'TEXT_AREA_2'

Value = wa_string).

)

endif.

endmethod.

Edited by: Siong Chao on May 12, 2010 11:28 AM