Welcome Guest, Not a member yet? Register   Sign In
OPEN NEW WINDOW FROM CONTROLLER
#1

[eluser]cbaldinu[/eluser]
Hi all.
I have a problem finding a solution to this problem:

I have a page that generates graphics after a request made by the user. The point is that i don't want the graph to be displayed on the same page, but i would like, after have called the controller, open the graph in a new window.

So, the question is: How can i do, if it is possible, to open a new window from a controller?

Thanks in advance.

Cristian Baldinu
#2

[eluser]vitoco[/eluser]
The first thing that you must understand, it's that the controller works on server side, and it will send an output ( html + js + css ) to the client ( browser ).

So, if you wanna open the result in another window, you have 2 options.

1.- add to the link that calls your controller the attr target="blank_"
2.- load a page with javascript code that opens a new window with the url of the graph.

The difference between server and client side it's fundamental, and how this two interacts with each other it's the base of web development.

Slds
#3

[eluser]CroNiX[/eluser]
It would be better to have a link on the page that they could click to view the image, and then have that image pop up in a new window.

Code:
<a href="http://yoursite.com/images/the_image.jpg" target="_blank">View Image</a>

You could also use ajax/javascript to send that link to the browser after their image is "ready" to view, and then they click on it and the new page opens.




Theme © iAndrew 2016 - Forum software by © MyBB