Hi Webdynpro Guys,
How to do the coding for Event parameter mapping for User interface elements in a view of Webdynpro ABAP ?
I have gone through SAP Help document for parameter mapping.. I got quiet understand within that doc, but not much.So I couldn't able get to define same action method( one Event handler ) for Different UI elements in a same view of Webdynpro component.
Could you please share info with example regarding that one ...?
Thanks in advance.
Yes, you can use the same event handler for different actions of UI elements. The custom parameters desired for an event must be defined for each UI element in WDDOMODIFYVIEW. To map the parameters you should use a specific method of UI element for each permitted action.
In example, if you take a radiobutton (if_wd_radiobutton) in your view you can use the method "map_on_select" and define which context data would receive in event handler for select event of radiobutton. This parameters will arrive to WDEVENT parameter (common of all handlers) as a type of CL_WD_CUSTOM_EVENT.
You can retrieve the UI element ID from the WDEVENT import parameter of the associated action method( one Event handler ).
For example if you have associated action 'GO' with 3 different UI elements then to identify which UI element has triggered this action you can use the below code snippet..
METHOD onactiongo .
* Data declaration
DATA lv_id TYPE string.
* Retrieve the UI element ID which has triggered the action
CALL METHOD wdevent->get_string
name = 'ID'
value = lv_id.
NB : 'wdevent' is the import parameter of the action handler
Hope this helps.
Sorry for the late reply.
Please refer the below link for your query.