cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting <br> in a tableview cell w/link

Former Member
0 Kudos

I am trying to create a 2-line tableview cell where the first line is a link and the second line is just text. I almost have it working, but I cannot get cell data to properly recognize the <br>.

Here is the code I have in my iterator method RENDER_CELL_START:

  
  DATA: lcl_link        TYPE REF TO cl_htmlb_link.
  DATA: lcl_bee_table   TYPE REF TO cl_bsp_bee_table.
  DATA: lcl_bsp_element TYPE REF TO cl_bsp_element.
  DATA: lv_javascript   TYPE string.
  DATA: lv_str1         TYPE string.

  FIELD-SYMBOLS: <row>  TYPE ANY,
                 <col>  TYPE ANY.
  FIELD-SYMBOLS: <f1>   TYPE ANY,
                 <f2>   TYPE ANY.

  ASSIGN p_row_data_ref->* TO <row>.
  ASSIGN COMPONENT p_column_key OF STRUCTURE <row> TO <col>.

  CASE p_tableview_id.
    WHEN 'results'.
      IF p_column_key = 'NUMM'.
        ASSIGN COMPONENT 'KEY' OF STRUCTURE <row> TO <f1>.
        CONCATENATE 'showDetail("' <f1> '");' INTO lv_javascript.
        lcl_link = cl_htmlb_link=>factory( id            = p_cell_id
                                           text          = <col>
                                           onclientclick = lv_javascript ).

        ASSIGN COMPONENT 'TEXT' OF STRUCTURE <row> TO <f2>.
*       Add break between key and text
        CONCATENATE '<br>' <f2> into lv_str1.
        lcl_bsp_element = cl_htmlb_textview=>factory( text = lv_str1 ).

        CREATE OBJECT lcl_bee_table.
        lcl_bee_table->add( lcl_link ).
        lcl_bee_table->add( lcl_bsp_element ).
        p_replacement_bee = lcl_bee_table.
      ENDIF.
  ENDCASE.
ENDMETHOD.

What I end up with is something that looks like

<u>0000012345</u>This is the text

(the blank line above is intentional - it looks like the <br> is processed BEFORE all text instead of in the middle)

What I want is

<u>0000012345</u>

This is the text

Any ideas/suggestions/inspirations/words of wisdom?

Accepted Solutions (1)

Accepted Solutions (1)

rainer_liebisch
Contributor
0 Kudos

Hi Gregory,

try it with the following:


...
CREATE OBJECT lcl_bee_table.
lcl_bee_table->add( lcl_link ).
lcl_bee_table->add_html( html = `<br>` ).
lcl_bee_table->add( lcl_bsp_element ).
p_replacement_bee = lcl_bee_table.

instead of the 'concatenate' line

Regards,

Rainer

Answers (0)