[Bese-devel] UCW beginners error; it.bese.ucw::place is unbound

Andrew Lawson adl at absentis.com
Wed Feb 15 09:52:01 UTC 2006


Hello all
    I've been playing with UCW for a day or so but have encountered an error that I can't seem to solve. I'm not sure whether I've not initialised something correctly ot whether I'm simply using the library on an unsupported platform (Lispworks 4.4.6, windows). The error I get is;

The slot IT.BESE.UCW::PLACE is unbound in the object #<IT.BESE.UCW-USER::MY-MODULE-CHOICE 21B457EC> (an instance of class #<IT.BESE.UCW:STANDARD-COMPONENT-CLASS IT.BESE.UCW-USER::MY-MODULE-CHOICE 21A614B4>).

Below is the code that causes this error when you click and it tries to call a new component, I've removed any code that seemed pointless and it still errors as before.

(in-package :it.bese.ucw-user)

(export 'startup)

(defun startup ()
  (asdf:oos 'asdf:load-op :ucw.admin)
  (asdf:oos 'asdf:load-op :ucw.examples)
  (ucw:start-swank)
  (ucw:create-server
   :backend :aserve
   :host "127.0.0.1"
   :port 8080
   :applications (list
                  it.bese.ucw-user::*example-application*
                  ucw::*admin-application*
                  *website-application*)
   :inspect-components nil
   :log-root-directory (make-pathname 
                        :name nil
                        :type nil
                        :directory (append (pathname-directory *load-truename*)
                                           (list :up "logs"))
                        :defaults *load-truename*)
   :log-level it.bese.ucw::+info+
   :start-p t))

;(startup)

(defparameter *website-application*
  (make-instance 'cookie-session-application :url-prefix "/website-application/"))

(defentry-point "index.ucw" (:application *website-application*) ()
  (call 'my-simple-window-component))


(defcomponent my-simple-window-component (simple-window-component)
              ()
              (:default-initargs
               :title "My Website"))

(defmethod initialize-instance :after ((self my-simple-window-component) &rest args)
  (setf (ucw:window-component.stylesheet self) "http://localhost:8080/css/standard.css"))

(defmethod render ((com my-simple-window-component))
  (<:div
   :class "body"
   (<:div
    :class "title"
    (<:div :class "header-1" "Website application"))
   (<:div
    :class "page"
    (render (make-instance 'my-module-choice)))))

(defcomponent my-module-choice (widget-component)
              ())

(defmethod render ((self my-module-choice))
  (<:div
   :class "header-4"
   "Module choice")
  (<:p "Choose the module you would like to use")
  (<ucw:a :action (open-module self 'first-module)
          (<:as-html "Open first module")))

(defaction open-module ((self my-module-choice) module-type)
  (call-component self (make-instance module-type)))

(defcomponent first-module (widget-component)
              ())

(defmethod render ((self first-module))
  (<:div
   :class "header-4"
   "First module"))



More information about the bese-devel mailing list