Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Button which doesn't open a new window.
Hi.
I made a portlet which has a button that returns a pdf when it is pressed. The issue is that when the button is pressed, a new window is open, and what I want is opening pdf in the same window.
The button called serveResource function.
Any idea of how can I do this?
Thanks in advance.
Kind regards
Can you post the code that you used to create this button? It might be simpler to point to a single issue rather than come up with a different solution.Daniel G:I made a portlet which has a button that returns a pdf when it is pressed. The issue is that when the button is pressed, a new window is open, and what I want is opening pdf in the same window.The button called serveResource function.
Also, which HTTP-headers do you send back with your PDF?
Note that it might be the browser triggering a new window, rather than your own HTML code.
well, first of all, thanks for your help. I came to copy the code of the button and I realised that it has target="_blank", so I deleted it and it works of course. What a mistake!
thanks again
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™