ajax_trap is ignored and assumed to be True if ajax=True.

Earlier tests with orther versions had a different behavior and I conceived
ajax_trap=False as a kind of two purposes option. On one hand when
ajax=False it could be use to keep the next form into ajax... And when
ajax=True it works as a mean to stop trapping the next form into ajax.

I would like to have the validator trapped but not the next form... It was
working like that before but not anymore...

Richard

On Wed, Jun 29, 2011 at 3:55 PM, Richard Vézina <ml.richard.vez...@gmail.com
> wrote:

> I don't understand that from the book :
>
> ajax_trap=True means that any form submission in the DIV must be captured
> and submitted via Ajax, and the response must be rendered inside the DIV.
> ajax_trap=False indicates that forms must be submitted normally, thus
> reloading the entire page. ajax_trap is ignored and assumed to be True if
> ajax=True.
>
> Let me explain a bit my problem :
>
> I use jQuery UI Tabs with a component into a couples of tabs and I manage
> those component with a unique function since the differents form-table
> passed like this crud.create(request.args(0)...
>
> So I redirect if form submit like this :
>
> if form.accepts(request.vars, session):
>         session.flash = T('form accepted')
>         request.extension = None
>         if table == 'ref_fnaregistry':
>             #redirect(URL(request.application,c='default',f='index.html'))
>             redirect(URL(request.application,c='ref',
> f='creation.html',args=1))
>         elif table == 'ref_vregistry':
>             redirect(URL(request.application,c='ref',
> f='creation.html',args=2))
>         elif table == 'ref_tregistry':
>             redirect(URL(request.application,c='ref',
> f='creation.html',args=3))
>
>
> But the URL in the nav url box not change that let me think that the
> redirection is trap into ajax... Then there is a other sign with the
> calendar that show up but not return any date on clic...
>
> If I redirect on :
> redirect(URL(request.application,c='default',f='index.html')) I get the
> whole site into my first tab...
>
> Richard
>
> On Wed, Jun 29, 2011 at 3:38 PM, Anthony <abasta...@gmail.com> wrote:
>
>> On Wednesday, June 29, 2011 3:29:33 PM UTC-4, Richard wrote:
>>>
>>> Could it be possible that my compoenent ajax_trap=False option is not
>>> considering??
>>
>>
>> ajax_trap isn't related to redirects -- it only applies when ajax=False --
>> in that case, when ajax_trap=True, it tells web2py to trap form submissions
>> in the component and post them to the component's action rather than to the
>> parent page's action
>>
>> Anthony
>>
>
>

Reply via email to