I have the following page/index.html view:
{{extend 'scaffolding/outer_layout.html'}}
<div class="main">
{{include 'page/ad.html'}}
{{if groupcomponent:}}
<section class="main-group">
<div class="container">
<div id="group-component">
{{include 'page/group.html'}}
</div> <!-- /#group-component -->
</div> <!-- /.container -->
</section> <!-- /.main-group -->
{{pass}}
<section class="main-content">
{{include 'buildingblocks/address_element.html'}}
</div> <!-- /.container -->
</section> <!-- /.main-content-->
</div> <!-- /.main -->
This works. Now, I'd like page/group to be a separate function and load it
using ajax.
I replaced {{include 'page/group.html'}} with:
{{=LOAD('page', 'group', args=nodeID, ajax=True, target='group-component',
content='')}}
and renamed 'page/group.html' 'page/group.load'
The function simply returns group:
def group():
session.forget(response)
nodeID = request.args(0, cast=int)
response.view = 'page/group.load'
group = db((db.grp_group.nodeID==nodeID) &
(db.grp_group.orderBy==0)).select(db.grp_group.ALL, limitby=(0,1),
orderby_on_limitby=False).first()
return locals()
The problem is that this loads the entire page/index.html view where I want
it to load page/group.load, the latter
is completely ignored. What am I doing wrong?
Kind regards,
Annet
--
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.