Question 1: The parenthesis are wrong. The _href attribute is inside I and not A helper. In fact, a parenthesis was missing too. {{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}}
Question 2: If you are getting the following error: non-keyword arg after keyword arg That is because you must always write first the "unnamed" arguments and and the "named" arguments after. 2015-03-19 20:18 GMT-03:00 黄祥 <steve.van.chris...@gmail.com>: > 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 web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Carlos J. Costa Cientista da Computação | BS Computer Science Esp. Gestão em Telecom | PgC Telecom Mangement <º))>< -- 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/d/optout.