If you want to launch a modeless dialog from a link, you can do it this way:
<h:outputLink
onclick="window.open('','WindowName','width=700px,height=500px,resizable=true,scrollbars=yes');"
destination="/popup.jsf" targetFrame="name">
</h:outputLink>
To parse the parameters I use the ViewController from shale. I use a non-faces
request because the link is embedded in a tr:form whose target is the current
window.
-----Ursprüngliche Nachricht-----
Von: Renaud Denis [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 17. Januar 2007 11:11
An: [email protected]
Betreff: RE: commandLink open new window
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 ([EMAIL PROTECTED] )
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
[EMAIL PROTECTED]), 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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Matthias Wessendorf
Sent: samedi 13 janvier 2007 13:44
To: [email protected]
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 <[EMAIL PROTECTED]> 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