My web2py experience is limited, but it seems you're losing your 
form.vars.lname variable when you navigate to the next page. You'll need to 
assign it to a request.vars, session, or some other persistent variable and 
then use that to build your query instead of form.vars.lname. 


On Tuesday, December 31, 2013 12:34:06 PM UTC-6, Keith Planer wrote:
>
> def patient_lookup():
>     db.consumer.id.readable=False
>     var = request.args(0)
>     grid = []
>     links=[lambda row: A('Note',_href=URL('default', 'notes',args=[row.id
> ])),
>            lambda row: A('Diagnosis',_href=URL('default', 
> 'diagnosis_lookup',args=[row.id])),
>            lambda row: A('Orders',_href=URL('default', 'phys_order',args=[
> row.id]))]
>     form = FORM("Last Name: ",INPUT(_name='lname'),INPUT(_type='submit'))
>     if form.accepts(request.vars, session):
>         query=(db.consumer.lname.like(form.vars.lname+'%'))
>         grid=SQLFORM.grid(query, deletable=False,  searchable=False,create
> =False, csv=False, paginate=5, links=links, user_signature=True, headers={
> '...'})
> return dict(form=form, grid=grid)
>
>
>
>
> The behavior its showing is that when I hit submit, it'll bring back the 
> first page of records, When I hit the link for another page, the grid will 
> just show the [] that I have on the 4th line. I would get rid of it but the 
> page breaks without it.When I hit the submit button again, the grid will 
> show the page that I wanted to see before. I hit the link for another page 
> and just "[]" again. And so on....
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to