myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "H. Swaczinna" <swaczi...@wlp-systems.de>
Subject RE: [Tobago] opening a new broswer and the original IE broswer lost session
Date Tue, 13 Mar 2007 13:45:07 GMT
<head></head><body>Hi Sam,<br><br>seems to me you've taken the
code from a posting I've done some time ago ;-)<br>I'm still using the same code and
it works with the IE. The problem with the session timeout<br>must have an other cause.<br><br>There
exists an alternative approach for PDF download in the Tobago demo. Maybe you<br>can
try this.<br><br>Regards<br>Helmut<br><br><br><table
width="100%"><tbody><tr><td bgcolor="blue" width="5">&nbsp;</td><td>









<p><span></span><span><font face="Arial" size="2">Hi:</font></span></p>

<p><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span></span><span>
<font face="Arial" size="2">I am using</font></span><span></span><span>
<font face="Arial" size="2">the</font></span><span></span><span>
<font face="Arial" size="2">IE</font></span><span></span><span>
<font face="Arial" size="2">browser</font></span><span></span><span><font
face="Arial" size="2">.&nbsp; I create a print button to open a new</font></span><span></span><span>
<font face="Arial" size="2">browser</font></span><span></span><span><font
face="Arial" size="2"></font></span><span></span><span> <font
face="Arial" size="2">to print, then I tried to submit a record form the original</font></span><span></span><span>
<font face="Arial" size="2">browser, but nothing got submitted.&nbsp; When I click
on other tab, I got session timeout.&nbsp; It seems the FaceContext</font></span><span></span><span>
<font face="Arial" size="2">was lost.&nbsp; I would need to refresh the</font></span><span></span><span>
<font face="Arial" size="2">browser in</font></span><span></span><span><font
face="Arial" size="2"> order to get back the FaceContext object back.</font></span><span></span><span><font
face="Arial" size="2"> C</font></span><span></span><span><font
face="Arial" size="2">ould anyone tell me how to</font></span><span></span><span>
<font face="Arial" size="2">open a new</font></span><span></span><span>
<font face="Arial" size="2">browser</font></span><span></span><span><font
face="Arial" size="2"> and the FaceContext will not lost</font></span><span></span><span>
<font face="Arial" size="2">from the original</font></span><span></span><span>
<font face="Arial" size="2">browser</font></span><span></span><span><font
face="Arial" size="2">?&nbsp; Or is this a bug for Tobago?&nbsp; Thanks.</font></span></p>

<p><span></span><span><font face="Arial" size="2">I am using
this</font></span><span></span><span> <font face="Arial"
size="2">suggestion</font></span><span></span><span><font
face="Arial" size="2"> below:</font></span></p>

<p><span></span><span><font face="Courier New" size="2">JSP</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; ...</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; &lt;tc:script
onload="showPrintResult('#{printController.printFile}')"&gt;</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
// Everytime the page is loaded, check for an existing PDF file to display</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
function showPrintResult(url) {</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (url != null &amp;&amp; url != "") {</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
window.open(url, "Print");</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
}</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; &lt;/tc:script&gt;</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; ...</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; &lt;tc:button
label="Print" id="printButton"</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
action="#{printController.printAction}"/&gt;</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; ...</font></span></p>

<p><span><font face="Courier New" size="2">PrintController</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; </font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; public void printAction()
{</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
// Generate PDF file</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
...</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
// Set PDF file</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
printFile = "</font></span><span></span><a href="http://localhost:8080/gena/print/test.pdf%22"><span><u><font
color="#0000ff" face="Courier New" size="2">http://localhost:8080/gena/print/test.pdf"</font></u></span><span></span></a><span><font
face="Courier New" size="2">;;</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; }</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; public String getPrintFile()
{</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
// Return and reset PDF file </font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
String tmp = printFile;</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
printFile = null;</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
return tmp;</font></span></p>

<p><span><font face="Courier New" size="2">&nbsp; }</font></span></p>

<p><span></span><span></span><span></span></p>

<p><span></span><span></span></p>

<p><span></span><span></span><span></span><a
name=""><span><font color="#000000" face="Script MT Bold" size="2">--&gt;
Sam Wong</font></span></a><span></span><span></span><span></span></p>

<p><span></span></p>


</td></tr></tbody></table></body>

Mime
View raw message