The grid creates the back button links based on the URL of the grid action
itself, but it stores the referrer URL in
session._web2py_grid_referrer_web2py_grid (if you use a custom formname for
the grid, that last "web2py_grid" is replaced with the formname). So, in
your grid action, before creating the grid, you could do:
session._web2py_grid_referrer_web2py_grid = [some alternate URL]
grid = SQLFORM.grid(...)
Anthony
On Saturday, July 6, 2013 10:43:21 AM UTC-4, Jason Hinds wrote:
>
> I am new to web2py so what I am seeing is probably the result of going
> about this the wrong way.
>
> What I am trying to do is have a link from the main page directly to the
> create action of a sqlform grid - basically just a shortcut that a user can
> use when they know they need to create a record.
>
> So in the view (index):
> {{=A('Add Device',_href='../default/add_device')}}
>
> In the controller:
> @auth.requires_login()
> def add_device():
> redirect(URL('manage_device/device/new/device',user_signature=True))
>
> This does do what I wanted it to do (right or wrong), however the issue I
> am running into is the back link (back arrow button) that is part of the
> generated form does not point to the page I just came from (index), but
> rather to the last form that I used. Hopefully that makes sense.
>
> I appreciate any advice. Thanks.
>
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.