These differences between the old and the new compileapp.py are making the 
difference between working and not working:
173,178c174,177
<             statement = "web2py_component('%s','%s');" % (url, target)
<         script = SCRIPT(statement, _type="text/javascript")
<         if not content is None:
<             return TAG[''](script, DIV(content, **attr))
<         else:
<             return TAG[''](script)
---
>             statement = "$.web2py.component('%s','%s');" % (url, target)
>         attr['_data-w2p_remote'] = url
>         if not target is None:
>             return DIV(content, **attr)


the new code returns the DIV with the attr "data-w2p_remote"=url. this 
generates such div: 
<div id="Workspace" 
data-w2p_remote="/sipadm/registration/getForm.load/1/1/1/save?c_id=114999&amp;c_type_id=10&amp;city=Fribourg&amp;clwarn=&amp;comments=&amp;company=&amp;countrycode=ch&amp;creditlimit=0.00001&amp;firstname=Alessia&amp;i_account=0&amp;i_customer=0&amp;i_product=9&amp;isAccountReg=value&amp;langcode=fr&amp;&amp;login=41325102428&amp;mobile=&amp;nzip=1700&amp;o_billing_date=&amp;o_id=131643&amp;o_verify_date=&amp;pa_id=1&amp;phone=021+905+41+11&amp;salut=Madame&amp;sip_id=24141&amp;status_id=0">loading...</div>


it seems the data-w2p_remote isn't loaded by a javascript sometimes. i 
tried to reproduce it and found out, that a LOAD inside an ajax call 
doesn't work anymore... 

I made a few small test functions in the default controller: 
Default Controller:
def test():
    return dict()

def test2():
    ret = DIV(XML("test2 <br>"))
    ret.append(LOAD(f='test3', ajax=True))
    return ret

def test3():
    ret = DIV(XML("test3 <br>"))
    return ret

View default/test.html:
{{extend 'layout.html'}}
test1
<div id='test'><button 
onclick="ajax('{{=URL(f='test2')}}',0,'test')">test</button></div>


When you click on the button, you get the page "test2". But the load in 
test2 ends with this div:
<div id="c270315183709" data-w2p_remote="/sipadm/test3">loading...</div>


This scenario works in web2py 2.5.1... I tried the test functions in 
version 2.7.2 and 2.5.1. In 2.5.1 this code works and in 2.7.2 it doesn't 
work anymore...


Have you any idea, how to fix this properly? 


Am Freitag, 11. Oktober 2013 08:55:19 UTC+2 schrieb Michael Helbling:
>
>
> yes, jquery.js and web2py.js are configured in web2py_ajax.html and 
> jquery.js is preceding web2py.js:
> {{
> response.files.insert(0,URL('static','js/jquery.js'))
> response.files.insert(1,URL('static','css/calendar.css'))
> response.files.insert(2,URL('static','js/calendar.js'))
> response.files.insert(3,URL('static','js/web2py.js'))
> response.files.insert(4,URL('static','js/jquery.blockUI.js'))
> response.include_meta()
> response.include_files()
> }}
>
>
> The workaround from José works. After replacing the compileapp.py through 
> the old one, every load is working again. I'll take a closer look at the 
> file in the afternoon. 
>
>
> Am Donnerstag, 10. Oktober 2013 21:15:40 UTC+2 schrieb Niphlod:
>>
>> is jquery.js preceding web2py.js in your layout.html ?
>>
>> On Thursday, October 10, 2013 8:27:04 AM UTC+2, Michael Helbling wrote:
>>>
>>>
>>> Yes, i already copied the web2py.js, appadmin controller and views from 
>>> the latest welcome app to all my apps. 
>>> Without copying the web2py.js, no load worked. But even with the latest 
>>> web2py.js, not all loads are working. that's my problem and i don't know 
>>> why some load doesn't work. In version 2.5.1 with the old web2py.js all 
>>> loads worked and in version 2.7.1 with the new web2py.js ~30% of the loads 
>>> in our app don't work anymore. 
>>>
>>> as described, i don't know what to try anymore. May you can give me a 
>>> hint what i could try additionally? 
>>>
>>>
>>> Am Mittwoch, 9. Oktober 2013 18:53:02 UTC+2 schrieb Massimo Di Pierro:
>>>>
>>>> You need to copy web2py.js from the latest welcome app into your old 
>>>> app.
>>>>
>>>>  
>>> On Wednesday, 9 October 2013 04:57:20 UTC-5, Michael Helbling wrote:
>>>>
>>>> First of all to avoid this question: Yes I copied the appadmin and 
>>>> javascript file from the welcome app to my own app ;-) 
>>>>
>>>>
>>>  
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to