cancel
Showing results for 
Search instead for 
Did you mean: 

how to display an alert message on click of link in tableview

Former Member
0 Kudos

Hi,

Following is the code for a tableview in layout section of a BSP( i have specified only one tableview column here). The requirement is to display an alert message on click of link in the first column that is "evbeg". Can anyone please help me how to achieve this? Appreciate quick response on this.

CREATE OBJECT lr_dateiterator TYPE cl_lso_bsp_it_trdates

EXPORTING im_application = application

im_tform = trainingform.

<htmlb:tableView id = "dates"

table = "<%= dates %>"

iterator = "<%= lr_dateiterator %>"

width = "100%"

rowCount = "<%= lp_len %>"

footerVisible = "FALSE"

sort = "SERVER" >

<htmlb:tableViewColumn columnName = "evbeg"

type = "user"

title = "<%= otr(LSO_FRONTEND/schedule) %>"

tooltipHeader = "<%= otr(LSO_FRONTEND/schedule) %>"

sort = "TRUE" >

</htmlb:tableViewColum>

Thanks and Regards,

Archana.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member188685
Active Contributor
0 Kudos

you have to code in the iterator for this.

in the render_cellstart method of the iterator you need to code.

this is for a column.

when 'MATNR'.
 data: text type string.
 text = 'disp_alert()'.   "this java script i placed in the page
 data: lo_link type ref to cl_htmlb_link.
  create object lo_link.
     lo_link->id = p_cell_id.
     lo_link->onclientclick = text.
     lo_link->text = <fs>-matnr.
     p_replacement_bee = lo_link.

below is the java script i added in my page..

<  sc ri   pt type="text/javasc ript"   >
f u n  ction disp_alert()
{
a  l e  rt("helloworld");
}
< /s  c ript >

Former Member
0 Kudos

Hi Vijay,

Thanks for your response, but I need your help further ..In IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START of tableview iterator (cl_lso_bsp_it_trdates), following code is used,

WHEN 'EVBEG'..

CALL METHOD cell_renderer->render_schedule

EXPORTING

im_tform = tform-tform

im_begda = <fs_line>-evbeg

im_endda = <fs_line>-evend

  • im_object_text = lp_string

im_object_plvar = <fs_line>-plvar

im_object_otype = tform-objtype

im_object_objid = <fs_line>-eveid

RECEIVING

result = p_replacement_bee.

here there is no option for onclientclick. Can u help me to solve this?

Regards,

Archana.

former_member188685
Active Contributor
0 Kudos

i am not sure what is the method render_schedule doing here.., but change your code like this

WHEN 'EVBEG'.
 data: lo_link type ref to cl_htmlb_link.  <-----are you using the link class
  create object lo_link.
     lo_link->id = p_cell_id.
     lo_link->onclientclick = text.  "<-----here pass the script function
     lo_link->text = <fs>-matnr.
     p_replacement_bee = lo_link.