[Bese-devel] small patch suggestion

Friedrich Dominicus frido at q-software-solutions.de
Wed Aug 31 14:58:34 UTC 2005


After Drew has put me in the ground (to some extend he's right) here's
a small addition to form.lisp. I'm not sure if it's good idea, or if
it would be better to derive another component, but I feel if things
are available in standard HTML they should be easy accessible to
Common Lisp also

I guess it's clear what the patch is supposed to do. It should limit
the entry field length, I replaces the nil :initform to size because I
do not think that size could be anything else but a number. I tried
this patch here and it "seems" to be ok. So feel free to ignore or
apply this patch Marco. The numbers are arbitrary, I do not know if
there is a useful default for it.

BTW. I'm quite happy that UCW exists, but I feld and sometimes feel
lost in it's usage. 

Regards
Friedrich


--- form.lisp.2005-08-31	2005-08-20 13:45:59.000000000 +0200
+++ form.lisp	2005-08-31 16:47:24.000000000 +0200
@@ -52,12 +52,14 @@
 ;;;; Generic Text 
 
 (defclass text-field (form-element)
-  ((size :accessor size :initarg :size :initform nil))
+  ((size :accessor size :initarg :size :initform 0) 
+   (maxlength :accessor maxlength :initarg :maxlength :initform 20))
   (:metaclass standard-component-class))
 
 (defmethod render-on ((res response) (field text-field))
   (<ucw:input :type "text" :class "ucw-text-field" :accessor (client-value field)
-              :size (size field)))
+              :size (size field)
+              :maxlength (maxlength field)))
 
 (defvar *completing-text-field-prefix-counter* 0)
 



More information about the bese-devel mailing list