I have this app working fine, but I had to change the search to:

controller:

def search():
     "an ajax wiki search page"
     return dict(form=FORM(INPUT(_id='keyword',
              _onkeyup="ajax('bg_find', ['keyword'], 'target');")),
              target_div=DIV(_id='target'))

def bg_find():
     "an ajax callback that returns a <ul> of links to wiki pages"
     pattern = '+ request.vars.keyword.lower() + '
     pages = 
db(db.page.title.lower().like('%'+request.vars.keyword.lower()+'%')).select(orderby=db.page.title)
     items = [A(row.title, _href=URL(r=request, f=show, args=row.id))
for row in pages]
     return UL(*items).xml()
     #return UL(LI(request.vars.keyword.lower()))

View:

{{extend 'layout.html'}}
<h1>Search wiki pages</h1>
[ {{=A('listall', _href=URL(r=request, f='index'))}}]<br />
{{=form}}<br />{{=target_div}}


If you need, I can attach a w2p package here.


2010/7/21 Jeff S <[email protected]>:
> Does someone have an uploadable version of the wiki application found
> in chapter 3?
>
> The search page does not work on my computer, but I can't understand
> why.  My best guess would be a security feature in Internet Explorer,
> but I would like to exclude the possibility of an error in my code.
>
> The behavior on my computer is that what ever I type in the input
> form, there is nothing happening.  I only see my own text.
>
> Thanks,



-- 

http://rochacbruno.com.br

Reply via email to