[web2py] Re: new web2py.js changes the sequence of execution

2013-08-28 Thread Niphlod


On Wednesday, August 28, 2013 10:20:53 PM UTC+2, simon wrote:
>
> I have some very simple jquery scripts for creating dialog boxes. This was 
> all working fine until the replacement of web2py.js in release 5113. 
> However now it no longer works.
>

What commit identifies "release 5113" ?
 

>
> The pre-5113 version had a web2py_ajax_page complete function that first 
> filled my dialog box and then executed response.js in that order.
>
> The new version does these two things asynchronously.  Response.js is 
> executed within event_handler and generally this happens before the 
> ajax_page complete function.
>
 
I'm a little bit baffled. trunk (and up until lots of time ago) 
executes the "response.js" command hooking up on the global ajaxSuccess 
event. 
Can you switch your web2py.js with the one in trunk and try ? if it has the 
same problem, would you move line 268 to after line 274 and see if it fixes 
the problem?
 

> Is there some reason why this was changed or could it be changed back so 
> things happen in the same sequence? This does break backward compatibility.
>
>
No, it doesn't. If you had a fully working app before, you have it also 
right now. If you want to leverage new features with - I assume - the 
newest web2py.js, then theoretically you should adapt accordingly your code.
 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-28 Thread Anthony
Looks like this 
changewas
 actually made in January in response to this 
issue . 
Technically, I suppose it does break backward compatibility because 
previously web2py-component-command (i.e., the content of response.js) was 
executed synchronously after the component content loaded, and now it is 
run asynchronously. Actually, this was probably not a good move, because 
you might need the JS to run after the component content has loaded, so we 
might want to revert this change. The web2py-component-command and 
web2py-component-flash headers were intended for use specifically with 
components. If we want to enable such functionality more generally, perhaps 
we should use alternative headers for that purpose. Please open an issue 
about this and link back to this thread.

Anthony

On Wednesday, August 28, 2013 1:20:53 PM UTC-7, simon wrote:
>
> I have some very simple jquery scripts for creating dialog boxes. This was 
> all working fine until the replacement of web2py.js in release 5113. 
> However now it no longer works.
>
> The pre-5113 version had a web2py_ajax_page complete function that first 
> filled my dialog box and then executed response.js in that order.
>
> The new version does these two things asynchronously.  Response.js is 
> executed within event_handler and generally this happens before the 
> ajax_page complete function.
>
> Is there some reason why this was changed or could it be changed back so 
> things happen in the same sequence? This does break backward compatibility.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-29 Thread Paolo Valleri
Just to understand better what is going on, try to comment line 257 in 
web2py.js 
or even better the whole success block.

Paolo

On Thursday, August 29, 2013 3:42:29 AM UTC+2, Anthony wrote:
>
> Looks like this 
> changewas
>  actually made in January in response to this 
> issue . 
> Technically, I suppose it does break backward compatibility because 
> previously web2py-component-command (i.e., the content of response.js) was 
> executed synchronously after the component content loaded, and now it is 
> run asynchronously. Actually, this was probably not a good move, because 
> you might need the JS to run after the component content has loaded, so we 
> might want to revert this change. The web2py-component-command and 
> web2py-component-flash headers were intended for use specifically with 
> components. If we want to enable such functionality more generally, perhaps 
> we should use alternative headers for that purpose. Please open an issue 
> about this and link back to this thread.
>
> Anthony
>
> On Wednesday, August 28, 2013 1:20:53 PM UTC-7, simon wrote:
>>
>> I have some very simple jquery scripts for creating dialog boxes. This 
>> was all working fine until the replacement of web2py.js in release 5113. 
>> However now it no longer works.
>>
>> The pre-5113 version had a web2py_ajax_page complete function that first 
>> filled my dialog box and then executed response.js in that order.
>>
>> The new version does these two things asynchronously.  Response.js is 
>> executed within event_handler and generally this happens before the 
>> ajax_page complete function.
>>
>> Is there some reason why this was changed or could it be changed back so 
>> things happen in the same sequence? This does break backward compatibility.
>>
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-29 Thread simon
Niphlod - I have tried latest trunk and get same issue. 

Paolo - I tried that but it makes no difference. 

Anthony is correct. The problem is:
 that the  eval(decodeURIComponent(command)) happens in ajax.success then 
the t.html(html);



On Thursday, 29 August 2013 14:54:19 UTC+1, Paolo Valleri wrote:
>
> Just to understand better what is going on, try to comment line 257 in 
> web2py.js 
> or even better the whole success block.
>
> Paolo
>
> On Thursday, August 29, 2013 3:42:29 AM UTC+2, Anthony wrote:
>>
>> Looks like this 
>> changewas
>>  actually made in January in response to this 
>> issue . 
>> Technically, I suppose it does break backward compatibility because 
>> previously web2py-component-command (i.e., the content of response.js) was 
>> executed synchronously after the component content loaded, and now it is 
>> run asynchronously. Actually, this was probably not a good move, because 
>> you might need the JS to run after the component content has loaded, so we 
>> might want to revert this change. The web2py-component-command and 
>> web2py-component-flash headers were intended for use specifically with 
>> components. If we want to enable such functionality more generally, perhaps 
>> we should use alternative headers for that purpose. Please open an issue 
>> about this and link back to this thread.
>>
>> Anthony
>>
>> On Wednesday, August 28, 2013 1:20:53 PM UTC-7, simon wrote:
>>>
>>> I have some very simple jquery scripts for creating dialog boxes. This 
>>> was all working fine until the replacement of web2py.js in release 5113. 
>>> However now it no longer works.
>>>
>>> The pre-5113 version had a web2py_ajax_page complete function that first 
>>> filled my dialog box and then executed response.js in that order.
>>>
>>> The new version does these two things asynchronously.  Response.js is 
>>> executed within event_handler and generally this happens before the 
>>> ajax_page complete function.
>>>
>>> Is there some reason why this was changed or could it be changed back so 
>>> things happen in the same sequence? This does break backward compatibility.
>>>
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-29 Thread simon


