[Bese-devel] I'm simply not getting it:

Friedrich Dominicus frido at q-software-solutions.de
Mon Jun 20 13:18:22 UTC 2005


See the following code:
(in-package :qss.web.ucw)


;; end of cut+paste code 
(defparameter *test-application*
  (make-instance 'cookie-session-application
                 :url-prefix "/ucw/test/"
                 :tal-generator (make-instance 'yaclml:file-system-generator
                                               :cachep t
                                               :root-directories (list *ucw-tal-root*))
                 :www-roots (list (merge-pathnames "./ucw/test/" *ucw-tal-root*))))

(defcomponent downloader-window (simple-window-component)
  ((body :component simple-container :accessor example-window.body))
  (:default-initargs
      :title "UCW Examples" :stylesheet "stylesheet.css")
  (:documentation "The main window component for the example application."))


(defmethod render-on ((res response) (app downloader-window))
  (<:h1 "Downloader Example")
  (render-on res (example-window.body app)))


(defcomponent simple-address (form-component)
  ((name :accessor name 
         :component (text-field))
   (email :accessor email
          :component (text-field)))
  (:default-initargs
      :title "Downloader " :stylesheet "/css/qss.css"))

(defaction psav ((adr simple-address))
  (<:html
   (<:body
    "here we are")))
 ;;   "name = " (lisp-value (name adr))
;;    "email = "  (lisp-value  (email adr)))))


(defmethod render-on ((res response) (adr simple-address))
  (<ucw:form :action (psav adr) :method "POST"
             (<:table
              (<:tr
               (<:td "You're name please")
               (<:td (<ucw:input :type "text"
                                 :accessor (lisp-value (name adr))
                                 :size 30)))
              (<:tr
               (<:td "you're email: ")
               (<:td (<ucw:input :type "text"
                                 :accessor (lisp-value (email adr))
                                 :size 30)))              
              (<:tr 
               (<:td (<:input :type "submit" :value "submit"))
               (<:td)))))



(defentry-point "index.ucw" (:application *test-application*) ()
  (call 'downloader-window))
  


(defmethod shared-initialize :after ((window downloader-window) slot-names &rest initargs)
  "Initialize the components contained in (example.body APP)."
  (declare (ignore slot-names initargs))
  (let ((container (example-window.body window)))
    (flet ((add-component (type &optional (name type))
	     (setf (find-component container name) (make-instance type))))
      (add-component 'simple-address)
      (setf (container.current-component-name container)
'simple-address))))




Why do I see not output through psav?
I do not see any error I do not see any output. 


What I want it simply put:
- Getting a form with two input text-fields
- after submitting that form I want to see what has been send

Do I always need something like the downloader-window component? and add some tother components to this window?


Friedrich
    



More information about the bese-devel mailing list