Getting the WDA Element in the onAction event
We are working on the Netweaver 2004S release and in the process of writing an interactive Web Dynpro (ABAP) application. A Table (UI element) is defined in the main view with data binding to a context node (Cardinality 0:n, NO LEAD SELECTION, NO SINGLETON). This table has three columns and the first column is defined as a "LinkToAction" element. The values are displayed in the table correctly and the first column with document numbers is displayed properly as a link. I defined the "onAction" event of the link, and would like to get access to the selected document number. How to do this? I only get "WDEVENT" parameter in the onAction event handler. Is there any way to get access to the "LinkToAction" UI object itself in the event?
I was trying to draw a parallel with BSP's and was hoping to get access to the UI event object itself, just like what we get in the "DO_HANDLE_EVENT" of the controller. When the user clicks on the link of TABLE, I want to read the text attribute of "LinkToAction" element and then use the document number to display details. I tried using the IF_WD_CONTEXT_NODE interface etc but could not get to the "Text" attribute.
Again, this is for Web Dynpro ABAP and we don't want to use a singleton.
Thanks much for you time and your response will be appreciated
Points will be awarded
Srinivasa Raghavachar replied
Add the following code.
DATA: THE_TABLE_CELL_EDITOR type ref to CL_WD_LINK_TO_ACTION,
link_value type string.
THE_TABLE_CELL_EDITOR ?= wd_table_column->GET_TABLE_CELL_EDITOR( ).
link_value = THE_TABLE_CELL_EDITOR->GET_TEXT( ).
You will get text in link_value.