I tried your suggestion below.  It works only first print.  If I reprint
it again, the session got lost again. Thanks.

 

________________________________

From: madan chowdary [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 9:16 AM
To: MyFaces Discussion
Subject: Re: [Tobago] opening a new broswer and the original IE broswer
lost session

 

Hi Wong , 

think i faced the same problem but haven't raised that in the groups.

I tried as such and thats working fine.

<f:verbatim>
    <a href="#" onclick="openPdfPopup()" class="popupLink">Export to
PDF</a>
</f:verbatim>

<f:verbatim>
            <script type="text/javascript">
                function openPdfPopup(){
                    window.open('pdf/pdfOrder.jsp', 'PDF',
'menubar=no,status=no,toolbar=no,left=0,top=0,fullscreen=yes,resizable=y
es');
                }                            
    </script>
</f:verbatim>

in pdfOrder.jsp, i used the bean refernce to generate the PDF doc.

Hope this would help u ..

Regards,
Madan

----- Original Message ----
From: "Wong, Emmanuel (Sam)" <[EMAIL PROTECTED]>
To: MyFaces Discussion <[email protected]>
Sent: Tuesday, 13 March, 2007 6:24:36 PM
Subject: [Tobago] opening a new broswer and the original IE broswer lost
session

Hi:

        I am using the IE browser.  I create a print button to open a
new browser to print, then I tried to submit a record form the original
browser, but nothing got submitted.  When I click on other tab, I got
session timeout.  It seems the FaceContext was lost.  I would need to
refresh the browser in order to get back the FaceContext object back.
Could anyone tell me how to open a new browser and the FaceContext will
not lost from the original browser?  Or is this a bug for Tobago?
Thanks.

I am using this suggestion below:

JSP

  ...

  <tc:script onload="showPrintResult('#{printController.printFile}')">

    // Everytime the page is loaded, check for an existing PDF file to
display

    function showPrintResult(url) {

      if (url != null && url != "") {

        window.open(url, "Print");

      }

    }

  </tc:script>

  ...

  <tc:button label="Print" id="printButton"

    action="#{printController.printAction}"/>

  ...

PrintController

  

  public void printAction() {

    // Generate PDF file

    ...

    // Set PDF file

    printFile = "http://localhost:8080/gena/print/test.pdf";
<http://localhost:8080/gena/print/test.pdf%22> ;;

  }

  public String getPrintFile() {

    // Return and reset PDF file 

    String tmp = printFile;

    printFile = null;

    return tmp;

  }

--> Sam Wong

 

 

________________________________

Here's a new way to find what you're looking for - Yahoo! Answers
<http://us.rd.yahoo.com/mail/in/yanswers/*http:/in.answers.yahoo.com/>  

Reply via email to