Thank you for your additionals hints. This is the last version of my
program, it does not use vars.records and it is very simple.
def test1():
form = SQLFORM.grid(db.tt,
selectable=test2,
)
form.elements('table')[0].append(INPUT(_type='text', _name='f'))
return dict(form=form)
def test2(ids):
raise HTTP(401, "f=%s, ids=%s" % (request.vars.f, ids))
2017-12-14 12:53 GMT+01:00 Anthony <[email protected]>:
> On Thursday, December 14, 2017 at 2:21:20 AM UTC-5, mweissen wrote:
>>
>> Hi Anthony!
>>
>> You have written:
>>
>> Not sure what you mean. When I try it, I get the expected list of record
>> IDs in request.vars.records as well as the value of "f" in request.vars.f.
>> The list in *request.vars.records* is ultimately passed to the
>> "selectable" function, after which, the redirect happens. Can you explain
>> exactly what you are doing, what you expect, and what you see instead?
>>
>>
>> The important part is "*in request.vars.records*". Yes - there are
>> the expected values. Maybe this information ("vars.records") in somewhere
>> in the book or in the source text - but I did not find it. Again:
>> request.vars.records solves the problem - I think, this information is
>> worth to be mentioned in the book!
>>
>
> request.vars.records is an implementation detail, not part of the public
> API. My point above was that SQLFORM.grid receives the values in
> request.vars.records as usual and processes the IDs as expected.
> Separately, your own code can access the value in request.vars.f. So, it
> was not clear what you meant that you could only access request.vars.f if
> you "do not use the 'selectable' values". Your second solution (involving
> the manual redirect to a second action) appears to be unnecessary.
>
> Anthony
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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/d/optout.
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/d/optout.