Skip to Content
author's profile photo Former Member
Former Member

no window appears

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 10:06 AM

    Hi,

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

    win.show(); is missing

    Regards

    Ayyapparaj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 10:24 AM

    thanky u very much

    I will try it

    Rgds

    sas

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 10:55 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.