Hi Anthony,
I am able to reproduce this problem in a small app (tested on windows -
2.9.5).
*MODEL:*
db.define_table('Category',
Field('Name'),
Field('SubCategoryName'))
# Insert test data
if db(db.Category.id>0).count() == 0:
db.Category.insert(Name='PC',SubCategoryName='Intel')
db.Category.insert(Name='PC',SubCategoryName='AMD')
db.Category.insert(Name='SmartPhone',SubCategoryName='Apple')
db.Category.insert(Name='SmartPhone',SubCategoryName='HTC')
db.Category.insert(Name='SmartPhone',SubCategoryName='Google')
*CONTROLLER:*
def index():
response.flash = T("Welcome to web2py!")
return dict(message=T('Hello World'))
def results():
if (request.vars.testval and session.var1):
try:
del session.var1
except Exception : pass
if (request.vars.var1) and (not session.var1):
session.var1 = request.vars.var1
grid = {}
if session.var1:
query = (db.Category.Name==session.var1)
grid = SQLFORM.grid(query=query)
return dict(grid=grid)
*VIEWS:*
*results.html*
{{extend 'layout.html'}}
{{=grid}}
*index.html*
{{extend 'layout.html'}}
<form enctype="multipart/form-data" method="post"
action={{=URL('default','results')}} >
<select name="var1">
<option value="PC">PC</option>
<option value="SmartPhone">Smart Phone</option>
</select>
<input type="submit" value='Submit'>
<input type="hidden" name="testval" value="test" />
</form>
*Steps to reproduce the problem :-*
1. Select any value from the drop down and hit submit button.
2. Select any GRID row and click on View
3. Use Browser Back button -> Document will expire, you have to refresh to
get the results back (Tried on Chrome/Firefox)
4. Repeat Step2
5. Now instead of using Browser back button, use GRID embedded back button.
6. Now repeating step 2-3 won't cause any problem (document won't expire)
until the new selection is made from the selection drop down.
Please suggest something to resolve this problem.
Thanks
Sarbjit
--
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.