>
> > Ajax request gets sent to the server. 
>
> Yes - but I knew that because I get a change in the display. It just 
> isn't the change expected. To reiterate, when the Add form is displayed - 
> in other words, while the grid is *not* displayed - typing in the form 
> displays the whole grid in the Ajax target area.
>

Please remember to use the URL function when generating web2py URLs. This:

ajax('echo', ['name'], 'target')

is wrong. 'echo' is a relative URL, so will simply be appended to the URL 
of the current page. It works accidentally when the main grid is loaded 
because the page URL is probably just /myapp, so the request goes to 
/myapp/echo, which translates to /myapp/default/echo if you've got the 
default controller set. However, when the create form is loaded, the URL 
will be something like /myapp/new/t-dogs or 
/myapp/default/index/new/t-dogs, and the request will go to 
/myapp/default/index/new/t-dogs/echo. In that case, the "echo" will simply 
be ignored, and you'll just get the grid back. Instead, it should be:

ajax('{{=URL("default", "echo")}}', ['name'], 'target')

When debugging Ajax requests, always check what request is made in the 
browser. In this case, you would have seen that the request is going to the 
wrong URL.

Anthony

-- 
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/d/optout.

Reply via email to