In my webdynpro, when I click a button, I wan't to get the tooltip of the button and use it as the title of the pop-up window.
method WDDOMODIFYVIEW .
"write view to attribute so it can be accessed from other methods.
wd_this->DETAILVIEW = view.
endmethod.
.
method ONACTIONOPENDIALOG .
data lv_title type string.
data lv_buttonID type string.
data lv_button type ref to if_wd_view_element.
buttonID = wdevent->get_string( name = 'ID' ).
button = wd_this->detailview->get_element( lv_buttonid ).
call method cl_fitv_wd_util=>UI_GET_PROPERTY(
exporting
io_view = wd_this->detailview
io_view_element = lv_button
iv_id = buttonid
iv_property_name = 'TOOLTIP'
importing
ev_value = lv_title ).
wd_this->dopopup( title = lv_title ).
endmethod.
The method UI_GET_PROPERTY fails to get the tooltip. Probably because it's trying to call the method GET_TOOLTIP on if_wd_view_element and not on cl_wd_button. Is this a bug in this method? Is there a way to convert if_wd_view_element to cl_wd_button?