This content has been marked as final.
Show 2 replies
-
1. Re: New window and naviagtion from s:link
danielrowe Aug 19, 2010 11:44 AM (in response to fjkjava.febinjk.gmail.com)You might try opening the new PDF window with a javascript function invoked by using "onclick" in the s:link, and then doing normal navigation from the s:link to get to your new page.
Something like this:
|<s:lin|k value="Show PDF" onclick="startPDF(#{pdf.id}); return true" action="some_action_that_take_you_to_new_page"/>
Depending on how you can access your pdf, you may have to use some Seam remoting (or maybe you can do it more simply in a single javascript function -- I'm not sure). Here is the remoting way I've used for something similar:
<s:remote include="PDFManager"/>
<script>
<!--
function startPDF(pdfId){
var pdfManager = Seam.Component.getInstance("PDFManager");
pdfManager.setPDF(pdfId,popupPDFWindow);
}
function popupPDFWindow(){
var cmd = '/gbmdrc/pdfWindow.seam';
window.open(cmd,'PDF','toolbar=0,modal=1,dialog=1,scrollbars=1,alwaysRaised=1,width=840,height=480,resizable=1');
}
// -->
</script>
In your manager bean:
public void setPDF(Long pdfId) {
// Do something in here to allow pdfWindow.xhtml to get at the rendered ||PDF file
}
Hope this helps! -
2. Re: New window and naviagtion from s:link
fjkjava.febinjk.gmail.com Aug 20, 2010 12:32 PM (in response to fjkjava.febinjk.gmail.com)Thank you Daniel Rowe