New version of web2py.js executes:
   eval(decodeURIComponent(command))in ajax.success
   t.html(html) in ajax.complete
However in the previous version these two commands executed in the reverse 
order.



If I change doc.ajaxSuccess to doc.ajaxComplete then it works.Not sure if 
this breaks something else though!

Have logged as an issue.


On Thursday, 29 August 2013 14:54:19 UTC+1, Paolo Valleri wrote:
>
> Just to understand better what is going on, try to comment line 257 in 
> web2py.js 
> or even better the whole success block.
>
> Paolo
>
> On Thursday, August 29, 2013 3:42:29 AM UTC+2, Anthony wrote:
>>
>> Looks like this 
>> changewas
>>  actually made in January in response to this 
>> issue . 
>> Technically, I suppose it does break backward compatibility because 
>> previously web2py-component-command (i.e., the content of response.js) was 
>> executed synchronously after the component content loaded, and now it is 
>> run asynchronously. Actually, this was probably not a good move, because 
>> you might need the JS to run after the component content has loaded, so we 
>> might want to revert this change. The web2py-component-command and 
>> web2py-component-flash headers were intended for use specifically with 
>> components. If we want to enable such functionality more generally, perhaps 
>> we should use alternative headers for that purpose. Please open an issue 
>> about this and link back to this thread.
>>
>> Anthony
>>
>> On Wednesday, August 28, 2013 1:20:53 PM UTC-7, simon wrote:
>>>
>>> I have some very simple jquery scripts for creating dialog boxes. This 
>>> was all working fine until the replacement of web2py.js in release 5113. 
>>> However now it no longer works.
>>>
>>> The pre-5113 version had a web2py_ajax_page complete function that first 
>>> filled my dialog box and then executed response.js in that order.
>>>
>>> The new version does these two things asynchronously.  Response.js is 
>>> executed within event_handler and generally this happens before the 
>>> ajax_page complete function.
>>>
>>> Is there some reason why this was changed or could it be changed back so 
>>> things happen in the same sequence? This does break backward compatibility.
>>>
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: new web2py.js changes the sequence of execution

2013-08-29 Thread Anthony
We have a somewhat different fix -- should be pushed to trunk shortly. 
Please test it once it's there. Thanks.

Anthony

On Thursday, August 29, 2013 11:46:26 AM UTC-7, simon wrote:
>
> New version of web2py.js executes:
>eval(decodeURIComponent(command))in ajax.success
>t.html(html) in ajax.complete
> However in the previous version these two commands executed in the reverse 
> order.
>
>
>
> If I change doc.ajaxSuccess to doc.ajaxComplete then it works.Not sure if 
> this breaks something else though!
>
> Have logged as an issue.
>
>
> On Thursday, 29 August 2013 14:54:19 UTC+1, Paolo Valleri wrote:
>>
>> Just to understand better what is going on, try to comment line 257 in 
>> web2py.js 
>> or even better the whole success block.
>>
>> Paolo
>>
>> On Thursday, August 29, 2013 3:42:29 AM UTC+2, Anthony wrote:
>>>
>>> Looks like this 
>>> changewas
>>>  actually made in January in response to this 
>>> issue . 
>>> Technically, I suppose it does break backward compatibility because 
>>> previously web2py-component-command (i.e., the content of response.js) was 
>>> executed synchronously after the component content loaded, and now it is 
>>> run asynchronously. Actually, this was probably not a good move, because 
>>> you might need the JS to run after the component content has loaded, so we 
>>> might want to revert this change. The web2py-component-command and 
>>> web2py-component-flash headers were intended for use specifically with 
>>> components. If we want to enable such functionality more generally, perhaps 
>>> we should use alternative headers for that purpose. Please open an issue 
>>> about this and link back to this thread.
>>>
>>> Anthony
>>>
>>> On Wednesday, August 28, 2013 1:20:53 PM UTC-7, simon wrote:

 I have some very simple jquery scripts for creating dialog boxes. This 
 was all working fine until the replacement of web2py.js in release 5113. 
 However now it no longer works.

 The pre-5113 version had a web2py_ajax_page complete function that 
 first filled my dialog box and then executed response.js in that order.

 The new version does these two things asynchronously.  Response.js is 
 executed within event_handler and generally this happens before the 
 ajax_page complete function.

 Is there some reason why this was changed or could it be changed back 
 so things happen in the same sequence? This does break backward 
 compatibility.




-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.