Terrific, thank-you! The data string displays on the browser but as
one line ie.
"string 1", "string 2", "string 3", "string 4", "string 5", "string
6", "string 7", "string 8", "string 9", "string 10", "string
11"
Instead of:
"string 1"
"string 2",
"string 3"
...
"string 11"
Any ideas?
On Apr 8, 7:01 am, "Yoan Blanc" <[EMAIL PROTECTED]> wrote:
> And that way?
>
> On Tue, Apr 8, 2008 at 12:26 PM, dineshv <[EMAIL PROTECTED]> wrote:
>
> > Hi Lewis, this is my test Autocomplete code:
>
> > ############## act.py ##############
>
> > import web
> > import simplejson
>
> > urls = (
> > '/', 'index',
> > '/act(.*)', 'acGET',
>
> '/act', 'acGET',
>
> > )
>
> > data = ["string 1", "string 2", "string 3", "string 4", "string 5",
> > "string 6", "string 7", "string 8", "string 9", "string 10", "string
> > 11"]
>
> > class index():
> > def GET(self):
> > web.header("Content-Type", "text/html; charset=iso-8859-1")
> > print render.act()
>
> > class acGET():
> > def GET(self):
> > global q
> > entry = web.input()
> > web.debug()
> > q = entry.q
> > limit = entry.limit
> > # for test purposes I'm not using 'q' or 'limit' and just
> > returning
> > 'data'
> > result = simplejson.dumps(data)
> > print result
>
> > ############## act.js ##############
>
> > $().ready(function() {
>
> > function findValueCallback(event, data, formatted) {
> > $("<li>").html( !data ? "No match!" : "Selected: " +
> > formatted).appendTo("#result");
> > }
>
> > function formatItem(row) {
> > return row[0] + " (<strong>id: " + row[1] + "</strong>)";
> > }
> > function formatResult(row) {
> > return row[0].replace(/(<.+?>)/gi, '');
> > }
>
> > $("#suggest").autocomplete("/act");
>
> > });
>
> > The input box displays and accepts inputs. The Autocomplete displays
> > data but NOT the correct data. The Traceback error is:
>
> > localhost - - [08/Apr/2008 03:14:15] "GET /static/js/act.js HTTP/1.1"
> > 200 -
> > Traceback (most recent call last):
> > File "c:\python25\lib\site-packages\web\webapi.py", line 304, in
> > wsgifunc
> > result = func()
> > File "c:\python25\lib\site-packages\web\request.py", line 131, in
> > <lambda>
> > func = lambda: handle(inp, fvars)
> > File "c:\python25\lib\site-packages\web\request.py", line 61, in
> > handle
> > return tocall(*([x and urllib.unquote(x) for x in args] + fna))
> > TypeError: GET() takes exactly 1 argument (2 given)
>
> > All help appreciated!
>
> > On Apr 7, 3:46 pm, "Lewis O'Neill" <[EMAIL PROTECTED]> wrote:
> > > JQuery autocomplete is sending a GET request. So is your webpy method
> > > GET as well? Just thought I'd check because you used POST in your
> > > example.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---