[Bese-devel] simple-form question

Hazen Babcock hbabcockos1 at mac.com
Sat Jul 22 16:45:53 UTC 2006


On Jul 22, 2006, at 10:45 AM, Attila Lendvai wrote:

> i suggest giving more descriptive names... form1 is a type not a  
> variable at the (value ...) call

Sorry, I was trying to create a simple example of the behavior  
(Thanks also to Matthew for pointing out my typo). At the risk of  
further embarrassment, I submit that the following example will throw  
the same error, "The variable FORM-TEST::STRING-FORM is unbound.  
[Condition of type UNBOUND-VARIABLE]".

(defcomponent string-form (simple-form)
   ((string-input :accessor string-input
		 :initform (make-instance 'string-field :input-size 10))))

(defcomponent form-test (simple-window-component)
   ((result :accessor result
	   :initform nil))
   (:default-initargs
     :title "Form Test"
     :content-type "text/html; charset=utf-8;"
     :javascript nil))

(defaction handle-string-form ((session form-test) (my-form string- 
form))
   (setf (result session) (value (string-input my-form))))

(defmethod render ((session form-test))
   (let ((the-form (make-instance 'string-form)))
     (<ucw:simple-form :action (handle-string-form session the-form)
		      :method "POST"
		      (<:p (render (string-input the-form)))
		      (<:p (<:submit :value "Submit")))))

It will even do this if the defaction form does nothing at all, i.e.:

(defaction handle-string-form ((session form-test) (my-form string- 
form)))


-Hazen



More information about the bese-devel mailing list