incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Renaud Denis" <Renaud.De...@bsb.com>
Subject RE: commandLink open new window
Date Wed, 17 Jan 2007 10:11:25 GMT
A question in the same context;

What if I want to generate a non-faces response from a faces request?

For example, showing a PDF file in a new window via a classic
<commandLink />

--- Backing bean method

	public void download(ActionEvent event) {
		HttpServletResponse response = (HttpServletResponse)
getExternalContext().getResponse();
		response.setContentType(this.getContentType());
		response.setBufferSize(this.getSize());
		
		try {
			ServletOutputStream ostream =
response.getOutputStream();
			byte[] content = this.getContent();
			ostream.write(content);
			ostream.flush();
			
			// Indicate to JSF Framework that the response
has already been completed
			// And it must skip the render response phase of
the JSF lifecycle.
			getFacesContext().responseComplete();
		} catch (IOException e) {
			error("Download failed because of an I/O
exception [" + e.getMessage() + "]");
		}
	}
---

--------------------------------------------------------

Renaud Denis (Renaud.Denis@bsb.com )
Consultant

 
BSB Belgium (www.bsb.com) 
Avenue Athena 2 - B-1348 Louvain-la-Neuve
T:+32 (0)10 48 79 63 - F:+32 (0)10 48 34 99
--------------------------------------------------------



BUSINESS SOLUTIONS BUILDERS DISCLAIMER
This e-mail message and any attachments are intended exclusively for the addressee(s) and
may contain information which is confidential and/or protected by intellectual property rights.
If you receive this e-mail by mistake, please notify immediately the sender, or Business Solutions
Builders (by e-mail at disclaimer@bsb.com), and delete the message and any attachments without
printing, copying or opening it. Any disclosure, reproduction, distribution or use of this
message or any attachments, by persons other than the designed addressee(s), is strictly prohibited.
E-mail transmission and Internet use cannot be guaranteed to be secure. Business Solutions
Builders and its subsidiaries cannot be held responsible for any loss, delay or damage arising
from their use.
--------------------------------------------------------

-----Original Message-----


From: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] On Behalf Of
Matthias Wessendorf
Sent: samedi 13 janvier 2007 13:44
To: adffaces-user@incubator.apache.org
Subject: Re: commandLink open new window

useWindow="true"

outcome returns something like dialog:edit

  <navigation-rule>
    <from-view-id>/all.xhtml</from-view-id>
    <navigation-case>
      <from-outcome>dialog:edit</from-outcome>
      <to-view-id>/edit1.xhtml</to-view-id>
    </navigation-case>
  </navigation-rule>

-Matthias

On 1/12/07, Sabina Albu <sabina.albu@gmail.com> wrote:
> Hi,
> I'm trying to open a new window using:
>
>
> <tr:commandLink action="#{backingBean.performOpenWindow}"
> target="_blank" text="Open new window" useWindow="false"
> windowWidth="800" windowHeight="500"></tr:commandLink>
>
> in my backing bean:
> public String performOpenWindow(){
>  ...
>  return "summaryView";
> }
>
> In my navigate.xml
> <navigation-case>
>             <from-outcome>summaryView</from-outcome>
>             <to-view-id>/pages/SummaryView.xhtml</to-view-id>
>             <redirect/>
> </navigation-case>
>
> Can someone point me to the right direction here.
>
> regards,
> Sabina
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Mime
View raw message