on 10-24-2014 1:18 PM
hi
I'm using iframe for one of the scenarios to display bsp page. Working on a different monitor resolution i found the size of the iframe is bit not consistent across. I reaslised that the iframe is using 'px - pixel' for defining the height and width. wondering if there is a way to make ti dynamic in a way to fit the various monitor resolutions?
ps: i tried '%' but little it helped.
Hi,
% 's won't work for height property. You can create a Transparent container with Matrix Layout(and desired width in %) and place your iFrame in it and set the Stretch Horizontal and Vertical for Transparent Container which may help a bit.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prabhu,
Create a transparent container and place the iframe element inside it and set the transparent container element's layout as matrix layout and set the layout width and height as stretched.
Otherwise, you need to get the resolution of screen and set the height and width of IFRAME ui element in WDDOMODIFYVIEW method as below
METHOD wddomodifyview .
DATA lo_iframe TYPE REF TO cl_wd_iframe.
DATA lv_width TYPE string.
DATA lv_height TYPE string.
" Process only for first time
IF first_time = abap_true.
lo_iframe ?= view->get_element('IFRAME').
lv_width = wdr_task=>client_window->if_wdr_client_info_object~client_width.
lv_height = wdr_task=>client_window->if_wdr_client_info_object~client_height.
IF lo_iframe IS BOUND.
lo_iframe->set_width( lv_width ).
lo_iframe->set_height( lv_height ).
ENDIF.
ENDIF.
ENDMETHOD.
Note: if user changes the browser size at runtime, the iframe width / height may not change accordingly but upon any action you can again call this code to set based on modified window size.
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.