Application Development and Automation 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: 
Read only

html viewer refresh problem

Former Member
0 Likes
1,892

Hello all,

I have a small html window in my dialog screen and i show some values in this.

But after some input, i need to refresh this html.

But i couldnt succeed.

How can i refresh it when i trigger PAI every time?

This is the method i call.

METHOD main.

     DATA oref_lcl TYPE REF TO lcl_class.

     DATA html TYPE w3htmltab.

     DATA url  TYPE c LENGTH 255.

     DATA go_custom_cont     TYPE REF TO cl_gui_custom_container.

     CLEAR go_custom_cont.

     CREATE OBJECT: go_custom_cont

     EXPORTING container_name = 'CC1'.

     CLEAR oref.

     CREATE OBJECT oref

       EXPORTING

         parent = go_custom_cont.

     DATA events TYPE cntl_simple_events.

     DATA event TYPE cntl_simple_event.

     event-eventid = oref->m_id_sapevent.

     event-appl_event = 'X'.

     APPEND event TO events.

     CALL METHOD oref->set_registered_events

       EXPORTING

         events = events.

     SET HANDLER me->on_html_event FOR oref.

     APPEND '<html>'                          TO html.

     APPEND '<body bgcolor="#EAF1F6">'        TO html.

     APPEND '<center>'                        TO html.

     APPEND '<font face="verdana" color= "red" size="6" >' TO html.

     APPEND gv_maktx                          TO html.

     APPEND '</font>'                         TO html.

     APPEND '</center>'                       TO html.

     APPEND '</body>'                         TO html.

     APPEND '<center>'                        TO html.

     APPEND '<font face="arial" size="100" >' TO html.

     APPEND gv_char                           TO html.

     APPEND '</font>'                         TO html.

     APPEND '</center>'                       TO html.

     APPEND '</html>'                         TO html.

     DATA m_result TYPE i.

     oref->load_data( IMPORTING assigned_url = url

                      CHANGING data_table    = html ).

     oref->show_url( url = url ).

     CALL METHOD oref->do_refresh

     EXCEPTIONS

         cntl_error = 1.

3 REPLIES 3
Read only

Former Member
0 Likes
875

Hi,

You just go through this control example SAPHTML_DEMO1

Read only

0 Likes
875

i used the same method for refreshing but it just doesnt work.

When i first run the program for the first time, it brings the initial value to screen.

But after i enter input, the html page doesnt change. I cleared all of the objects and values but it just doesnt refresh.

Read only

0 Likes
875

Did you use this method CALL METHOD cl_gui_cfw=>dispatch.(Use this method to dispatch application events to the event handlers registered for the events. If you do not call the method within the PAI event of your application program, it is called automatically by the system after the PAI has been processed.)If not try using this method.