No one have any idea? On Friday, November 1, 2013 4:03:49 PM UTC-5, LaDarrius Stewart wrote: > > def index(): > form=FORM(TABLE(TR("Last > Name:",INPUT(_type="text",_name="lname",requires=IS_LENGTH(minsize=3))), > TR("",INPUT(_type="submit",_value="SUBMIT")))) > message = " " > grid = None > fields = [db.Member.FIRST_NAME, db.Member.LAST_NAME] > > default_sort_order=[db.Member.FIRST_NAME] > headers = {'Member.LAST_NAME_MIXED': 'ID' } > form2=FORM(TABLE(TR("Last > Name:",INPUT(_type="text",_name="conname",requires=IS_LENGTH(minsize=3))), > TR("",INPUT(_type="submit",_value="SUBMIT")))) > if form.process(session=None, formname='form', > keepvalues=True).accepted: > response.flash="form accepted" > rows3 = ((db.Member.LAST_NAME_MIXED.like(form.vars.lname + '%'))) > jam=rows3 > grid = SQLFORM.grid(rows3, fields=fields, headers=headers, > buttons_placement = 'left', links_placement = 'left') > > elif form.errors: > response.flash="form is invalid" > else: > response.flash="Form incomplete" > table = request.args(0) > default_sort_order=[db.Member.FIRST_NAME] > if form2.process(session=None, formname='form2').accepted: > response.flash='form accepted' > rows = db((db.Employer.EMPLOYER_NAME.like(form2.vars.conname + > '%'))).select() > elif form2.errors: > response.flash='form is invalid' > else: > response.flash='form incomplete' > > return dict(form=form, message=message, rows=rows, form2=form2, > grid=grid) > > This is my current code if I enter a name into my form I get back the > correct table thats all dandy. But when I click "view" it loses the > "session" I would say because if I put my rows3 and grid outside of the if > statement and define something lets say rows3 = > ((db.Member.LAST_NAME_MIXED.like('Fitz%'))) Im able to hit view and see > columns and there data. But I need the functionality of being able to > search but if its inside the if statement when i press View from the > SQLFORM.grid it doesnt keep the related field. I take the reasoning is > because inside the code prior to the return is grid= None. If you need > further explanation let me know that might sound confusing because im > becoming frustrated lol. >
-- 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.