cancel
Showing results for 
Search instead for 
Did you mean: 

no window appears

Former Member
0 Kudos

Hi!

Can some tell me whats wrong here. I don' t get

any window by click on button. Thank you for your efforts in advance!

Regards

Sas Erdem

Pls notice I didn't use arrow bracket at html and java script commands intentionally else

it was not possible to insert the code here.

public void onActionClick(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActiondrucken(ServerEvent)

IWDWindow win = wdComponentAPI.getWindowManager().createExternalWindow(getPrintWindowURL(), "Print", false);

//@@end

}

public java.lang.String getPrintWindowURL( )

{

//@@begin getPrintWindowURL()

StringBuffer x = new StringBuffer();

x.append("html head script");

x.append("opener.print();");

x.append("scripthead");

x.append("bodyPrinting...hrCLOSEbody");

x.append("html");

String linktoFile = "";

try {

byte[] b = null;

b = x.toString().getBytes("UTF-8");

IWDCachedWebResource htmlFile = WDWebResource.getWebResource(b, WDWebResourceType.HTML);

htmlFile.setResourceName("Print.htm");

linktoFile = htmlFile.getURL();

} catch (UnsupportedEncodingException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (WDURLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

return linktoFile;

//@@end

}

Regards

sas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

IWDWindow win = wdComponentAPI.getWindowManager().createExternalWindow(getPrintWindowURL(), "Print", false);

win.show(); is missing

Regards

Ayyapparaj

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

One point in above code is dat the code is deprecated. Though the code might work fine, but it should be avoided as a good practice. Hence i would suggest u to try this piece of code:

IWDWindow window1 = wdComponentAPI.getWindowManager().createNonModalExternalWindow(getPrintWindowURL( )

, "Print Window");

window1 .show();

Hope this vil be more useful to u. And hence u vil get rid of Deprecated Ones

Regards,

Kunal Kotak.

Edited by: kunal kotak on Jan 31, 2008 4:26 PM

Former Member
0 Kudos

thanky u very much

I will try it

Rgds

sas

Edited by: erdem sas on Jan 31, 2008 11:25 AM