This works for me:
CL-USER> (html ((:form :action "post") ((:label :for "abc") "abc:") ((:input :name "abc")))) <form action="post"><label for="abc">abc:</label><input name="abc"/></form>
-Hans
On Mon, Jun 1, 2009 at 02:49, Thomas thomas.karolski@googlemail.com wrote:
Hi,
how can I get xhtmlgen to accept (:label :for "name")?
bknr-devel mailing list bknr-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/bknr-devel
Hans Hübner schrieb:
This works for me:
CL-USER> (html ((:form :action "post") ((:label :for "abc") "abc:") ((:input :name "abc"))))
<form action="post"><label for="abc">abc:</label><input name="abc"/></form>
Ah ok, thanks. I guess this is different syntax wise from what I expected. I would love to try this out, but I got stuck with with-bknr-page. How come this does not work: (defmethod handle-form ((handler register-handler) action) (lambda () (with-bknr-page (:title "Test") ((:form :id "test"))))
I merely get a page with the basic xhtml header but no content. Is with-bknr-page not supposed to be used here?
On Mon, Jun 1, 2009 at 22:02, Thomas thomas.karolski@googlemail.com wrote:
How come this does not work: (defmethod handle-form ((handler register-handler) action) (lambda () (with-bknr-page (:title "Test") ((:form :id "test"))))
I merely get a page with the basic xhtml header but no content. Is with-bknr-page not supposed to be used here?
BKNR handlers do not return a closure. Please have a look into the existing project source code in order to find some examples of how BKNR handlers work. It is unfortunate that there is no documentation, and I regret not having any time to add some. I'd recommend that you use another web framework if you are unable to work yourself through the source.
-Hans
Hans Hübner wrote:
BKNR handlers do not return a closure. Please have a look into the existing project source code in order to find some examples of how BKNR handlers work. It is unfortunate that there is no documentation, and I regret not having any time to add some. I'd recommend that you use another web framework if you are unable to work yourself through the source.
Yes I noticed its different in the examples and bknr source code. However unless I return a function object, I get error pages like this:
The value "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> " is not of type (OR FUNCTION SYMBOL).
So I figured I ought to try returning a function. Anyway, I appreciate the heads up - though as I don't really know of any other web framework, I might just as well stick with BKNR. I'll try to figure out how it works by doing some code digging.
Kind regards, Thomas
On Mon, Jun 1, 2009 at 23:42, Thomas thomas.karolski@googlemail.com wrote:
Yes I noticed its different in the examples and bknr source code. However unless I return a function object, I get error pages like this:
The value "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
" is not of type (OR FUNCTION SYMBOL).
That propably is because you're not using BKNR's request dispatcher. Have a look at projects/lisp-ecoop/src/webserver.lisp. In the function START-WEBSERVER, Hunchentoot is initialized with a :REQUEST-DISPATCHER argument of 'BKNR.WEB:BKNR-DISPATCH.
-Hans
Hans Hübner schrieb:
That propably is because you're not using BKNR's request dispatcher. Have a look at projects/lisp-ecoop/src/webserver.lisp. In the function START-WEBSERVER, Hunchentoot is initialized with a :REQUEST-DISPATCHER argument of 'BKNR.WEB:BKNR-DISPATCH.
Ah - I saw that publish-site pushed that exact dispatcher into the *dispatch-table* so I didn't think of invoking hunchentoot's acceptor with it. Now that works - it even fixed a problem I had with the template handler. Great!
I'm actually going through some of the BKNR functions I encounter on a daily basis and document them here and there. If you are like, interested at all in having some basic documentation on some of your functions, then I could post a diff.
Kind Regards, Thomas K.