Is this an ajax component? In that case, all the LOAD helper is doing is
setting up the JS code to make an ajax GET request to the component's URL,
so you can't easily pass large amounts of data to the component function.
If you only need the results of the query within the component, you might
be better off doing the query in the component function (i.e., f1() in your
example). Otherwise, maybe cache the results of the query and have the
component function pull it out of the cache (or put it in the session if
the results are unique per user).
Anthony
On Monday, February 13, 2012 11:17:50 PM UTC-5, weheh wrote:
>
> What, if any, is the proper syntax for passing a db storage object to
> a component?
>
> In other words:
>
> # controller
> def index():
> query=...
> return dict(data=db(query).select())
>
> # view
> ...
> {{=LOAD('c1','f1')}}
>
> So where in the LOAD statement can I pass in data as a db Storage or
> must it be a dict?
>