Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

no border in cl_gui_docking_container

Former Member
0 Kudos
881

Hi. I have a progrm:

DATA:
docking TYPE REF TO cl_gui_docking_container,
picture_control_1 TYPE REF TO cl_gui_picture,
url(256) TYPE c .

PARAMETERS: p_dummy TYPE c .

AT SELECTION-SCREEN OUTPUT.
PERFORM show_pic.

START-OF-SELECTION.


*&---------------------------------------------------------------------*
*& Form show_pic
*&---------------------------------------------------------------------*
FORM show_pic.

DATA: repid LIKE sy-repid.
DATA: file_name LIKE sapb-sapfiles,
file_type LIKE bdn_con-mimetype.

repid = sy-repid.
IF docking IS INITIAL .
CREATE OBJECT docking
EXPORTING
repid = repid
dynnr = sy-dynnr
side = cl_gui_docking_container=>dock_at_right
extension = '200'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.



CREATE OBJECT picture_control_1 EXPORTING parent = docking.

CHECK sy-subrc = 0.



CALL FUNCTION 'DP_PUBLISH_WWW_URL'
EXPORTING
objid = 'HTMLCNTL_TESTHTM2_SAP_AG'
lifetime = 'T'
IMPORTING
url = url
EXCEPTIONS
OTHERS = 1.

* Load the picture by using the url generated by the data provider.
IF sy-subrc = 0.
CALL METHOD picture_control_1->load_picture_from_url_async
EXPORTING
url = url.
ENDIF.
ENDIF .

ENDFORM. "show_pic

The docking container appears with border. Could You tell me how to remove that border? Greetings. P.

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos
149

Hello Pjotr

Try this variant of Jonathan's solution:

*" So let's remove one or two of these:
    l_style = cl_gui_control=>ws_child.
*"          + cl_gui_control=>ws_thickframe  "Take this out
*"          + cl_gui_control=>ws_border      "And this too
*"          + cl_gui_control=>ws_visible.     " why not invisible!?

Regards

Uwe

3 REPLIES 3

Former Member
0 Kudos
149

Not sure you can remove it completely... you can make it smaller with the following (see the "l_style" setting):

data:
  go_docking            type ref to cl_gui_docking_container,
  go_picture_control_1  type ref to cl_gui_picture,
  url(256)              type c .

parameters:
  p_dummy               type c .

at selection-screen output.
  perform show_pic.

*&---------------------------------------------------------------------*
*&      Form  show_pic
*&---------------------------------------------------------------------*
form show_pic.

  data:
    l_style            type i,
    l_repid            like sy-repid.

  l_repid = sy-repid.
*
*" Create docking container for image
  if not go_docking is bound.
*
*" Set the style we want:
*
*" Inside the cl_gui_docking_container it defaults the following for
*" Style, if nothing is set by caller:
*
*    l_style = cl_gui_control=>ws_child
*            + cl_gui_control=>ws_thickframe
*            + cl_gui_control=>ws_border
*            + cl_gui_control=>ws_visible.
*
*" So let's remove one or two of these:
    l_style = cl_gui_control=>ws_child
*"          + cl_gui_control=>ws_thickframe  "Take this out
*"          + cl_gui_control=>ws_border      "And this too
            + cl_gui_control=>ws_visible.

    create object go_docking
      exporting
        repid                       = l_repid
        dynnr                       = sy-dynnr
        side                   = cl_gui_docking_container=>dock_at_right
        extension                   = '200'
        style                       = l_style
      exceptions
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5.

    create object go_picture_control_1
      exporting
        parent = go_docking.

    check sy-subrc is initial.

    call function 'DP_PUBLISH_WWW_URL'
      exporting
        objid    = 'HTMLCNTL_TESTHTM2_SAP_AG'
        lifetime = 'T'
      importing
        url      = url
      exceptions
        others   = 1.

* Load the picture by using the url generated by the data provider.
    if sy-subrc is initial.
      call method go_picture_control_1->load_picture_from_url_async
        exporting
          url = url.
    endif.
  endif .

endform. "show_pic

Former Member
0 Kudos
149

Another option may be to use a different container?

I have displayed pictures using:


data url  type cndp_url.              
data picture_control_1 type ref to cl_gui_picture.
data cont01 type ref to cl_gui_custom_container.

* Create controls
    create object cont01
      exporting
        container_name = 'CONT01'.

    create object picture_control_1
      exporting
        parent = cont01.

* Set the display mode to 'normal' (0)
    call method picture_control_1->set_display_mode
      exporting
        display_mode = cl_gui_picture=>display_mode_fit_center.

CALL FUNCTION 'DP_PUBLISH_WWW_URL'
EXPORTING
objid = 'HTMLCNTL_TESTHTM2_SAP_AG'
lifetime = 'T'
IMPORTING
url = url
EXCEPTIONS
OTHERS = 1.

* Load the picture by using the url generated by the data provider.
    if sy-subrc = 0.
      call method picture_control_1->load_picture_from_url_async
        exporting
          url = url.
    endif.

Andrew

uwe_schieferstein
Active Contributor
0 Kudos
150

Hello Pjotr

Try this variant of Jonathan's solution:

*" So let's remove one or two of these:
    l_style = cl_gui_control=>ws_child.
*"          + cl_gui_control=>ws_thickframe  "Take this out
*"          + cl_gui_control=>ws_border      "And this too
*"          + cl_gui_control=>ws_visible.     " why not invisible!?

Regards

Uwe