Try:
 
getURL(targetURL, "_blank");

if you want to POST some data to a servlet and receive the response inside a 
new window you could also use the LoadVars class, e.g.

lv = new LoadVars();
lv.myParam = 123;
lv.send(targetURL, "_blank", "POST"); 

Dirk.

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jesus 
Salvador Ramos Cardona
Sent: Monday, August 22, 2005 5:27 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] About downloading files in Flex



We know this, and that's why we are changing the content type of the response, 
so it is able to open a file with a local acrobat reader. This approach has 
served us in the past when we were all servlets and EJBs. We have thoughts 
around using getURL(), but how do we get the response to write to a new window?

 

________________________________

De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] En nombre de Philippe 
Maegerman
Enviado el: Lunes, 22 de Agosto de 2005 10:22 am
Para: flexcoders@yahoogroups.com
Asunto: RE: [flexcoders] About downloading files in Flex
Importancia: Alta

 

You cannot load .pdf files into the flash player, I think you will have to open 
a new window or load it into an iFrame on top of your application à la 
Coenraets ( http://coenraets.com/viewarticle.jsp?articleId=95 )

 

Philippe Maegerman

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jesus 
Salvador Ramos Cardona
Sent: lundi 22 août 2005 16:50
To: flexcoders@yahoogroups.com
Subject: [flexcoders] About downloading files in Flex

Hi all,

 

We have developed a Flex app which is in production now. However, we have a new 
requirement, which asks for the ability to download PDF files. These files are 
reports that are generated dynamically. I have successfully set up the report 
generation, and am using this piece of code in my Delegate (since we are using 
the cairngorm microarchitecture) to make it work:

 

public void printDetalleLineaBancaria(String ticket, Integer 
idDetalleLiquidacion, String status) throws FileNotFoundException, IOException {

        HttpServletResponse response = Gateway.getHttpResponse();

        response.setContentType("application/pdf");

        response.setHeader("Content-Disposition", 
"attachment;filename=\"MyReport.pdf" + "\"");

        byte[] b = generateJasperReport("MyReport");

        response.setContentLength(b.length);

        int offset = 0;

        int numRead = 0;

        while (offset < b.length && (numRead = fis.read(b, offset, b.length - 
offset)) >= 0) {

            offset += numRead;

        }

        fis.close();

        response.getOutputStream().write(b);

    }

 

I am associating this method to a button, gong through all the cairngorm 
components. However, I am not getting any results. The browser's status bar 
indicates it is loading something, then it stops and freezes with "Transferring 
Data from localhost.".

 

Is this the right way to do it? Is the result of my stream going through the 
Flash gateway? What is the best way to satisfy this requirement?

 

Help, please!

 

J.

 

Jesús Ramos Cardona
Desarrollo de Sistemas de Casa de Bolsa

<mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 

+52 (55) 51 74 22 22 ext. 1250

Ixe Grupo Financiero

Este correo electrónico y sus anexos pueden contener información CONFIDENCIAL 
para uso exclusivo de su destinatario. Si ha recibido este correo por error, 
por favor, notifíquelo al remitente y bórrelo de su sistema. Muchas gracias. 
Las opiniones expresadas en este correo son las de su autor y no son 
necesariamente compartidas o apoyadas por la compañía. Ixe Grupo Financiero no 
asume aquí obligaciones ni se responsabiliza del contenido de este correo, a 
menos que dicha información sea confirmada por escrito por un representante 
autorizado. No se garantiza que la transmisión de este correo sea segura o 
libre de errores, podría haber sido viciada, perdida, destruida, haber llegado 
tarde, de forma incompleta o contener VIRUS.

 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 




________________________________

YAHOO! GROUPS LINKS 


        *        Visit your group "flexcoders 
<http://groups.yahoo.com/group/flexcoders> " on the web.
          
*        To unsubscribe from this group, send an email to:
         [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
          
*        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
<http://docs.yahoo.com/info/terms/> . 


________________________________


------------------------------------------------------------------
**STATEMENT OF CONFIDENTIALITY** 

This e-mail and any attached files are confidential and intended solely for the 
use of the individual to whom it is addressed. If you have received this email 
in error please send it back to the person that sent it to you. Any views or 
opinions presented are solely those of author and do not necessarily represent 
those the Emakina Company. Unauthorized publication, use, dissemination, 
forwarding, printing or copying of this email and its associated attachments is 
strictly prohibited.

We also inform you that we have checked that this message does not contain any 
virus but we decline any responsability in case of any damage caused by an a 
non detected virus.
------------------------------------------------------------------



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hasubr1/M=362335.6886445.7839731.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124732915/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/";>In
 low income neighborhoods, 84% do not own computers. At Network for Good, help 
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to