Quantcast
Viewing all articles
Browse latest Browse all 8065

Re: iFRame does not exist

Hi Steffen,

 

Yes, you can add iFrame dynamically.

 

Check if you have the class CL_WD_IFRAME in your system,

 

You can achieve your requirement as below

   

      Write the below code in WDDOMODIFYVIEW( ) of your view

  IF first_time EQ abap_true.


    DATA lo_root      TYPE REF TO cl_wd_uielement_container.
    DATA lo_iframe    TYPE REF TO cl_wd_iframe.
    DATA lo_flow_data TYPE REF TO cl_wd_flow_data.

 

    cl_wd_iframe=>new_iframe(
      EXPORTING
        id                     = 'IFRAME1'
        view                  = view
      RECEIVING
        control                = lo_iframe
    ).

    cl_wd_flow_data=>new_flow_data(
      EXPORTING
*    cell_design = E_CELL_DESIGN-PADLESS
        element     = lo_iframe
*    v_gutter    = E_V_GUTTER-NONE
      RECEIVING
        control     = lo_flow_data
    ).
   
    lo_iframe->set_source( 'www.google.com').
    lo_iframe->set_layout_data( the_layout_data = lo_flow_data  ).

    lo_root ?= view->get_root_element( ).
    lo_root->add_child(
      EXPORTING
*    index     =
        the_child = lo_iframe
    ).
  ENDIF.

 

Hope this helps you.

 

Regards,

Rama


Viewing all articles
Browse latest Browse all 8065

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>