12-11-2006 6:40 AM
Hi.
How to force CL_GUI_HTML_VIEWER to open links always in own window GUI.
Including links javascripts
12-11-2006 6:56 AM
<i>always in own window GUI.</i>
you mean within the same control? if yes you should avoid adding target attribute in the links.
Regards
Raja
12-11-2006 8:48 AM
>you mean within the same control?
yes
Itself HTML the page is created not by me and I cannot change it
12-11-2006 10:10 AM
12-11-2006 11:54 AM
For example program SAPHTML_DEMO1.
The following link-
<a href = " javascript:open_card (' card.aspx? ID =09013c72800e2dec ') ">sss</a>
javascript code
function open_card( strField )
{
window.open(strField, "","location=0,directories=0,toolbar=0,menubar=0,resizable=yes,height=400,width=400,top=50,left=50");
}
Opens a new window from window GUI - in IExlorer
How to make, that the link opened in same window GUI
12-11-2006 12:09 PM
do the following change. (bold)
window.open(strField, <b>'_self'</b>,"location=0,directories
Regards
Raja
12-11-2006 12:20 PM
Thanks )))
But as I already spoke, corrects a code of a HTML-page I cannot.
He is on an external site.
I only can correct an ABAP-code of the program.
12-11-2006 12:30 PM
i mentioned that before. if its external site then , you dont have control over it. you cannot do anything.
Regards
Raja
12-12-2006 3:40 AM
Whether it is possible to intercept links, for the analysis and redefinition?
Message was edited by:
Sergey Petrov
12-12-2006 6:25 AM
not really intercept. but what you could do is make your ABAP program to act as HTTP client (using cl_http_client class) and read the contents of the page and search for these links, modfy them and show the modified contet (which is your own html) - but this will cause other problems if there are relative links in that page (i am sure it will certainly have), and there are lot of other issues involved with that.
So the only option out to just live with this.
Regards
Raja
01-31-2008 9:59 AM
Please check SAP Note 856741.
After creating the HTML Viewer control, call the method ENABLE_SIMPLEBROWSING as follows:
CALL METHOD html_control->ENABLE_SIMPLEBROWSING
EXPORTING
benable = 1.
Now the links will open in the same SAP GUI session.