[Bese-devel] beginner's question (ucw_ajax)
Attila Lendvai
attila.lendvai at gmail.com
Sat Sep 30 09:09:26 UTC 2006
>
> (defparameter *zozo-application*
> (make-instance 'cookie-session-application
> :url-prefix "/"
> :www-roots (list (cons "static/" (merge-pathnames
> #P"static/" *zozo-www-root*))
> (cons "css/" (merge-pathnames
> #P"css/" *zozo-www-root*))
> (cons "ucw/" (merge-pathnames
> #P"ucw/" *zozo-www-root*))
> (cons "dojo/" (merge-pathnames
> #P"dojo/" *zozo-www-root*))
> (cons "pics/" (merge-pathnames
> #P"pics/" *zozo-www-root*)))
there's also a (make-standard-ucw-www-root-list) similar to the dispatchers
> :debug-on-error t
> :dispatchers (append (make-standard-ucw-dispatchers)
> (list (make-regexp-dispatcher "^(
> zozo.ucw|)$" (call 'zozo-window))))))
>
> Then I got myself a component with a switching container, very similar to
> what the
> example in ucw_dev was doing:
>
> (defcomponent zozo-window (simple-window-component)
> ((body :component
> (switching-container
> :contents (list (cons 'zozo-zaza (make-instance
> 'zozo-zaza))
> (cons 'zozo-zuzu (make-instance
> 'zozo-zuzu)))
> :current-component-key 'zozo-zaza)
> :accessor body))
> (:default-initargs
> :title "Zozo"
> :stylesheet (list "/ucw/ucw.css" "/css/layout.css")
> :content-type "text/html; charset=utf-8;"
> :javascript '((:src "dojo/dojo.js")
> (:js (dojo.require "dojo.event.*")))
> :icon "/pics/icon.ico")
> (:documentation "Zoum zoum"))
>
> An now, I would like to render the thing:
>
> (defmethod render ((zozo zozo-window))
> (render (container.current-component (body zozo)))
it's enough to (render (body zozo)). the semantics of the
switching-container is to render only the current component.
(<:div :id "side-nav"
> (flet ((zozo-link (name text)
> (<ucw:a :action (switch-component (body
> zozo) name) ;; SNAG
the :action parameter was renamed to :action-body, because actions are
first-class citizens in _ajax and there's no way to distinguish between
forms that are meant to be executed as an action or to be called as forms
that return an action object (action-entry struct).
so either :action (register-ajax-action ...) or :action-body (do my stuff).
see the examples for details.
(<:as-html text))))
> (<:ul
> (<:li (zozo-link 'zozo-zaza "Zaza"))
> (<:li (zozo-link 'zozo-zuzu "Zuzu"))))))
>
> now I understand that things have changed a bit between ucw_dev and
> ucw_ajax, but
> I obviously haven't understood the changes... I would really appreciate
> any kind
> of enlightement :-)
>
i've started working on a tex file that collects the api differences between
the two branches. i'll commit it Real Soon Now...
hth,
--
- attila
"- The truth is that I've been too considerate, and so became
unintentionally cruel...
- I understand.
- No, you don't understand! We don't speak the same language!"
(Ingmar Bergman - Smultronstället)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20060930/7f361d33/attachment.html>
More information about the bese-devel
mailing list