Skip to Content
0
Former Member
May 15, 2006 at 10:12 PM

Changeable image using table view iterator

14 Views

Hello Forum -

I have a tableview iterator working using cl_htmlb_image class. The icon shows up perfectly based on the column value (X=green; space=red). I would now like to click on the icon (just like clicking on checkbox) and turn the color from red->green or green->red which should of course change the value of the column as well.

Here is my code, please help me:

======================================================

IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START

======================================================

DATA: img TYPE REF TO cl_htmlb_image.

DATA: beetable TYPE REF TO cl_bsp_bee_table.

CREATE OBJECT img.

CREATE OBJECT beetable.

CASE p_column_key.

WHEN 'ACTVFLAG'.

img->id = p_cell_id.

IF c_row_ref->actvflag = 'N' OR

c_row_ref->actvflag IS INITIAL.

img->src = 'ICON_LED_RED'.

img->alt = 'Inactive'.

ELSE.

img->src = 'ICON_LED_GREEN'.

img->alt = 'Active'.

ENDIF.

beetable->add( element = img level = 1 ).

p_replacement_bee = beetable.

Thanks,

Partho