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: 

How to set up dynamic height (resizing) of ALV tree HTML header?

Former Member
0 Kudos

Hey all,

I have created an ALV tree using the following classes:


go_container_tree TYPE REF TO cl_gui_custom_container,

go_alv_tree TYPE REF TO cl_gui_alv_tree,

and I also created his HTML header followingly:


DATA: lo_header TYPE REF TO cl_gui_html_viewer,

           lo_dyndoc TYPE REF TO cl_dd_document.

* Get Header

   CALL METHOD po_tree->get_html_header_object

     CHANGING

       er_html_header = lo_header.

* Build Dynamic Document

   CREATE OBJECT lo_dyndoc.


" added some texts to the lo_dyndoc


lo_dyndoc->html_control = lo_header.


CALL METHOD lo_dyndoc->display_document

     EXPORTING

       reuse_control      = 'X'

     EXCEPTIONS

       html_display_error = 1.

I would like to set the height of the HTML header according to the added texts (that means I do not want a vertical scrollbar)

This is how it looks like now:

And this is what I would like to achieve (resize the header according to the added text):


I tried to set it manually with the following code, but it does not work.


CALL METHOD lo_header->set_height

     EXPORTING

               height  = 100.

How can I set the automatic resizing of the header according to the added text or at least how can I set the height of the header?

Thank you.

Regards,
RB

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

I think you should use the method:

CALL METHOD po_tree->set_splitter_row_height( 100 ).
5 REPLIES 5

Sandra_Rossi
Active Contributor
0 Kudos

I think you should use the method:

CALL METHOD po_tree->set_splitter_row_height( 100 ).

0 Kudos

Yeh this is working but I still have to set up automatic resizing according to the content and window size.

0 Kudos

I'm afraid calculating automatically the height of the content of the HTML viewer requires embedding javascript in it (easy if you program directly the HTML viewer, but maybe not so easy if you use DD), for triggering an event at the onReady javascript event and transmit the offsetHeight of the main HTML element (<body onready="javascript:...getElementsById('sapeventlink').click( );"> with <a href="SAPEVENT:action(...)" id="sapeventlink"> and handle the SAPEVENT event of the HTML viewer to get values).

0 Kudos

well this is really a bit complicated
I was also thinking about checking whether there is a scrollbar and If so I would increase the height until there is no scrollbar. Is it possible to check whether there is a vertical scrollbar, I could not find it.

0 Kudos

I never saw something like that in control framework.