on 01-31-2008 10:04 AM
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
Hi,
IWDWindow win = wdComponentAPI.getWindowManager().createExternalWindow(getPrintWindowURL(), "Print", false);
win.show(); is missing
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanky u very much
I will try it
Rgds
sas
Edited by: erdem sas on Jan 31, 2008 11:25 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.