You can't pass arguments to exposed functions. Use the method(s) I
outlined instead:
def timer_tick():
    if request.vars.my_var_passed_in_data:
        ....

I can be more specific if you tell me what you are trying to pass to
timer_tick.

On Sep 1, 8:57 am, Francisco Costa <m...@franciscocosta.com> wrote:
> But i want to pass a value to the function timer_tick
> something like this
>
>     callback = js.call_function(timer_tick(arg))
>
> but the function
>     def timer_tick(arg):
>
> doesn't load properly
>
> On Sep 1, 2:02 pm, "mr.freeze" <nat...@freezable.com> wrote:
>
> > If you're talking about the Client Tools module located 
> > here...http://www.web2pyslices.com/main/slices/take_slice/8
> > ...there is an 'data' parameter in event.listen that you can use. It
> > can be a jQuery selector (default is 'form:first') and will show up in
> > request.vars. If you don't need to grab the value of an element, then
> > you can use the 'args' parameter and it will show up in request.args.
>
> > On Sep 1, 6:44 am, Francisco Costa <m...@franciscocosta.com> wrote:
>
> > > i have this autorefresh
>
> > >     form = SQLFORM.factory(Field('AutoUpdates',
> > > requires=IS_IN_SET(['On','Off']),default="On",
> > > widget=SQLFORM.widgets.radio.widget))
> > >     refresh.ready(jq("input[type='submit']").hide()())
> > >     callback = js.call_function(timer_tick)
> > >     refresh.ready(js.timer(callback,10000))
> > >     event.listen('change',"input[name='timer']",timer_tick)
>
> > > the thing is i want to call the function timer_tick with an argument
> > > and the use it like this
>
> > >     def timer_tick(arg):
> > >         arg_passed=arg
>
> > > How I do the js.call_function() and the event.listen()  ?
>
>

Reply via email to