X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/e1645f63189477f1b39a173a41fcbbfefb5e88a6..88670beca060fc94190b30d4dc6ccb38dbe2fbcd:/src/attributes/numbers.lisp diff --git a/src/attributes/numbers.lisp b/src/attributes/numbers.lisp index a2d4b8f..45d8aaa 100644 --- a/src/attributes/numbers.lisp +++ b/src/attributes/numbers.lisp @@ -12,6 +12,9 @@ (defattribute integer-attribute (number-attribute integer-field) () (:in-layer editor) + (:default-initargs + :default-value "" + :default-value-predicate (complement #'numberp)) (:type-name integer)) @@ -41,16 +44,21 @@ () (:type-name currency)) + (defdisplay + :in-layer t ((currency currency-attribute) object) - (<:as-html "$") - (call-next-method)) -(defdisplay :in-layer editor - ((currency currency-attribute) object) - (<:as-html "$") + (<:as-html (format nil "$~$" (or (attribute-value object currency) "")))) + +(defdisplay + :in-layer editor + ((currency currency-attribute) object) + (LET ((value (attribute-value (object currency) currency))) (<:input - :type "text" - :id (id currency) - :name (callback currency) - :value (format nil "~$" (or (attribute-value object currency) "")))) + :NAME + (callback currency) + :VALUE (escape-as-html (strcat (display-value currency value))) + :TYPE + "text")) + )