Skip to Content

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

issue in rendering Icon in Table View thru Iterator

I have a tableview with SINGLESELECT mode. Initially the ICON column in the tableview has to display red color light 'ICON_RED_LIGHT'. When the user selects a row in the tableview the icon has to change to yellow color light 'ICON_YELLOW_LIGHT'. How should I accomplish this in MVC with iterator.

In 'render_cell_start' method of iterator I wrote the code as follows

CASE p_column_key .

WHEN 'ICON'.

r_search_result ?= p_row_data_ref.

DATA: lcl_tableview TYPE REF TO cl_htmlb_tableview.

DATA: icon_light TYPE string.

CREATE OBJECT lcl_tableview.

icon_light = cl_bsp_mimes=>sap_icon( id = 'ICON_RED_LIGHT' ).

lcl_tableview->id = p_cell_id.

lcl_tableview->onRowSelection = 'render_yellow_light'.

icon_light = cl_bsp_mimes=>sap_icon( id = 'ICON_YELLOW_LIGHT' ).

p_replacement_bee = cl_htmlb_image=>factory( id = p_cell_id src = icon_light ).

ENDCASE.

and in DO_HANDLE_EVENT f controller class I wrote the code as

CASE event_tableview->server_event.

WHEN 'render_yellow_light'.

ENDCASE.

but its not working please help

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