[claw-cvs] r120 - trunk/main/claw-html/src

Andrea Chiumenti achiumenti at common-lisp.net
Tue Oct 21 12:43:24 UTC 2008


Author: achiumenti
Date: Tue Oct 21 12:43:23 2008
New Revision: 120

Log:
several bugfixes and enhancements

Modified:
   trunk/main/claw-html/src/packages.lisp
   trunk/main/claw-html/src/tags.lisp
   trunk/main/claw-html/src/validators.lisp

Modified: trunk/main/claw-html/src/packages.lisp
==============================================================================
--- trunk/main/claw-html/src/packages.lisp	(original)
+++ trunk/main/claw-html/src/packages.lisp	Tue Oct 21 12:43:23 2008
@@ -180,6 +180,7 @@
            #:generate-id
            #:metacomponent
            #:wcomponent
+           #:wcomponent-created
            #:wcomponent-informal-parameters
            #:wcomponent-allow-informal-parametersp
            #:wcomponent-template

Modified: trunk/main/claw-html/src/tags.lisp
==============================================================================
--- trunk/main/claw-html/src/tags.lisp	(original)
+++ trunk/main/claw-html/src/tags.lisp	Tue Oct 21 12:43:23 2008
@@ -183,6 +183,9 @@
 (defgeneric (setf slot-initialization) (value wcomponent slot-initarg)
   (:documentation "Sets a slot by its :INITARG. It's used just after instance creation"))
 
+(defgeneric wcomponent-created (wcomponent)
+  (:documentation "Method called just before the make-component function exits. Do additional instance initialization here."))
+
 (defgeneric wcomponent-before-rewind (wcomponent page)
   (:documentation "Method called by the framework before the rewinding phase. It is intended to be eventually overridden in descendant classes.
  - WCOMPONENT is the tag instance
@@ -1152,6 +1155,9 @@
     :allow-informal-parameters t)
   (:documentation "Base class for creationg customized web components. Use this or one of its subclasses to make your own."))
 
+(defmethod wcomponent-created ((wcomponent wcomponent))
+  nil)
+
 (defun slot-initarg-p (initarg class-precedence-list)
   "Returns nil if a slot with that initarg isn't found into the list of classes passed"
   (loop for class in class-precedence-list
@@ -1205,6 +1211,7 @@
     (loop for (initarg value) on parameters by #'cddr
        do (setf (slot-initialization instance initarg) value))
     (setf (htcomponent-body instance) content)
+    (wcomponent-created instance)
     instance))
 
 (defun build-component (component-name &rest rest)

Modified: trunk/main/claw-html/src/validators.lisp
==============================================================================
--- trunk/main/claw-html/src/validators.lisp	(original)
+++ trunk/main/claw-html/src/validators.lisp	Tue Oct 21 12:43:23 2008
@@ -197,9 +197,11 @@
 
 
 ;; ------------------------------------------------------------------------------------
-(defclass exception-monitor (wcomponent) ()
+(defclass exception-monitor (wcomponent) 
+  ((class :initarg :class
+          :reader class-name))
   (:metaclass metacomponent)
-  (:default-initargs :json-render-on-validation-errors-p t)
+  (:default-initargs :json-render-on-validation-errors-p t :class "")
   (:documentation "If from submission contains exceptions. It displays exception messages"))
 
 (let ((class (find-class 'exception-monitor)))
@@ -215,6 +217,7 @@
   (let ((client-id (htcomponent-client-id exception-monitor))
         (body (htcomponent-body exception-monitor)))
     (div> :static-id client-id
+          :class (format nil "exceptionMonitor ~@[ ~a~]" (class-name exception-monitor))
           (wcomponent-informal-parameters exception-monitor)
           (when *validation-errors*
             (if body




More information about the Claw-cvs mailing list