Is it what AJAX stands for? :)

i was thinking that ajax is to do things in background, while letting user
see something immediately. And i don't think checkbox falls to area where it
should get response from server to display new state, isn't it?

anyway you can try it yourself and see that it is CHANGED but then restored
back when sending form data.

On Tue, Oct 19, 2010 at 7:52 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Hi, Dmitriy!
>
> Isn't this the natural delay between a request, its processing and the
> reception of the response? In this case, it's not Tapestry itself, it's
> using AJAX.
>
>
> On Tue, 19 Oct 2010 09:24:23 -0200, Dmitriy Vsekhvalnov <
> dvsekhval...@gmail.com> wrote:
>
>   Thiago, is not.
>>
>> Here is the mechanics i debug using fire-bug:
>>  1. checkbox in-browser (which means visible to user) set immediately.
>>  2. usual Tapestry form submission JS loop is started
>>  3. linkZone : function(element, zoneId, url)
>>   {
>>   .....  //until this browser shows modified version of checkbox state
>>    element.sendAjaxRequest(url, {
>>            onSuccess : successHandler
>>    });
>>   ......
>>   is executed and checkbox in-browser state is RESTORED to what was
>> before.
>>
>>  4. when browser got response from server:
>>     linkZone : function(element, zoneId, url) {
>>  ............
>>      var successHandler = function(transport)
>>      {
>>          //after this call form is rendered to new state
>>          zoneManager.processReply(transport.responseJSON);
>>     };
>>     .............
>>  is executed and form is refreshed to new state.
>>
>> So, if there is delay between (3) and (4) - that's a problem.
>>
>> Ideas? It's not my code. It's tapestry.
>>
>>
>> On Tue, Oct 19, 2010 at 2:59 PM, Thiago H. de Paula Figueiredo <
>> thiag...@gmail.com> wrote:
>>
>>  On Tue, 19 Oct 2010 08:24:46 -0200, Dmitriy Vsekhvalnov <
>>> dvsekhval...@gmail.com> wrote:
>>>
>>>  yeah, i've tried this but, the checkbox in-browser state is NOT set
>>> until
>>>
>>>> Zone returned from from handler.
>>>>
>>>>
>>> Make your click handling code set the checkbox immediately then submit
>>> the
>>> form. Most probably the state reset you're experiencing is caused by
>>> submitting the form before the value was set in JavaScript.
>>>
>>> --
>>> Thiago H. de Paula Figueiredo
>>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>>> and instructor
>>> Owner, Ars Machina Tecnologia da Informação Ltda.
>>> http://www.arsmachina.com.br
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
> Coordenador e professor da Especialização em Engenharia de Software com
> Ênfase em Java da Faculdade Pitágoras
>
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to