-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
i want to show the content of my file in a new browser window. it works fine with firefox but ie8 does not open a new window it use the current. but i want to show the content in a new window.
please tell me how to do this
String letter = getLetter(); Filedownload.save(letter, "html", "letter.html");
it seems that's a browser default behavior.
Hi moloch,
maybe we look for the same solutution, see http://www.zkoss.org/forum/listComment/14410
@moloch: what about to change the security in IE8? Otherwise you can try a workaround: make a HTML link
<a href="showit.zul" target="_blank"/>Show it</a>
Filedownload.save(letter, "html", "letter.html");
hi, thanks for your answer.
should i open a new page with a button click? with your link it will work but i don t want a link i still want a button maybe i should open a new page with any method?
than i would do your workaround...
1. i open a new zul page in a new browser window
2. in the composer of the new zul page i will call filedownload.save
right?
greets
No, it won't work. The problem is in the IE security settings. By default, it requires a user to confirm a save dialogue opened by JavaScript only. If you open a new window by a click to the link, then it should work. Now I think even my advice is not good, I guess the ZUL cannot be used for this (maybe it can, I have not tried). I think the safe way is to make a "dowload servlet" and serve the content directly. Something like
<a href="/downloadservlet" target="_blank"/>Show it</a>
I am not sure if IE allows you to open a new window by JavaScript only (by a button), you can try it like (JavaScript ):
window.open(url, name, windowFeatures);
Or just simply change the security settings of IE, if you can.
Asked: 2010-11-11 09:10:36 +0800
Seen: 1,030 times
Last updated: Jan 25 '11