From achiumenti at common-lisp.net Sat Jun 14 05:16:02 2008 From: achiumenti at common-lisp.net (achiumenti at common-lisp.net) Date: Sat, 14 Jun 2008 01:16:02 -0400 (EDT) Subject: [claw-cvs] r50 - in trunk/main/claw-core: src tests Message-ID: <20080614051602.2C6286D23C@common-lisp.net> Author: achiumenti Date: Sat Jun 14 01:16:01 2008 New Revision: 50 Modified: trunk/main/claw-core/src/components.lisp trunk/main/claw-core/src/lisplet.lisp trunk/main/claw-core/src/misc.lisp trunk/main/claw-core/src/packages.lisp trunk/main/claw-core/src/server.lisp trunk/main/claw-core/src/tags.lisp trunk/main/claw-core/src/translators.lisp trunk/main/claw-core/tests/test1.lisp Log: a lot of bug fixes. Modified: trunk/main/claw-core/src/components.lisp ============================================================================== --- trunk/main/claw-core/src/components.lisp (original) +++ trunk/main/claw-core/src/components.lisp Sat Jun 14 01:16:01 2008 @@ -33,9 +33,9 @@ (:documentation "Internal method to determine, during the rewinding phase, if the COMP has been fired for calling its action. - OBJ the wcomponent instance - PAGE-OBJ the wcomponent owner page")) - + (defgeneric component-id-and-value (cinput &key from-request-p) - (:documentation "Returns the form component \(such as and and TYPE attribute. For submit type, use the CSUBMIT> function.")) + :documentation "The html TYPE attribute. For submit type, use the CSUBMIT> function.")) (:metaclass metacomponent) (:default-initargs :reserved-parameters (list :value :name) :empty t :type "text") (:documentation "Request cycle aware component the renders as an INPUT tag class")) @@ -218,13 +254,13 @@ (closer-mop:ensure-finalized class) (setf (documentation (find-symbol (format nil "~a>" (class-name class))) 'function) (format nil "Description: ~a~%Parameters:~%~a~a~a~%~%~a" - "Function that instantiates a CINPUT component and renders a html tag." + "Function that instantiates a CINPUT component and renders a html tag." *id-and-static-id-description* (describe-html-attributes-from-class-slot-initargs (find-class 'base-cinput)) (describe-html-attributes-from-class-slot-initargs class) (describe-component-behaviour class)))) -(defmethod wcomponent-template ((cinput cinput)) +(defmethod wcomponent-template ((cinput cinput)) (let ((client-id (htcomponent-client-id cinput)) (type (input-type cinput)) (translator (translator cinput)) @@ -243,20 +279,53 @@ (wcomponent-informal-parameters cinput)))) (defmethod wcomponent-after-rewind ((cinput base-cinput) (page page)) - (let ((visit-object (or (cinput-visit-object cinput) page)) - (accessor (cinput-accessor cinput)) - (writer (cinput-writer cinput)) - (validator (validator cinput)) - (value (translator-decode (translator cinput) cinput))) + (when (cform-rewinding-p (page-current-form page) page) + (let ((visit-object (or (cinput-visit-object cinput) page)) + (accessor (cinput-accessor cinput)) + (writer (cinput-writer cinput)) + (validator (validator cinput)) + (value (translator-decode (translator cinput) cinput))) (unless (or (null value) (component-validation-errors cinput)) (when validator (funcall validator value)) (unless (component-validation-errors cinput) (if (and (null writer) accessor) (funcall (fdefinition `(setf ,accessor)) value visit-object) - (funcall (fdefinition writer) value visit-object)))))) + (funcall (fdefinition writer) value visit-object))))))) -(defmethod component-id-and-value ((cinput base-cinput) &key (from-request-p t)) +(defclass ctextarea (base-cinput) + () + (:metaclass metacomponent) + (:default-initargs :reserved-parameters (list :name) :empty nil) + (:documentation "Request cycle aware component the renders as an INPUT tag class")) + +(let ((class (find-class 'ctextarea))) + (closer-mop:ensure-finalized class) + (setf (documentation (find-symbol (format nil "~a>" (class-name class))) 'function) + (format nil "Description: ~a~%Parameters:~%~a~a~a~%~%~a" + "Function that instantiates a CTEXTAREA component and renders a html