cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic creation of FormattedTextView

Former Member
0 Kudos

Hello,

Has anybody tried to dynamically create FormattedTV in Transparentcontainer?

The FormattedTextView is of type anchor tag also needs to have a action.

Any ideas?

I tried something

DATA:
          lr_tc          TYPE REF TO cl_wd_transparent_container.
  DATA f1 TYPE REF TO cl_wd_formatted_text.
  DATA f1_test TYPE REF TO cl_wd_uielement.
  DATA f2 TYPE REF TO cl_wd_formatted_text.
  DATA f3 TYPE REF TO cl_wd_formatted_text.
  DATA f  TYPE REF TO cl_wd_formatted_text.

  lr_tc ?= view->get_element( 'TC' ).
  lr_tc->remove_all_children( ).


  f1 = cl_wd_formatted_text=>make_text(
     inner_text = 'Testing Link'                            "#EC NOTEXT
     tag        = cl_wd_formatted_text=>e_tag-h4
   ).

  cl_wd_grid_data=>new_grid_data( element = f1 ).
  lr_tc->add_child( f1 ).

Results in error "f1 is not type-compatible with element."

Thanks much,

Dharmi

Accepted Solutions (1)

Accepted Solutions (1)

thomas_szcs
Active Contributor
0 Kudos

Hi Dharmi,

The reason is that you tried to add the cl_wd_formatted_text object to a transparent container. You need to add a cl_wd_formatted_text_view instead...

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

Thank you very much for your reply. It worked.

Regards,

Dharmi

Answers (0)