cancel
Showing results for 
Search instead for 
Did you mean: 

How to display a IE page in a view ,not popup ?

Former Member
0 Kudos

Hi! All

Question 1st:

I have create a html page by webdynpro,

I want display this page in a view ,

but when run this code,

the IE page popup ,

can you help me set the IE page in current view ?

public void wdDoInit()
  {
   //@@begin wdDoInit()
   String text = "<html><head></head><body>this is my test</body><html>";

   try
   {	
	
       IWDCachedWebResource resource = WDWebResource.getWebResource
       (
	    text.getBytes("UTF-8"), WDWebResourceType.UNKNOWN
       );

        resource.setResourceName("test.html");
        IWDWindow window = 
wdComponentAPI.getWindowManage().createNonModalExternalWindow(
        resource.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal()),  
        resource.getResourceName());

        window.show();

   }
    catch(Exception ex)
   { 
        wdComponentAPI.getMessageManager().reportException( new WDNonFatalException(ex), false );
   }
    
}

Question 2nd:

I have create a value context attribute under context.

it's name is "mywindow"

it's type is "com.sap.tc.webdynpro.services.session.api.IWDWindow"

Do you know how to display "mywindow" in a view ?

I try to put mywindow in a InputField or a IFrame,

but all failed !

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please add IFrame and pass the url of the html page to that Iframe UI element

This will solve your problem

Regards

Ponnusamy

Former Member
0 Kudos

Hi! Ponnusamy ,

There not have relation between Question 1st and Question 2nd,

due to 2nd ,

wdContext.currentContextElement().setMywindow(window)

I only want know how to display the element what type is IWDWindow .

Thanks

Former Member
0 Kudos

Hi,

This is the code to open up a window

IWDWindow win = wdComponentAPI.getWindowManager().createModalWindow(wdThis.wdGetAPI().getComponentInfo().findInWindows(<window_name>));

wdContext.currentContextElement().set<window_context>(win);

win.setWindowPosition(WDWindowPos.CENTER);

win.setWindowSize(250,150);

win.setTitle("New Window");

win.show();

This will open up as a pop-up. If you want to open a html page on the same window then put an iframe in your view and set its source property correspondingly.

Regards,

Murtuza

Former Member
0 Kudos

HI! Murtuza,

when I use your code,

1. getComponentInfo() have a redline under it, the message is

"The method getComponentInfo is undefined for thee type IWDviewController"

I can't solve by use click mouse right to improt.

2. when I put an iframe in my view and set its source as my comtext "mywindow",

"mywindow " type is

"com.sap.tc.webdynpro.services.session.api.IWDWindow",

I want select "mywindow" as source , but "mywindow" is no activate, can't select,

Thanks!