On 21/01/13 15:26, Paul Boddie wrote:
On 21/01/13 15:16, Jeremy Goecks wrote:
Adding the attribute
target="_top"
to your URL will load the URL in the main browser window rather than a frame. E.g.
<a href="controller/action" target="_top">Load result in top window</a>
But in the Python code itself? I'm writing an action in the user controller that should redirect to the main page after interacting with the user in the centre frame, and although I can see some JavaScript magic in various template files, along with a refresh_frames parameter, I can't get either trans.response.send_redirect or trans.fill_template to produce something that breaks out of the frameset and refreshes the entire browser window.
Following up to myself with one solution that seemed to work: I defined a template that inherits from "base.mako" and which writes a message for browsers without JavaScript enabled, telling the user to follow a link to the main page in the way suggested above. But in the page's JavaScript I put the following: window.top.location.href = '${h.url_for( "/" )}'; Naturally, the value is translated to the root URL of the application. It feels like a nasty hack, but I suppose that any application using frames is more or less obliged to deploy JavaScript "redirects" of this nature for such operations. Paul