The grid makes use of URL args, so if the base URL of the grid action also 
includes args, you must tell the grid to preserve those extra-grid args via 
its "args" argument:

form = SQLFORM.grid(db.address.client == itemid, args=request.args[:1])

Anthony

On Sunday, December 14, 2014 2:54:06 PM UTC-5, clara wrote:
>
> Hello,
>
> I would like to see an example of a component with an argument. I tried it 
> with no luck, If I define the component without arguments it works fine but 
> if I add an argument loading the page that has the component leads to some 
> kind of infinite recursion. Any help on this would be appreciated. To be 
> more explicit:
>
> in the controller: 
> @auth.requires_login()
> def component_action():
>     itemid = request.args(0)
>     form = SQLFORM.grid(db.address.client==itemid)
>     return dict(form=form)
>
> in views:
> I create a "component_action.load":
>
> <div class="manage_things2">
> {{=form}}
> </div>
>
> I use the component in another action adding to the action's HTML:
> {{=LOAD('default','component_action.load',args=2, ajax=True)}}
>
> Is there anything awefully wrong in this?
>
> I will appreciate your help. Thanks!
>
> Clara
>
>
>

-- 
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.

Reply via email to