From jim.barrows at gmail.com Sat Feb 9 18:42:13 2013 From: jim.barrows at gmail.com (Jim Barrows) Date: Sat, 9 Feb 2013 11:42:13 -0700 Subject: [hunchentoot-devel] Need some help figuring out what I'm doing wrong trying to get post parameters passed properly Message-ID: I'm a Lisp newbie trying to use the jquery ui sortable widget ( http://api.jqueryui.com/sortable/) to sort a list of tasks. The plugin posts the list of tasks as: 1. task[]: 37 2. task[]: 36 3. task[]: 38 Which Hunchentoot sees as: [2013-02-09 11:15:34 [DEBUG]] parameters ((task[] . 37) (task[] . 36) (task[] . 38)) However, when I use this handler: (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) (tasks) (task-prioritize tasks)) I get: [2013-02-09 11:38:52 [DEBUG]] task-prioritize NIL [2013-02-09 11:38:52 [DEBUG]] parameters ((task[] . 36) (task[] . 38) (task[] . 37)) If I use: (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) ((tasks :parameter-type 'array)) (task-prioritize tasks)) I get: [2013-02-09 11:36:07 [DEBUG]] task-prioritize #() [2013-02-09 11:36:07 [DEBUG]] parameters ((task[] . 37) (task[] . 36) (task[] . 38)) If I use: (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) ((tasks :parameter-type 'list)) (task-prioritize tasks)) I get: [2013-02-09 11:37:32 [DEBUG]] task-prioritize NIL [2013-02-09 11:37:32 [DEBUG]] parameters ((task[] . 37) (task[] . 36) (task[] . 38)) My understanding from the documentation is that I should end up with a list of id's in the var task when is all said and done. Could someone tell me what I'm doing wrong that that isn't happening? Or help clarify my understanding? Thanks so much! -- James A Barrows -------------- next part -------------- An HTML attachment was scrubbed... URL: From amalawi at gmail.com Sat Feb 9 18:47:20 2013 From: amalawi at gmail.com (Ala'a Mohammad) Date: Sat, 9 Feb 2013 22:47:20 +0400 Subject: [hunchentoot-devel] Need some help figuring out what I'm doing wrong trying to get post parameters passed properly In-Reply-To: References: Message-ID: the parameter name is "task[]", not "tasks" used as a default name for the 'tasks' parameter in the easy handler. try using real-name HiH Ala'a On Sat, Feb 9, 2013 at 10:42 PM, Jim Barrows wrote: > I'm a Lisp newbie trying to use the jquery ui sortable widget > (http://api.jqueryui.com/sortable/) to sort a list of tasks. > The plugin posts the list of tasks as: > > task[]: > 37 > task[]: > 36 > task[]: > 38 > > > Which Hunchentoot sees as: > [2013-02-09 11:15:34 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > (task[] . 38)) > > However, when I use this handler: > (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) > (tasks) (task-prioritize tasks)) > > I get: > [2013-02-09 11:38:52 [DEBUG]] task-prioritize NIL > > [2013-02-09 11:38:52 [DEBUG]] parameters ((task[] . 36) (task[] . 38) > (task[] . 37)) > > If I use: > (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) > ((tasks :parameter-type 'array)) (task-prioritize tasks)) > I get: > [2013-02-09 11:36:07 [DEBUG]] task-prioritize #() > > [2013-02-09 11:36:07 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > (task[] . 38)) > > If I use: > (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) > ((tasks :parameter-type 'list)) (task-prioritize tasks)) > I get: > [2013-02-09 11:37:32 [DEBUG]] task-prioritize NIL > > [2013-02-09 11:37:32 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > (task[] . 38)) > > My understanding from the documentation is that I should end up with a list > of id's in the var task when is all said and done. Could someone tell me > what I'm doing wrong that that isn't happening? Or help clarify my > understanding? > > Thanks so much! > -- > James A Barrows > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel From jim.barrows at gmail.com Sat Feb 9 19:19:30 2013 From: jim.barrows at gmail.com (Jim Barrows) Date: Sat, 9 Feb 2013 12:19:30 -0700 Subject: [hunchentoot-devel] Need some help figuring out what I'm doing wrong trying to get post parameters passed properly In-Reply-To: References: Message-ID: Fixed that, and it didn't work. I went through all three permutations (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) ((task :parameter-type 'list)) (task-prioritize task)) results in: [2013-02-09 12:18:40 [DEBUG]] task-prioritize NIL [2013-02-09 12:18:40 [DEBUG]] parameters ((task[] . 37) (task[] . 38) (task[] . 36)) On Sat, Feb 9, 2013 at 11:47 AM, Ala'a Mohammad wrote: > the parameter name is "task[]", not "tasks" used as a default name for > the 'tasks' parameter in the easy handler. > > try using real-name > > HiH > > Ala'a > > On Sat, Feb 9, 2013 at 10:42 PM, Jim Barrows > wrote: > > I'm a Lisp newbie trying to use the jquery ui sortable widget > > (http://api.jqueryui.com/sortable/) to sort a list of tasks. > > The plugin posts the list of tasks as: > > > > task[]: > > 37 > > task[]: > > 36 > > task[]: > > 38 > > > > > > Which Hunchentoot sees as: > > [2013-02-09 11:15:34 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > > (task[] . 38)) > > > > However, when I use this handler: > > (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) > > (tasks) (task-prioritize tasks)) > > > > I get: > > [2013-02-09 11:38:52 [DEBUG]] task-prioritize NIL > > > > [2013-02-09 11:38:52 [DEBUG]] parameters ((task[] . 36) (task[] . 38) > > (task[] . 37)) > > > > If I use: > > (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) > > ((tasks :parameter-type 'array)) (task-prioritize tasks)) > > I get: > > [2013-02-09 11:36:07 [DEBUG]] task-prioritize #() > > > > [2013-02-09 11:36:07 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > > (task[] . 38)) > > > > If I use: > > (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) > > ((tasks :parameter-type 'list)) (task-prioritize tasks)) > > I get: > > [2013-02-09 11:37:32 [DEBUG]] task-prioritize NIL > > > > [2013-02-09 11:37:32 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > > (task[] . 38)) > > > > My understanding from the documentation is that I should end up with a > list > > of id's in the var task when is all said and done. Could someone tell me > > what I'm doing wrong that that isn't happening? Or help clarify my > > understanding? > > > > Thanks so much! > > -- > > James A Barrows > > > > _______________________________________________ > > tbnl-devel site list > > tbnl-devel at common-lisp.net > > http://common-lisp.net/mailman/listinfo/tbnl-devel > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel > -- James A Barrows -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjcurry at gmail.com Sat Feb 9 19:34:47 2013 From: mjcurry at gmail.com (Matthew Curry) Date: Sat, 9 Feb 2013 14:34:47 -0500 Subject: [hunchentoot-devel] Need some help figuring out what I'm doing wrong trying to get post parameters passed properly In-Reply-To: References: Message-ID: You're still not using the parameter name "task[]". Try: (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) ((task[] :parameter-type 'list)) (task-prioritize task[])) -Matt On Sat, Feb 9, 2013 at 2:19 PM, Jim Barrows wrote: > Fixed that, and it didn't work. I went through all three permutations > (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) > ((task :parameter-type 'list)) (task-prioritize task)) > > results in: > [2013-02-09 12:18:40 [DEBUG]] task-prioritize NIL > > [2013-02-09 12:18:40 [DEBUG]] parameters ((task[] . 37) (task[] . 38) > (task[] . 36)) > > > On Sat, Feb 9, 2013 at 11:47 AM, Ala'a Mohammad wrote: >> >> the parameter name is "task[]", not "tasks" used as a default name for >> the 'tasks' parameter in the easy handler. >> >> try using real-name >> >> HiH >> >> Ala'a >> >> On Sat, Feb 9, 2013 at 10:42 PM, Jim Barrows >> wrote: >> > I'm a Lisp newbie trying to use the jquery ui sortable widget >> > (http://api.jqueryui.com/sortable/) to sort a list of tasks. >> > The plugin posts the list of tasks as: >> > >> > task[]: >> > 37 >> > task[]: >> > 36 >> > task[]: >> > 38 >> > >> > >> > Which Hunchentoot sees as: >> > [2013-02-09 11:15:34 [DEBUG]] parameters ((task[] . 37) (task[] . 36) >> > (task[] . 38)) >> > >> > However, when I use this handler: >> > (define-easy-handler (task-prioritize-url-handler :uri >> > *task-prioritize*) >> > (tasks) (task-prioritize tasks)) >> > >> > I get: >> > [2013-02-09 11:38:52 [DEBUG]] task-prioritize NIL >> > >> > [2013-02-09 11:38:52 [DEBUG]] parameters ((task[] . 36) (task[] . 38) >> > (task[] . 37)) >> > >> > If I use: >> > (define-easy-handler (task-prioritize-url-handler :uri >> > *task-prioritize*) >> > ((tasks :parameter-type 'array)) (task-prioritize tasks)) >> > I get: >> > [2013-02-09 11:36:07 [DEBUG]] task-prioritize #() >> > >> > [2013-02-09 11:36:07 [DEBUG]] parameters ((task[] . 37) (task[] . 36) >> > (task[] . 38)) >> > >> > If I use: >> > (define-easy-handler (task-prioritize-url-handler :uri >> > *task-prioritize*) >> > ((tasks :parameter-type 'list)) (task-prioritize tasks)) >> > I get: >> > [2013-02-09 11:37:32 [DEBUG]] task-prioritize NIL >> > >> > [2013-02-09 11:37:32 [DEBUG]] parameters ((task[] . 37) (task[] . 36) >> > (task[] . 38)) >> > >> > My understanding from the documentation is that I should end up with a >> > list >> > of id's in the var task when is all said and done. Could someone tell >> > me >> > what I'm doing wrong that that isn't happening? Or help clarify my >> > understanding? >> > >> > Thanks so much! >> > -- >> > James A Barrows >> > >> > _______________________________________________ >> > tbnl-devel site list >> > tbnl-devel at common-lisp.net >> > http://common-lisp.net/mailman/listinfo/tbnl-devel >> >> _______________________________________________ >> tbnl-devel site list >> tbnl-devel at common-lisp.net >> http://common-lisp.net/mailman/listinfo/tbnl-devel > > > > > -- > James A Barrows > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel From amalawi at gmail.com Sat Feb 9 19:40:36 2013 From: amalawi at gmail.com (Ala'a Mohammad) Date: Sat, 9 Feb 2013 23:40:36 +0400 Subject: [hunchentoot-devel] Need some help figuring out what I'm doing wrong trying to get post parameters passed properly In-Reply-To: References: Message-ID: ;; using list as parameter-type (define-easy-handler (form-page :uri "/") () (with-html-output-to-string (out) (:form :action "/process" (:input :type "text" :name "task[]" :value "37") (:input :type "text" :name "task[]" :value "38") (:input :type "text" :name "task[]" :value "36") (:input :type "submit" :value "Process")))) (define-easy-handler (process-page :uri "/process") ((tasks :real-name "task[]" :parameter-type 'list)) (with-html-output-to-string (out) (print tasks out))) ;; array parameter-type needs fields names to be something like task[36], task[38] ... etc, ;; not with empty square brackets like task[], so the following wont work. (define-easy-handler (process-page :uri "/process") ((tasks :real-name "task" :parameter-type 'array)) (with-html-output-to-string (out) (print tasks out))) ;; but using this will allow you to use array parameter type, and thus the above easy-handler will work (define-easy-handler (form-page :uri "/") () (with-html-output-to-string (out) (:form :action "/process" (:input :type "text" :name "task[0]" :value "37") (:input :type "text" :name "task[1]" :value "38") (:input :type "text" :name "task[2]" :value "36") (:input :type "submit" :value "Process")))) On Sat, Feb 9, 2013 at 11:19 PM, Jim Barrows wrote: > Fixed that, and it didn't work. I went through all three permutations > (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) > ((task :parameter-type 'list)) (task-prioritize task)) > > results in: > [2013-02-09 12:18:40 [DEBUG]] task-prioritize NIL > > [2013-02-09 12:18:40 [DEBUG]] parameters ((task[] . 37) (task[] . 38) > (task[] . 36)) > > > On Sat, Feb 9, 2013 at 11:47 AM, Ala'a Mohammad wrote: >> >> the parameter name is "task[]", not "tasks" used as a default name for >> the 'tasks' parameter in the easy handler. >> >> try using real-name >> >> HiH >> >> Ala'a >> >> On Sat, Feb 9, 2013 at 10:42 PM, Jim Barrows >> wrote: >> > I'm a Lisp newbie trying to use the jquery ui sortable widget >> > (http://api.jqueryui.com/sortable/) to sort a list of tasks. >> > The plugin posts the list of tasks as: >> > >> > task[]: >> > 37 >> > task[]: >> > 36 >> > task[]: >> > 38 >> > >> > >> > Which Hunchentoot sees as: >> > [2013-02-09 11:15:34 [DEBUG]] parameters ((task[] . 37) (task[] . 36) >> > (task[] . 38)) >> > >> > However, when I use this handler: >> > (define-easy-handler (task-prioritize-url-handler :uri >> > *task-prioritize*) >> > (tasks) (task-prioritize tasks)) >> > >> > I get: >> > [2013-02-09 11:38:52 [DEBUG]] task-prioritize NIL >> > >> > [2013-02-09 11:38:52 [DEBUG]] parameters ((task[] . 36) (task[] . 38) >> > (task[] . 37)) >> > >> > If I use: >> > (define-easy-handler (task-prioritize-url-handler :uri >> > *task-prioritize*) >> > ((tasks :parameter-type 'array)) (task-prioritize tasks)) >> > I get: >> > [2013-02-09 11:36:07 [DEBUG]] task-prioritize #() >> > >> > [2013-02-09 11:36:07 [DEBUG]] parameters ((task[] . 37) (task[] . 36) >> > (task[] . 38)) >> > >> > If I use: >> > (define-easy-handler (task-prioritize-url-handler :uri >> > *task-prioritize*) >> > ((tasks :parameter-type 'list)) (task-prioritize tasks)) >> > I get: >> > [2013-02-09 11:37:32 [DEBUG]] task-prioritize NIL >> > >> > [2013-02-09 11:37:32 [DEBUG]] parameters ((task[] . 37) (task[] . 36) >> > (task[] . 38)) >> > >> > My understanding from the documentation is that I should end up with a >> > list >> > of id's in the var task when is all said and done. Could someone tell >> > me >> > what I'm doing wrong that that isn't happening? Or help clarify my >> > understanding? >> > >> > Thanks so much! >> > -- >> > James A Barrows >> > >> > _______________________________________________ >> > tbnl-devel site list >> > tbnl-devel at common-lisp.net >> > http://common-lisp.net/mailman/listinfo/tbnl-devel >> >> _______________________________________________ >> tbnl-devel site list >> tbnl-devel at common-lisp.net >> http://common-lisp.net/mailman/listinfo/tbnl-devel > > > > > -- > James A Barrows > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel From jim.barrows at gmail.com Sat Feb 9 20:52:06 2013 From: jim.barrows at gmail.com (Jim Barrows) Date: Sat, 9 Feb 2013 13:52:06 -0700 Subject: [hunchentoot-devel] Need some help figuring out what I'm doing wrong trying to get post parameters passed properly In-Reply-To: References: Message-ID: that worked. It never hit me that the name of the variable could include the square brackets. Very cool! Thanks! On Sat, Feb 9, 2013 at 12:34 PM, Matthew Curry wrote: > You're still not using the parameter name "task[]". > > Try: > (define-easy-handler (task-prioritize-url-handler :uri > *task-prioritize*) ((task[] :parameter-type 'list)) (task-prioritize > task[])) > > -Matt > > > On Sat, Feb 9, 2013 at 2:19 PM, Jim Barrows wrote: > > Fixed that, and it didn't work. I went through all three permutations > > (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) > > ((task :parameter-type 'list)) (task-prioritize task)) > > > > results in: > > [2013-02-09 12:18:40 [DEBUG]] task-prioritize NIL > > > > [2013-02-09 12:18:40 [DEBUG]] parameters ((task[] . 37) (task[] . 38) > > (task[] . 36)) > > > > > > On Sat, Feb 9, 2013 at 11:47 AM, Ala'a Mohammad > wrote: > >> > >> the parameter name is "task[]", not "tasks" used as a default name for > >> the 'tasks' parameter in the easy handler. > >> > >> try using real-name > >> > >> HiH > >> > >> Ala'a > >> > >> On Sat, Feb 9, 2013 at 10:42 PM, Jim Barrows > >> wrote: > >> > I'm a Lisp newbie trying to use the jquery ui sortable widget > >> > (http://api.jqueryui.com/sortable/) to sort a list of tasks. > >> > The plugin posts the list of tasks as: > >> > > >> > task[]: > >> > 37 > >> > task[]: > >> > 36 > >> > task[]: > >> > 38 > >> > > >> > > >> > Which Hunchentoot sees as: > >> > [2013-02-09 11:15:34 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > >> > (task[] . 38)) > >> > > >> > However, when I use this handler: > >> > (define-easy-handler (task-prioritize-url-handler :uri > >> > *task-prioritize*) > >> > (tasks) (task-prioritize tasks)) > >> > > >> > I get: > >> > [2013-02-09 11:38:52 [DEBUG]] task-prioritize NIL > >> > > >> > [2013-02-09 11:38:52 [DEBUG]] parameters ((task[] . 36) (task[] . 38) > >> > (task[] . 37)) > >> > > >> > If I use: > >> > (define-easy-handler (task-prioritize-url-handler :uri > >> > *task-prioritize*) > >> > ((tasks :parameter-type 'array)) (task-prioritize tasks)) > >> > I get: > >> > [2013-02-09 11:36:07 [DEBUG]] task-prioritize #() > >> > > >> > [2013-02-09 11:36:07 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > >> > (task[] . 38)) > >> > > >> > If I use: > >> > (define-easy-handler (task-prioritize-url-handler :uri > >> > *task-prioritize*) > >> > ((tasks :parameter-type 'list)) (task-prioritize tasks)) > >> > I get: > >> > [2013-02-09 11:37:32 [DEBUG]] task-prioritize NIL > >> > > >> > [2013-02-09 11:37:32 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > >> > (task[] . 38)) > >> > > >> > My understanding from the documentation is that I should end up with a > >> > list > >> > of id's in the var task when is all said and done. Could someone tell > >> > me > >> > what I'm doing wrong that that isn't happening? Or help clarify my > >> > understanding? > >> > > >> > Thanks so much! > >> > -- > >> > James A Barrows > >> > > >> > _______________________________________________ > >> > tbnl-devel site list > >> > tbnl-devel at common-lisp.net > >> > http://common-lisp.net/mailman/listinfo/tbnl-devel > >> > >> _______________________________________________ > >> tbnl-devel site list > >> tbnl-devel at common-lisp.net > >> http://common-lisp.net/mailman/listinfo/tbnl-devel > > > > > > > > > > -- > > James A Barrows > > > > _______________________________________________ > > tbnl-devel site list > > tbnl-devel at common-lisp.net > > http://common-lisp.net/mailman/listinfo/tbnl-devel > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel > -- James A Barrows -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim.barrows at gmail.com Sat Feb 9 20:53:12 2013 From: jim.barrows at gmail.com (Jim Barrows) Date: Sat, 9 Feb 2013 13:53:12 -0700 Subject: [hunchentoot-devel] Need some help figuring out what I'm doing wrong trying to get post parameters passed properly In-Reply-To: References: Message-ID: Unfortunately,. the JQuery sortable api is the on that determines the names of the fields, and not me. Thanks for the help though! It is greatly appreciated! On Sat, Feb 9, 2013 at 12:40 PM, Ala'a Mohammad wrote: > ;; using list as parameter-type > > (define-easy-handler (form-page :uri "/") > () > (with-html-output-to-string (out) > (:form :action "/process" > (:input :type "text" :name "task[]" :value "37") > (:input :type "text" :name "task[]" :value "38") > (:input :type "text" :name "task[]" :value "36") > (:input :type "submit" :value "Process")))) > > (define-easy-handler (process-page :uri "/process") > ((tasks :real-name "task[]" :parameter-type 'list)) > (with-html-output-to-string (out) > (print tasks out))) > > ;; array parameter-type needs fields names to be something like > task[36], task[38] ... etc, > ;; not with empty square brackets like task[], so the following wont work. > (define-easy-handler (process-page :uri "/process") > ((tasks :real-name "task" :parameter-type 'array)) > (with-html-output-to-string (out) > (print tasks out))) > > ;; but using this will allow you to use array parameter type, and thus > the above easy-handler will work > > (define-easy-handler (form-page :uri "/") > () > (with-html-output-to-string (out) > (:form :action "/process" > (:input :type "text" :name "task[0]" :value "37") > (:input :type "text" :name "task[1]" :value "38") > (:input :type "text" :name "task[2]" :value "36") > (:input :type "submit" :value "Process")))) > > On Sat, Feb 9, 2013 at 11:19 PM, Jim Barrows > wrote: > > Fixed that, and it didn't work. I went through all three permutations > > (define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) > > ((task :parameter-type 'list)) (task-prioritize task)) > > > > results in: > > [2013-02-09 12:18:40 [DEBUG]] task-prioritize NIL > > > > [2013-02-09 12:18:40 [DEBUG]] parameters ((task[] . 37) (task[] . 38) > > (task[] . 36)) > > > > > > On Sat, Feb 9, 2013 at 11:47 AM, Ala'a Mohammad > wrote: > >> > >> the parameter name is "task[]", not "tasks" used as a default name for > >> the 'tasks' parameter in the easy handler. > >> > >> try using real-name > >> > >> HiH > >> > >> Ala'a > >> > >> On Sat, Feb 9, 2013 at 10:42 PM, Jim Barrows > >> wrote: > >> > I'm a Lisp newbie trying to use the jquery ui sortable widget > >> > (http://api.jqueryui.com/sortable/) to sort a list of tasks. > >> > The plugin posts the list of tasks as: > >> > > >> > task[]: > >> > 37 > >> > task[]: > >> > 36 > >> > task[]: > >> > 38 > >> > > >> > > >> > Which Hunchentoot sees as: > >> > [2013-02-09 11:15:34 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > >> > (task[] . 38)) > >> > > >> > However, when I use this handler: > >> > (define-easy-handler (task-prioritize-url-handler :uri > >> > *task-prioritize*) > >> > (tasks) (task-prioritize tasks)) > >> > > >> > I get: > >> > [2013-02-09 11:38:52 [DEBUG]] task-prioritize NIL > >> > > >> > [2013-02-09 11:38:52 [DEBUG]] parameters ((task[] . 36) (task[] . 38) > >> > (task[] . 37)) > >> > > >> > If I use: > >> > (define-easy-handler (task-prioritize-url-handler :uri > >> > *task-prioritize*) > >> > ((tasks :parameter-type 'array)) (task-prioritize tasks)) > >> > I get: > >> > [2013-02-09 11:36:07 [DEBUG]] task-prioritize #() > >> > > >> > [2013-02-09 11:36:07 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > >> > (task[] . 38)) > >> > > >> > If I use: > >> > (define-easy-handler (task-prioritize-url-handler :uri > >> > *task-prioritize*) > >> > ((tasks :parameter-type 'list)) (task-prioritize tasks)) > >> > I get: > >> > [2013-02-09 11:37:32 [DEBUG]] task-prioritize NIL > >> > > >> > [2013-02-09 11:37:32 [DEBUG]] parameters ((task[] . 37) (task[] . 36) > >> > (task[] . 38)) > >> > > >> > My understanding from the documentation is that I should end up with a > >> > list > >> > of id's in the var task when is all said and done. Could someone tell > >> > me > >> > what I'm doing wrong that that isn't happening? Or help clarify my > >> > understanding? > >> > > >> > Thanks so much! > >> > -- > >> > James A Barrows > >> > > >> > _______________________________________________ > >> > tbnl-devel site list > >> > tbnl-devel at common-lisp.net > >> > http://common-lisp.net/mailman/listinfo/tbnl-devel > >> > >> _______________________________________________ > >> tbnl-devel site list > >> tbnl-devel at common-lisp.net > >> http://common-lisp.net/mailman/listinfo/tbnl-devel > > > > > > > > > > -- > > James A Barrows > > > > _______________________________________________ > > tbnl-devel site list > > tbnl-devel at common-lisp.net > > http://common-lisp.net/mailman/listinfo/tbnl-devel > > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel > -- James A Barrows -------------- next part -------------- An HTML attachment was scrubbed... URL: From rwiker at gmail.com Sun Feb 10 07:47:49 2013 From: rwiker at gmail.com (Raymond Wiker) Date: Sun, 10 Feb 2013 08:47:49 +0100 Subject: [hunchentoot-devel] Need some help figuring out what I'm doing wrong trying to get post parameters passed properly In-Reply-To: References: Message-ID: <8C33674C-1F63-4BE3-9C80-A6B0C462EB82@gmail.com> On Feb 9, 2013, at 21:53 , Jim Barrows wrote: > Unfortunately,. the JQuery sortable api is the on that determines the names of the fields, and not me. > Thanks for the help though! > It is greatly appreciated! > You may be able to use something like the following (untested): (hunchentoot:define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) () (let ((tasks (mapcar #'cdr (remove-if-not (lambda (x) (string= (car x) "task[]")) (hunchentoot:get-parameters*))))) (task-prioritize tasks))) If your request use "POST", you may have to replace get-parameters* with post-parameters*, or possibly to have both combined with append. From stassats at gmail.com Mon Feb 11 14:12:30 2013 From: stassats at gmail.com (Stas Boukarev) Date: Mon, 11 Feb 2013 18:12:30 +0400 Subject: [hunchentoot-devel] Need some help figuring out what I'm doing wrong trying to get post parameters passed properly In-Reply-To: <8C33674C-1F63-4BE3-9C80-A6B0C462EB82@gmail.com> (Raymond Wiker's message of "Sun, 10 Feb 2013 08:47:49 +0100") References: <8C33674C-1F63-4BE3-9C80-A6B0C462EB82@gmail.com> Message-ID: <87621zos6p.fsf@gmail.com> Raymond Wiker writes: > On Feb 9, 2013, at 21:53 , Jim Barrows wrote: >> Unfortunately,. the JQuery sortable api is the on that determines the names of the fields, and not me. >> Thanks for the help though! >> It is greatly appreciated! >> > > You may be able to use something like the following (untested): > > (hunchentoot:define-easy-handler > (task-prioritize-url-handler :uri *task-prioritize*) > () > (let ((tasks (mapcar #'cdr (remove-if-not (lambda (x) (string= (car x) "task[]")) > (hunchentoot:get-parameters*))))) > (task-prioritize tasks))) > > If your request use "POST", you may have to replace get-parameters* with post-parameters*, or possibly to have both combined with append. Not really relevant to the problem, just some "protips": (remove-if-not (lambda (x) (string= (car x) "task[]")) (hunchentoot:get-parameters*)) => (remove "task[]" (hunchentoot:get-parameters*) :key #'car :test #'string/=) But with mapcar #'cdr combined, it'd be better: (loop for (key . value) in (get-parameters*) when (string= key "task[]") collect value) -- With best regards, Stas. From gerryw at compvia.com Wed Feb 13 09:27:27 2013 From: gerryw at compvia.com (Gerry Weaver) Date: Wed, 13 Feb 2013 09:27:27 +0000 Subject: [hunchentoot-devel] Need help with basic dispatch Message-ID: Hello All, I am new to Lisp and I have been playing around with Hunchentoot. I don't seem to be able to get dispatch to work. I've tried several things, but to no avail. Should the following code work or have I missed something? (defparameter *httpsd* (hunchentoot:start (make-instance 'hunchentoot:ssl-acceptor :port 4443 :ssl-certificate-file #p"/build/hunchentoot/server.crt" :ssl-privatekey-file #p"/build/hunchentoot/server.key" :document-root #p"/build/"))) (defun upload-message () (princ "Upload")) (push (hunchentoot:create-prefix-dispatcher "/upload" 'upload-message) hunchentoot:*dispatch-table*) A pointer in the right direction would be much appreciated. Thanks, Gerry From hans.huebner at gmail.com Wed Feb 13 09:51:06 2013 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Wed, 13 Feb 2013 10:51:06 +0100 Subject: [hunchentoot-devel] Need help with basic dispatch In-Reply-To: References: Message-ID: Gerry, hunchentoot:*dispatch-table* is part of the easy-handler framework ( http://weitz.de/hunchentoot/#easy-handlers). If you want to use it, you'll have to instantiate a hunchentoot:easy-acceptor or hunchentoot:easy-ssl-acceptor. HTH, Hans On Wed, Feb 13, 2013 at 10:27 AM, Gerry Weaver wrote: > Hello All, > > I am new to Lisp and I have been playing around with Hunchentoot. I don't > seem to be able to get dispatch to work. I've tried several things, but to > no avail. Should the following code work or have I missed something? > > > (defparameter *httpsd* (hunchentoot:start (make-instance > 'hunchentoot:ssl-acceptor > :port 4443 > :ssl-certificate-file > #p"/build/hunchentoot/server.crt" > :ssl-privatekey-file > #p"/build/hunchentoot/server.key" > :document-root #p"/build/"))) > > > (defun upload-message () > (princ "Upload")) > > (push (hunchentoot:create-prefix-dispatcher "/upload" 'upload-message) > hunchentoot:*dispatch-table*) > > A pointer in the right direction would be much appreciated. > > Thanks, > Gerry > _______________________________________________ > tbnl-devel site list > tbnl-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/tbnl-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebyte at smolny.plus.com Wed Feb 13 10:11:43 2013 From: sebyte at smolny.plus.com (Sebastian Tennant) Date: Wed, 13 Feb 2013 10:11:43 +0000 Subject: [hunchentoot-devel] Need help with basic dispatch References: Message-ID: Quoth Gerry Weaver : > [...] A pointer in the right direction would be much appreciated. At some point you should also call TBNL:START. Seb -- Emacs' AlsaPlayer - Music Without Jolts Lightweight, full-featured and mindful of your idyllic happiness. http://home.gna.org/eap From sebyte at smolny.plus.com Wed Feb 13 10:29:18 2013 From: sebyte at smolny.plus.com (Sebastian Tennant) Date: Wed, 13 Feb 2013 10:29:18 +0000 Subject: [hunchentoot-devel] Need help with basic dispatch References: Message-ID: Quoth Gerry Weaver : > [...] A pointer in the right direction would be much appreciated. Whoops! Just noticed that you already call TBNL:START in your DEFPARAMETER form so ignore previous message. (TBNL is a nickname for HUNCHENTOOT, by the way). Seb -- Emacs' AlsaPlayer - Music Without Jolts Lightweight, full-featured and mindful of your idyllic happiness. http://home.gna.org/eap From gerryw at compvia.com Wed Feb 13 10:40:29 2013 From: gerryw at compvia.com (Gerry Weaver) Date: Wed, 13 Feb 2013 10:40:29 +0000 Subject: [hunchentoot-devel] Need help with basic dispatch In-Reply-To: References: Message-ID: Hi Hans, Thanks! It would have taken me a long time to notice that. You saved me many hours of frustration. Things are working well now. BTW: I read something about Hunchentoot having trouble with large file uploads. Is that still a problem? Thanks Again, Gerry From: Hans H?bner [mailto:hans.huebner at gmail.com] Sent: Wednesday, February 13, 2013 3:51 AM To: General interest list for Hunchentoot and CL-WEBDAV Subject: Re: [hunchentoot-devel] Need help with basic dispatch Gerry, hunchentoot:*dispatch-table* is part of the easy-handler framework (http://weitz.de/hunchentoot/#easy-handlers). If you want to use it, you'll have to instantiate a hunchentoot:easy-acceptor or hunchentoot:easy-ssl-acceptor. HTH, Hans On Wed, Feb 13, 2013 at 10:27 AM, Gerry Weaver > wrote: Hello All, I am new to Lisp and I have been playing around with Hunchentoot. I don't seem to be able to get dispatch to work. I've tried several things, but to no avail. Should the following code work or have I missed something? (defparameter *httpsd* (hunchentoot:start (make-instance 'hunchentoot:ssl-acceptor :port 4443 :ssl-certificate-file #p"/build/hunchentoot/server.crt" :ssl-privatekey-file #p"/build/hunchentoot/server.key" :document-root #p"/build/"))) (defun upload-message () (princ "Upload")) (push (hunchentoot:create-prefix-dispatcher "/upload" 'upload-message) hunchentoot:*dispatch-table*) A pointer in the right direction would be much appreciated. Thanks, Gerry _______________________________________________ tbnl-devel site list tbnl-devel at common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans.huebner at gmail.com Wed Feb 13 11:19:02 2013 From: hans.huebner at gmail.com (=?ISO-8859-1?Q?Hans_H=FCbner?=) Date: Wed, 13 Feb 2013 12:19:02 +0100 Subject: [hunchentoot-devel] Need help with basic dispatch In-Reply-To: References: Message-ID: On Wed, Feb 13, 2013 at 11:40 AM, Gerry Weaver wrote: > BTW: I read something about Hunchentoot having trouble with large file > uploads. Is that still a problem? > I am not aware of any outstanding problems, but that does not mean that there exists none. Can you be more specific? What did you read and where? Thanks, Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: