Thanks for sending me the screenshots. Now I see the problem:

    search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
['keyword'], 'target_div');")

should be

    search_input=INPUT(_id='keyword', _onkeyup="ajax('%s',['keyword'],
'target_div');" % URL(r=request,f='bg_find'))

else it interprets the URL as a relative url and does not call the
db_find function.

On Dec 14, 9:28 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I am sorry I misunderstood the problem. The {{extend 'layout.html'}}
> goes in the master page, the one doing the ajax call.
>
> I still do not understand the problem. I tried you code and it worked
> as I would expect, no page in page.
> Can you send me a screenshot?
>
> Massimo
>
> On Dec 14, 8:58 am, Miguel Lopes <mig.e.lo...@gmail.com> wrote:
>
> > On Mon, Dec 14, 2009 at 2:41 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > > The page has layout. pieces of the page loadad via ajax do not need to
> > > declare {{extend 'layout.hml'}} but they do have automatically the
> > > same look and feel because they are embedded in the same page that has
> > > the layout.
>
> > I have no page associated with the ajax call. The call is issued to a
> > function (a.k.a. action) that as no template associated with it:
> > @auth.requires_login()
> > def bg_find():
> >    return P('Hello')
>
> > The page that calls the "layout piece" to be loaded via ajax
> > faithfully reproduces what is on the book's wiki example. This is the
> > default/list_results.html (that I mistakenly named
> > default/results.html in my first email):
> > {{extend 'layout.html'}}
>
> > <h2>Results</h2>
> > {{=search_input}} <br />
> > {{=target_div}}
>
> > The function associated with this page also mirrors the example in the book:
> > @auth.requires_login()
> > def list_results():
> >    search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
> > ['keyword'], 'target_div');")
> >    target_div=DIV(_id='target_div')
> >    return dict(search_input=search_input, target_div=target_div)
>
> > I'm sorry if I'm missing something obvious, but I'm, not seeing it.
> > Miguel
>
> > > On Dec 14, 8:37 am, Miguel Lopes <mig.e.lo...@gmail.com> wrote:
> > >> On Mon, Dec 14, 2009 at 2:29 PM, mdipierro <mdipie...@cs.depaul.edu> 
> > >> wrote:
> > >> > The view of the action served via ajax should NOT {{extend
> > >> > 'layout.html'}}.
>
> > >> I suppose / expect this is only the case with the crm appliance?
> > >> And, that the wiki example provided in the book correctly extends
> > >> layout, as if this is not the case how is it possible to benefit from
> > >> templating in the context of ajax calls?
>
> > >> Miguel
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to