If I remember, you need ajax true for ajaxtrap to works... Both parameters
are not working independently... On old web2py version it append to me that
both were having different behavior depending if ajax = true or false, but
now it seems that ajaxtrap only trigger on when you have ajax = true.

It's not correctly decomented in the book I think or it confusing I had hard
time last time I try to make work my component correctly.

Richard

On Sat, Sep 24, 2011 at 3:08 PM, apple <simo...@gmail.com> wrote:

> When call singleview and submit the form it should print singleview,
> edit, edit. However it prints singleview, edit, singleview, edit. Why
> is the submit not trapped and sent via ajax to the edit controller?
>
> controller.....
>
> def edit():
>    print("edit")
>    table=db["customer"]
>    form=SQLFORM(table,1)
>    return dict(form=XML(form))
>
> def singleview():
>    print("singleview")
>    return dict()
> *************************
> edit.load...
>
> {{=form}}
> ****************************
> singleview....
>
> {{extend 'layout.html'}}
> {{=LOAD(f='edit.load', ajax=False, ajaxTrap=True)}}
>

Reply via email to