hi,
i have several vars that store : view (grid or list), sort (a_z, z_a,
highest_price, lowest_price, newest), search_product, category_product
(drop down list IS_IN_DB() ) and product_brand (drop down list IS_IN_DB() )
search_product, category_product (drop down list IS_IN_DB() ) and
product_brand (drop down list IS_IN_DB() ) is on the other file (sidebar)
*question 1 :*
*works well*
{{if page:}}
{{=SPAN(A(T('Previous'),
_href = URL(*vars = dict(request.vars, page = [page - 1]*) ) ) ) }}
{{elif len(rows) > items_per_page:}}
{{=SPAN(A(T('Next'),
_href = URL(*vars = dict(request.vars, page = [page + 1]*) ) ) ) }}
{{pass}}
*no errors occured but the result is not expected*
{{if page:}}
* {{request.vars.page = [page - 1] }}*
{{=SPAN(A(I(T('Previous'),
_href = URL(*vars = request.vars* ) ) ) }}
{{elif len(rows) > items_per_page:}}
* {{request.vars.page = [page + 1] }}*
{{=SPAN(A(T('Next'),
_href = URL(*vars = request.vars* ) ) ) }}
{{pass}}
why the result is not expected, when i have multiple vars in 1 page (the
page vars value is not store in vars)?
*question 2 :*
*works well*
{{if page:}}
{{=SPAN(A(T('Previous'),
_href = URL(vars = dict(*request.vars, page = [page - 1]*) ) ) ) }}
{{elif len(rows) > items_per_page:}}
{{=SPAN(A(T('Next'),
_href = URL(vars = dict(*request.vars, page = [page + 1]*) ) ) ) }}
{{pass}}
*an error occured*
{{if page:}}
{{=SPAN(A(T('Previous'),
_href = URL(vars = dict(*page = [page - 1], request.vars*) ) ) ) }}
{{elif len(rows) > items_per_page:}}
{{=SPAN(A(T('Next'),
_href = URL(vars = dict(*page = [page + 1], request.vars*) ) ) ) }}
{{pass}}
my 2nd question is why if i assign the var page first it return an error?
thanks and best regards,
stifan
--
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.